refactor(test-fill): use the shared sync-payload builder for sync fixtures - #3405
Draft
danceratopz wants to merge 1 commit into
Draft
refactor(test-fill): use the shared sync-payload builder for sync fixtures#3405danceratopz wants to merge 1 commit into
danceratopz wants to merge 1 commit into
Conversation
The blockchain_test_sync format built its syncPayload inline: an unsalted empty block, no guard for heads no payload can be built above, and no defined failure. The engine_x format's syncPayloads entries already have all of that in build_sync_payload. Build the sync format's payload there too. The sync format supports only valid linear chains. Their payload graph has exactly one leaf—the final test payload—and the format's single syncPayload field announces it. No leaf selection is involved; the payload is built above the chain's final built block. Consequences, all deliberate: - Every blockchain_test_sync fixture changes its published bytes: the payload's extra_data now carries the 16-byte per-test salt digest, which changes the payload's block hash and the fixture's _info hash. The whole corpus today is the EIP-7934 max-RLP family (5 verify_sync marks, 9 fixtures). The salt buys this format nothing functionally right now, because consume sync boots two fresh clients per fixture, so no head is ever announced twice; the win is one builder instead of two, the guard and the defined failure for free, and fixtures that behave identically if the simulator ever reuses clients. - A head the filler cannot build above now fails the fill, naming the reason and the conflict. An engine_x fixture omits that chain head's sync payload in this case, but a sync fixture could not serve its consumer without its mandatory payload. - The payload is built regardless of --no-sync-block and of a test's sync_block=False setting: those govern the engine_x format's optional list, and this format's payload is its defining field. - Payload rejection cases stay unsupported. The assertion now rejects both expected-invalid payloads and Engine API error-code assertions anywhere in the sequence, including cases where a later payload gives the filler a valid head. Such sequences do not form the all-accepted linear chain represented by the single syncPayload field. Verified by filling the corpus before and after: every fixture is field-for-field identical except extra_data (empty to digest, 9 distinct values) and the block hash it implies. A consume sync smoke of the salted corpus via hive --dev (geth as both client under test and sync client) passes 9 of 9.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## experiments/wirex-fill #3405 +/- ##
=======================================================
Coverage 93.53% 93.53%
=======================================================
Files 624 624
Lines 37074 37074
Branches 3394 3394
=======================================================
Hits 34679 34679
Misses 1645 1645
Partials 750 750
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
2 tasks
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.
Description
Note
This PR is stacked on #3364. Until #3364 lands, please review only this PR's final commit. Once #3364 merges, this PR will be retargeted to
forks/amsterdam.The
blockchain_test_engine_xandblockchain_test_syncformats now build their framework-generated sync payloads through the samebuild_sync_payloadhelper. The sync format previously built its singularsyncPayloadinline, without the per-test salt or the checks and defined failure behavior introduced for EngineX by #3364.For the sync format's valid linear chains:
Gis genesis,T₁…Tₙare test payloads,Sis the empty sync payload, and*marks the payload announced to the sync client. The sync payload is appended above the test-chain head and stored separately in the singularsyncPayloadfield. The test'sengineNewPayloads,lastblockhash, and post-state assertion remain unchanged.Behavioral consequences for
blockchain_test_syncfixtures:extraDatanow carries a 16-byte digest of the test ID, giving it a test-specificblockHash. All nine existing fixtures of this format therefore change inextraData, the resultingblockHash, and fixture metadata; their parent, state root, and fee fields remain unchanged.syncPayloadremains mandatory.--no-sync-blockand a test'ssync_block=Falseaffect only the EngineX format's optionalsyncPayloadslist.For implementation and format details, read Sync Payloads first, followed by the
blockchain_test_syncformat reference.Validation:
just staticpasses.extraData, its resultingblockHash, and fixture metadata.consume syncsmoke test using geth as both clients passes all 9 fixtures in 33 seconds; each sync client progresses fromSYNCINGtoVALID, and the head state is verified througheth_getBlockByHash.Related Issues or PRs
Depends on #3364.
Checklist
just static<type>(<area>): <title>, where<type>and<area>come from an appropriateC-<type>, respectivelyA-<area>, label. The title should match the target squash commit message.Cute Animal Picture
One builder, one branch.