Skip to content

Commit

Permalink
Update EIP-7516: BLOBBASEFEE opcode
Browse files Browse the repository at this point in the history
Merged by EIP-Bot.
  • Loading branch information
CarlBeek authored Sep 13, 2023
1 parent e788377 commit ed54cdb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions EIPS/eip-7516.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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`)

Expand Down

0 comments on commit ed54cdb

Please sign in to comment.