feat(xmss): deterministic fake prover for Shadow sims (ZEAM_SHADOW_XMSS_FAKE)#1007
Open
GrapeBaBa wants to merge 1 commit into
Open
feat(xmss): deterministic fake prover for Shadow sims (ZEAM_SHADOW_XMSS_FAKE)#1007GrapeBaBa wants to merge 1 commit into
GrapeBaBa wants to merge 1 commit into
Conversation
…SS_FAKE) Opt-in stub that replaces the real leanMultisig STARK prove/verify FFI with a deterministic SHA-256 counter-mode proof when ZEAM_SHADOW_XMSS_FAKE is set. Under Shadow the real prover runs as native compute charged to virtual time, an uncontrollable baseline on top of the injected --shadow-xmss-*-rate sleep; the stub removes that baseline so the injected rate is the sole prover-cost knob for cost-sweep experiments. - shadow_cost: one process-global fake toggle, env-only, off by default. - aggregation: aggregateType1 / mergeType1ToType2 / splitType2ByMessage / verifyType1 / verifyType2 emit the stub; the sim-cost sleeps still run on the virtual clock, only the real prove/verify is bypassed. - Stub bytes are seeded only from wire-bound inputs (message hash, slot, child-proof bytes, participant counts), never per-process pointer handles, so every node yields identical bytes for identical inputs (consensus-safe). Off by default: with no rate set and fake off, behavior is byte-identical to before. Verified on Zig 0.16.0: test-shadow-cost + zig build test (-Dprover=dummy) green, including 4 new fake-path tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an opt-in deterministic fake XMSS prover for Shadow simulation, gated behind the
ZEAM_SHADOW_XMSS_FAKEenv var (off by default). When enabled, the five leanMultisig STARK FFI wrappers —aggregateType1,mergeType1ToType2,splitType2ByMessage,verifyType1,verifyType2— return a deterministic SHA-256 counter-mode stub instead of calling the real prover/verifier.Why
Under Shadow, the real STARK prove/verify runs as native compute and is charged to virtual time as an uncontrollable baseline on top of the injected
--shadow-xmss-*-ratesleep. That contaminates prover-cost-sweep experiments — you can't isolate the effect of the injected rate. Replacing the prover with a deterministic stub removes the baseline, leaving the injected rate as the sole, clean prover-cost knob.The existing
--shadow-xmss-*-ratesim-cost sleeps are preserved and still run on the virtual clock; only the real STARK compute is bypassed.Safety / determinism
Scope
zeam-side only. The Shadow operator tooling that delivers the env var to nodes (the
lean-shadow-fuzzergenerate-shadow-yaml.shpatch) lives in a separate repo and is a follow-up.Test plan
zig build test-shadow-cost(Zig 0.16.0) — fake toggle + delay modelzig build test -Dprover=dummy(Zig 0.16.0) — xmss tests including 4 new fake-path tests:verifyType2round-tripverifyType1round-trip