fix(testing): tell the fixture when slot processing is skipped - #1212
Open
gopikannappan wants to merge 1 commit into
Open
gopikannappan wants to merge 1 commit into
gopikannappan wants to merge 1 commit into
Conversation
Closes leanEthereum#1198. Two state-transition tests process a block against a state deliberately left behind the block's slot, because that mismatch is the rejection they test. The spec does that by skipping slot processing, but the emitted fixture said nothing about it, so a runner replaying the fixture ran the whole state transition, advanced the slot first, never reached the mismatch, and had no way to know why. The fixture now carries a per-block `skipSlotProcessing` list. It is emitted only when some block needs it, so every ordinary fixture stays byte-identical, and an absent field keeps meaning what runners already do. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Closes #1198.
test_block_with_wrong_slotandtest_block_at_parent_slot_rejected_when_slot_processing_skippedboth process a block against a state deliberately left behind the block's slot, because that mismatch is the rejection they test. The spec arranges it withBlockSpec.skip_slot_processing, but the emitted fixture said nothing about it.So a runner replaying the fixture calls the whole state transition, advances the slot first, never reaches the mismatch, and has no way to tell whether the fixture is wrong or its own client is. As the issue puts it, test runners cannot know which tests they should skip slot processing for.
The change
The fixture gains a per-block
skipSlotProcessinglist:It is emitted only when at least one block needs it. Every other fixture is byte-identical to before, and an absent field keeps meaning exactly what runners already do, so nothing existing has to change.
I wrote it as a list beside
blocksrather than as something attached to each block, because a block is an SSZ container and this is an instruction to the runner rather than part of the block.Checked against the real output
Not just unit tested. Running
fillfor the two tests named in the issue, both fixtures now carryskipSlotProcessing: [true], andtest_block_extends_deep_chain, an ordinary test, emits no such field. The determinism check passes in both runs.Three tests cover it: an ordinary run emits nothing, a skipping run emits the flag, and a run that mixes both pins
[true, false]. That last one matters, because a single flag or a list built in the wrong order would pass a test where every block skips. I checked both mutations: reversing the list fails the ordering test, and never emitting the field fails two of the three.ruff check,ruff format --check,ty checkandcodespellare all clean.