Repository navigation
proof(rpc): prove that a simulated block passes the checks against its parent - #2517
Merged
Merged
Conversation
…s parent The agreement theorem of eth_simulateV1 now derives the checks of a block from facts about the parent, the fork, the time and the size, instead of assuming them. Closes ethereum#2108. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 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.
The agreement theorem of
eth_simulateV1no longer assumes that the block passes the checks against its parent.A new theorem proves those checks from facts about the parent, the fork, the time and the size of the block.
Closes #2108.
The problem
The agreement theorem,
stateTransition_of_simulateBlock, said that a simulated block with validation and no overrides passes the state transition once its calls are signed.It took as a hypothesis that the signed block passes
checkBlock, the checks of a block alone and against its parent.The simulated header is built to pass those checks, so the hypothesis hid part of the claim; the audit of #2512 marked it MAJOR.
The idea
checkBlock_simulateBlockprovescheckBlockfor the signed block.It unfolds the simulated header and checks each rule of
checkHeader_eq_ok_iff:What the header alone cannot give stays a hypothesis, each a fact about a real chain:
2^64, so the header's 64-bit field holds the expected value;The agreement theorem now takes these hypotheses in place of the checks.
Example
A simulation on Mainnet after Prague, on top of a head at number 100 with a gas limit of 36,000,000:
checkBlockpasses and the transition gives the state of the simulated block.For reviewers
SOUNDNESS.mdlists the new hypotheses and drops the line that the checks stay a hypothesis.Checks
lake build --wfail EthLib.Execution.Proofs.Rpc: passes (1727 jobs).lake env leanchecker EthLib.Execution.Proofs.Rpc.SimulateBlocks: passes.scripts/soundness_facts.py --check,scripts/check_lean_layout.py --base upstream/master,scripts/check_layers.py,lake exe check-accessors: pass.🤖 Generated with Claude Code