feat(shadow): XMSS prover-cost model for the Shadow simulator (default-off)#366
Merged
Conversation
Shadow runs the real binary but doesn't charge CPU, so gean's slow XMSS
proving would run in ~0 virtual time and the simulation would be unrepresentative.
Model the cost as virtual-time sleeps sized by signatures/second rates, exposed
via --shadow-xmss-{aggregate,verify-aggregated,verify}-signatures-rate. Every
rate defaults to 0 (no-op), so a production node is unaffected; the sleeps sit
after the real op and never change its inputs, outputs, or validity decision.
Aggregate + single-verify sleeps run off the Engine tick loop; docker-build also
tags the image :shadow for the fuzzer.
Shadow's virtual clock starts at unix 946684800 (2000-01-01), so a wall-clock genesis sits decades in the sim future and no slot ever fires. Add --genesis-time so a driver can anchor genesis to the sim epoch.
Incidental additions carried alongside the Shadow work: the gean-engineer command + gean-perf skill, a workflow that keeps this branch rebased on main, a SECURITY.md disclosure policy, and .gitignore entries.
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.
Shadow simulator: XMSS prover-cost model (default-off)
Brings the Shadow prover-cost model into
devnet-5so the publishedghcr.io/geanlabs/gean:devnet5image carries the--shadow-xmss-*flags. Theydefault to
0(no-op), so a real devnet node is unaffected — but the fuzzer canthen drive the single
:devnet5tag directly (it passes non-zero rates), insteadof maintaining a separate
:shadowimage whose lifecycle silently decouples frommainline.
Why
Shadow runs the real binary but doesn't charge CPU. gean's XMSS proving is the
slowest thing it does, so under Shadow it would run in ~0 virtual time and the
simulation would be wildly unrepresentative of real slot timing. Every other lean
client models this; this is gean's model.
What's included
feat(shadow)— the cost model + flags.internal/shadow/sizes avirtual-time sleep from a signatures/second rate (
n-signature op sleepsn/rateseconds). Exposed via--shadow-xmss-{aggregate,verify-aggregated,verify}-signatures-rate; eachdefaults to
0. The sleeps sit after the real XMSS op and never alter itsinputs, outputs, or validity decision — timing only. Aggregate + single-verify
sleeps run off the Engine tick loop.
docker-buildalso tags the image:shadow.feat(keygen)— genesis overrides.--genesis-timeso a driver can anchorgenesis to Shadow's virtual epoch (unix 946684800); otherwise a wall-clock
genesis sits decades in the sim future and no slot fires.
chore— incidental. Carried alongside the Shadow work, unrelated to themodel: the
gean-engineercommand +gean-perfskill, an auto-rebase workflow,SECURITY.md, and.gitignoreentries.Relationship to #365
This branch previously contained the aggregation budget-trim fix. That landed
separately via #365, so this branch has been rebased on top of it and no
longer carries the fix — the diff here is purely the Shadow delta above.
Safety / verification
never sleeps; consensus behavior is unchanged.
Shadow (rate-8: finalization advanced uniformly across all nodes, aggregation at
budget) — the rebase only re-parented it onto the post-fix(aggregation): bound per-pass aggregation to the session budget #365
devnet-5.internal/shadow/ the maintenance notes):SleepVerifyAggregatedcurrently runs on the Engineselectloop, so a largeaggregated-verify rate can skew tick timing. Keep that rate modest; moving it
off-loop is follow-up work. The other two sleeps are off-loop.