Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BEP-345: Implement EIP-7516: BLOBBASEFEE opcode #345

Merged
merged 1 commit into from
Jan 17, 2024
Merged

BEP-345: Implement EIP-7516: BLOBBASEFEE opcode #345

merged 1 commit into from
Jan 17, 2024

Conversation

MatusKysel
Copy link
Contributor

  BEP: 345
  Title: Implement EIP-7516: BLOBBASEFEE opcode
  Status: Draft
  Type: Standards
  Created: 2024-01-15

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:

  • Allow rollup contracts to trustlessly account for blob data usage costs.
  • Blob gas futures can be implemented based on it which allows for blob users to smooth out data blob costs.

4. Specification

Add a BLOBBASEFEE opcode at (0x4a), with gas cost 2.

Op Input Output Cost
0x4a 0 1 2

BLOBBASEFEE returns the result of the get_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.

zzzckck
zzzckck previously approved these changes Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants