create2_deploys/create_preimage_deploys with code_pattern: unique_jumpdest_pre_amsterdam materialize one unique 24,576-byte runtime per derived contract inside Expand's returned slice, and generator.Config.materializePreAlloc then retains every blob in Config.GenesisCode for the entire run — peak RSS grows ≈24.6 KB per derived contract (measured: 247.8 MB at 10k contracts, GC-bracketed heap probe; linear → ≈3.7 GB at spec-repricing-min.yaml's 150k, ≈37 GB at 1.5M), while Storage already streams via iter.Seq2.
PR #76's interim guard (added during review hardening) only warns above 2 GiB estimated residency and hard-fails above 64 GiB. Actually bounding residency requires:
- a lazy
Code source on templates.PreAllocEntity (e.g. CodeFn func() []byte or a code iterator alongside Storage),
- teaching
generator.Config.materializePreAlloc not to pin the bytes in GenesisCode,
- updating every client writer (geth, besu, nethermind, reth) to emit code per-entity and release it.
Acceptance: building examples/spec-repricing-min.yaml shows peak RSS independent of salt_count; cross-client genesis roots byte-identical to today's; the 2 GiB specbuild warning removed or demoted.
Related: TODO(template-aware-budget) in internal/specbuild/build.go (per-template ProjectCost) — a sibling blind spot in the same seam, kept separate.
create2_deploys/create_preimage_deployswithcode_pattern: unique_jumpdest_pre_amsterdammaterialize one unique 24,576-byte runtime per derived contract insideExpand's returned slice, andgenerator.Config.materializePreAllocthen retains every blob inConfig.GenesisCodefor the entire run — peak RSS grows ≈24.6 KB per derived contract (measured: 247.8 MB at 10k contracts, GC-bracketed heap probe; linear → ≈3.7 GB atspec-repricing-min.yaml's 150k, ≈37 GB at 1.5M), whileStoragealready streams viaiter.Seq2.PR #76's interim guard (added during review hardening) only warns above 2 GiB estimated residency and hard-fails above 64 GiB. Actually bounding residency requires:
Codesource ontemplates.PreAllocEntity(e.g.CodeFn func() []byteor a code iterator alongsideStorage),generator.Config.materializePreAllocnot to pin the bytes inGenesisCode,Acceptance: building
examples/spec-repricing-min.yamlshows peak RSS independent ofsalt_count; cross-client genesis roots byte-identical to today's; the 2 GiB specbuild warning removed or demoted.Related:
TODO(template-aware-budget)ininternal/specbuild/build.go(per-templateProjectCost) — a sibling blind spot in the same seam, kept separate.