From ed54cdb1a790870df34ad71f55441f40d62813c3 Mon Sep 17 00:00:00 2001 From: Carl Beekhuizen Date: Wed, 13 Sep 2023 10:46:42 -0600 Subject: [PATCH] Update EIP-7516: BLOBBASEFEE opcode Merged by EIP-Bot. --- EIPS/eip-7516.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/EIPS/eip-7516.md b/EIPS/eip-7516.md index 0c6b05a254fb9a..89db18af9363cf 100644 --- a/EIPS/eip-7516.md +++ b/EIPS/eip-7516.md @@ -3,7 +3,7 @@ eip: 7516 title: BLOBBASEFEE opcode description: Opcode that returns the current data-blob base-fee author: Carl Beekhuizen (@carlbeek) -discussions-to: https://ethereum-magicians.org/t/eip-75xx-blobbasefee/15761 +discussions-to: https://ethereum-magicians.org/t/eip-7516-blobbasefee-opcode/15761 status: Draft type: Standards Track category: Core @@ -24,18 +24,20 @@ The intended use case would be for contracts to get the value of the blob base-f ## Specification -Add a `BLOBBASEFEE` opcode at `(0x49)`, with gas cost `G_base`. +Add a `BLOBBASEFEE` opcode at `(0x49)`, with gas cost `2`. | Op | Input | Output | Cost | |------|-------|--------|------| | 0x49 | 0 | 1 | 2 | +`BLOBBASEFEE` returns the result of the `get_blob_gasprice(header) -> int` function as defined in [EIP-4844 §Gas accounting](./eip-4844.md#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 opcode does not add extra complexity and additional read/write operations, hence the choice of `G_base` gas cost. This is also identical to [EIP-3198](./eip-3198.md) (`BASEFEE` opcode)'s cost as it just makes available data that is in the header. +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](./eip-3198.md) (`BASEFEE` opcode)'s cost as it just makes available data that is in the header. ## Backwards Compatibility @@ -45,8 +47,8 @@ There are no known backward compatibility issues with this opcode. ### Nominal case -Assuming current block's data-blob base-fee is `7 wei`. -This should push the value `7` (left padded byte32) to the stack. +Assuming calling `get_blob_gasprice(header)` (as defined in [EIP-4844 §Gas accounting](./eip-4844.md#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`)