consensus/istanbul: apply the import body rules in backend.Verify - #1028
Open
hyunsooda wants to merge 1 commit into
Open
consensus/istanbul: apply the import body rules in backend.Verify#1028hyunsooda wants to merge 1 commit into
hyunsooda wants to merge 1 commit into
Conversation
Verify checked the tx root but not the two body rules ValidateBody enforces on import: that every transaction is priced at or above the header's base fee, and that the header's blobGasUsed agrees with the number of blobs in the body. The tx root only commits to the transaction list the proposer chose, so it does not detect either violation, and ValidateHeader cannot detect the second one because it never sees the body. A proposal breaking either rule is therefore PREPARE and COMMIT-ed by honest validators and only refused later on import, costing a round. Apply both rules in Verify, as the EIP-7934 size cap already is. That cap now runs before the transaction loop so a block violating several rules reports the same error the import path would. Constraint: honest proposals must keep passing; both checks mirror ValidateBody verbatim so a block accepted on import is accepted here Rejected: call ValidateBody from Verify | it also returns ErrKnownBlock and ErrPrunedAncestor, which are meaningless or wrong for a proposal Rejected: extract one body validator shared by both paths | needs the deterministic half of ValidateBody split out, and changes the tx-root error sentinel Verify already returns Confidence: high Scope-risk: narrow Not-tested: a proposal breaking these rules over a real consensus round 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.
Proposed changes
Problem
backend.Verifychecked the tx root but not two body rulesValidateBodyenforces on import: that every tx is priced at or above the header's base fee, and that the header'sblobGasUsedagrees with the body. The tx root only commits to the list the proposer chose, andValidateHeadernever sees the body.Fix
Verify, as the EIP-7934 size cap already is. That cap now runs before the transaction loop so a block breaking several rules reports the same error the import path would.Types of changes
Checklist
I have read the CLA Document and I hereby sign the CLAin first time contribute after having read CLA$ make test)Related issues
Further comments