EIP-7742 - gas calculation using target_blobs_per_block#7823
Merged
siladu merged 2 commits intobesu-eth:mainfrom Dec 5, 2024
Merged
EIP-7742 - gas calculation using target_blobs_per_block#7823siladu merged 2 commits intobesu-eth:mainfrom
siladu merged 2 commits intobesu-eth:mainfrom
Conversation
|
This pr is stale because it has been open for 30 days with no activity. |
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
fab-10
approved these changes
Dec 4, 2024
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.
PR description
The approach uses the Optional
targetBlobsPerBlockfield to trigger the new behaviour rather than explicitly checking the fork.targetBlobsPerGasis sent to Besu via newPayloadV4 (see #7840) where it will be added to the block header (see #7808).CancunGasCalculator.computeExcessBlobGaswas pulled up as default method onGasCalculatorinterface so it can be inherited byPragueGasCalculatoras well as future gas calculators.It was not desirable to leave
CancunGasCalculatoruntouched and override inPragueGasCalculator(the typical pattern for forks) because the method signature needed to change in order to avoid leaking conditional fork behaviour to the callers (BlobGasValidationRuleandExcessBlobGasCalculator).In
GasCalculator, the presence of the dynamictargetBlobsPerBlock(on the parent header) causes its value to replace the staticCancunGasCalculator.TARGET_BLOB_GAS_PER_BLOCK(equivalent to 3 blobs).Instead of the hardcoded value from 4844 (
TARGET_BLOB_GAS_PER_BLOCK),parentTargetBlobGasis now calculated viablobGasCost(parentTargetBlobsPerBlock)Part of #7605
Implemented as written in https://github.com/ethereum/EIPs/blob/a78f470331f2150aa1640f348ab4343127d212af/EIPS/eip-7742.mdbut note there are further changes likely coming: ethereum/EIPs#8994Spec for https://eips.ethereum.org/EIPS/eip-7742 was finalized with no further changes
Thanks for sending a pull request! Have you done the following?
doc-change-requiredlabel to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew build./gradlew acceptanceTest./gradlew integrationTest./gradlew ethereum:referenceTests:referenceTests