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

Create BASEFEE opcode EIP #3198

Merged
merged 9 commits into from
Jan 14, 2021
Merged

Conversation

AbdelStark
Copy link
Contributor

Create BASEFEE opcode EIP.

@AbdelStark AbdelStark marked this pull request as draft January 13, 2021 07:17
@AbdelStark AbdelStark marked this pull request as ready for review January 13, 2021 12:33
|:----: |:-----: |:------: |:----: |
| 0x48 | 0 | 1 | 2 |

Attempted execution of a `BASEFEE` prior to `eip-1559` fork causes an _`abort`_: terminate execution with an `Invalid Operation` exception.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a given for all new opcodes so isn't required in the EIP. If you want to retain it, consider moving it to the backward compatibility section.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I will remote it

Comment on lines +55 to +66
### Failure 1: No base fee in current block
Assuming a block header with no base fee (prior to `eip-1559` fork block).
This should fail, since no base fee is present in current block header.

Bytecode: `0x4800` (`BASEFEE, STOP`)

| Pc | Op | Cost | Stack | RStack |
|-------|-------------|------|-----------|-----------|
| 0 | BASEFEE | 2 | [] | [] |
| 1 | STOP | 0 | [] | [] |

Expected behaviour: Terminate execution with an `Invalid Operation` exception.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned above, I don't think it is necessary to describe behavior prior to the fork block. This would be akin to specifying behavior of an HTTP request prior to the internet being built. 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed

@MicahZoltu MicahZoltu merged commit 8a05963 into ethereum:master Jan 14, 2021
Arachnid pushed a commit to Arachnid/EIPs that referenced this pull request Mar 6, 2021
Add a `BASEFEE (0x48)` that returns the value of the base fee of the current block it is executing in.
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