BEP-345: Implement EIP-7516: BLOBBASEFEE opcode #345
Merged
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.
BEP-345: Implement EIP-7516: BLOBBASEFEE opcode
1. Summary
As part of Cancun upgrade, EIP-7516: BLOBBASEFEE opcode is required to be implemented to BSC.
2. Abstract
Add a
BLOBBASEFEE (0x4a)
that returns the value of the blob base-fee of the current block it is executing in. It is the identical to EIP-3198 (BASEFEE
opcode) except that it returns the blob base-fee as per EIP-4844.3. Motivation
The intended use case would be for contracts to get the value of the blob base-fee. This feature enables blob-data users to programmatically account for the blob gas price, eg:
4. Specification
Add a
BLOBBASEFEE
opcode at(0x4a)
, with gas cost2
.BLOBBASEFEE
returns the result of theget_blob_gasprice(header) -> int
function as defined in EIP-4844 §Gas accounting.5. Rationale
Gas cost
The value of the blob base-fee is needed to process data-blob transactions. That means its value is already available before running the EVM code.
The opcode does not add extra complexity and additional read/write operations, hence the choice of
2
gas cost. This is also identical to EIP-3198 (BASEFEE
opcode)'s cost as it just makes available data that is in the header.6. Backwards Compatibility
There are no known backward compatibility issues with this opcode.
7. Security Considerations
The value of the blob base-fee is not sensitive and is publicly accessible in the block header. There are no known security implications with this opcode.
8. License
The content is licensed under CC0.
9. Reference
Carl Beekhuizen (@CarlBeek), "EIP-7516: BLOBBASEFEE opcode [DRAFT]," Ethereum Improvement Proposals, no. 7516, September 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7516.