Drop the quote wrapper for INTERNED_GENERATOR - #1522
richardkiss wants to merge 1 commit into
Conversation
Coverage Report for CI Build 36228906768Coverage increased (+0.07%) to 82.502%Details
Uncovered Changes
Coverage Regressions1 previously-covered line in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
e95b446 to
36a917f
Compare
- build_generator() takes a quote: bool param; when false, emits the unquoted spend list ((parent puzzle amount solution) ...) instead of (q . (...)). solution_generator_2026() uses quote: false. - run_block_generator2, get_coinspends_for_trusted_block, get_coinspends_with_conditions_for_trusted_block, and additions_and_removals skip run_program/check_generator_quote/ check_generator_node for INTERNED_GENERATOR: they deserialize the serde_2026 blob and parse the spend list directly. - InternedBlockBuilder: drop the now-unneeded top-level quote execution cost (block_cost 20 -> 0, WRAPPER_VBYTES 11 -> 5). - Add comments explaining the outer wrapper enables soft-fork expansion. Co-authored-by: Cursor <cursoragent@cursor.com>
36a917f to
cf49946
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cf49946. Configure here.
| { | ||
| let mut a = Allocator::new(); | ||
| let generator = build_generator(&mut a, spends)?; | ||
| let generator = build_generator(&mut a, spends, false)?; |
There was a problem hiding this comment.
Interned puzzle lookup still executes
High Severity
get_puzzle_and_solution_for_coin2 still runs the interned generator through run_program after solution_generator_2026 and InternedBlockBuilder dropped the (q . ...) wrapper. That tree is now a spend list, not an executable quote, so puzzle and solution lookup fails for every INTERNED_GENERATOR / serde_2026 block.
Reviewed by Cursor Bugbot for commit cf49946. Configure here.


[agent draft — I haven't reviewed this text yet]
Follow-up to #1511.
(q . ...)quote wrapper from the interned/serde_2026generator format. Since the block is never executed under this flag, wrapping it in a quote (whose only purpose is to makerun_programreturn its argument unchanged) served no purpose and cost 20 gas for nothing.run_block_generator2,get_coinspends_for_trusted_block(_with_conditions),additions_and_removals, andget_puzzle_and_solution_for_coin2now parse the interned spend list directly instead of callingrun_programon it.solution_generator,solution_generator_backrefs) are unchanged.All existing tests updated; new tests cover the unquoted round-trip and the no-execution parse path for
INTERNED_GENERATORacross all four consumers.Note
High Risk
Changes consensus block generator encoding and validation under INTERNED_GENERATOR across builder, cost, and multiple parse paths; incorrect rollout would fork the network at HF2.
Overview
Removes the
(q . ...)quote wrapper from the post–hard-forkserde_2026/INTERNED_GENERATORblock generator. The on-chain blob is now a wrapped spend list((spends...)), not a runnable quoted program, which drops useless quote execution cost and shrinks wrapper vbyte accounting (WRAPPER_VBYTES11→5, empty builderblock_cost0).build_generator(..., quote)keeps quoted output forsolution_generator/solution_generator_backrefs;solution_generator_2026,InternedBlockBuilder::finalize, and interned base-cost inspendbundle_conditionsemit the unquoted tree.With
INTERNED_GENERATOR,run_block_generator2, trusted coinspend helpers, andadditions_and_removalsdecode the spend list directly (viafirst) instead ofrun_programon the generator; quote/node shape checks are skipped on that path. Invalid non–spend-listserde_2026blobs now fail at spend parsing (InvalidCondition) rather thanComplexGeneratorReceived. Tests were updated for the new encoding and hashing (classic reference still quoted for pre-fork comparisons).Reviewed by Cursor Bugbot for commit cf49946. Bugbot is set up for automated code reviews on this repo. Configure here.