主页EIPs周刊
EIPsEIP-7516
EIP-7516

BLOBBASEFEE instruction

Instruction that returns the current data-blob base-fee
FinalStandards Track: Core
创建时间: 2023-09-11
关联 EIP: EIP-3198, EIP-4844
Carl Beekhuizen (@carlbeek)
社区讨论原文链接编辑
1 分钟了解
欢迎补充好内容
去提交
相关视频
欢迎补充好内容
去提交
正文

Abstract

Add a BLOBBASEFEE (0x4a) instruction 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.

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.

Specification

Add a BLOBBASEFEE instruction with opcode 0x4a, with gas cost 2.

OpInputOutputCost
0x4a012

BLOBBASEFEE returns the result of the get_blob_gasprice(header) -> int function as defined in EIP-4844 §Gas accounting.

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 instruction 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.

Backwards Compatibility

There are no known backward compatibility issues with this instruction.

Test Cases

Nominal Case

Assume calling get_blob_gasprice(header) (as defined in EIP-4844 §Gas accounting) on the current block's header returns 7 wei: BLOBBASEFEE should push the value 7 (left padded byte32) to the stack.

Bytecode: 0x4900 (BLOBBASEFEE, STOP)

PcOpCostStackRStack
0BLOBBASEFEE2[][]
1STOP0[7][]

Output: 0x Consumed gas: 2

Comprehensive Test Suite

A complete suite of tests can be found here.

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 instruction.

Copyright and related rights waived via CC0.

扩展阅读
欢迎补充好内容
去提交

不想错过最新的 EIP 动态?

订阅 EIPs Fun 周刊以跟进相关更新,建⽴你与 EIP 之间的连接 ,更好地建设以太坊。

详情
支持以太坊贡献者,推动生态建设
资源
GitHub
支持社区