test: Set blob gas budget from the protocol max#1555
Merged
Conversation
So far we were pre-validating the block header blob_gas_used against the protocol max. This was correct, but hid expected per-tx blob gas limit exceeded errors. Changed behavior: start with the protocol max and validate each tx. Compare the block header value at the end. The block validity outcome is unchanged; only the reported error differs (a per-tx blob gas error instead of a block-level one). Matches EELS and other implementations.
There was a problem hiding this comment.
Pull request overview
This PR updates the blockchain test runner’s blob-gas accounting to start from the protocol per-block maximum blob gas budget and decrement per transaction, then compare the resulting blob gas usage against the block header at the end. This keeps block validity outcomes the same while ensuring blob gas limit violations surface as per-transaction errors (matching other clients/spec behavior).
Changes:
- Initialize
apply_block()’s blob gas budget fromstate::max_blob_gas_per_block(blob_params)instead of preloading fromblock.blob_gas_used. - Remove block-level prevalidation that rejected blocks solely because
header.blob_gas_used > protocol_max, so per-tx validation can report the expected error. - Update test assertions/filters to compare
(blob_gas_limit - blob_gas_left)against the header’sblob_gas_used.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1555 +/- ##
=======================================
Coverage 97.09% 97.09%
=======================================
Files 162 162
Lines 14438 14440 +2
Branches 3371 3370 -1
=======================================
+ Hits 14019 14021 +2
Misses 303 303
Partials 116 116
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
So far we were pre-validating the block header blob_gas_used against the protocol max. This was correct, but hid expected per-tx blob gas limit exceeded errors.
Changed behavior: start with the protocol max and validate each tx. Compare the block header value at the end. The block validity outcome is unchanged; only the reported error differs (a per-tx blob gas error instead of a block-level one). Matches EELS and other implementations.