-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Conversation
|:----: |:-----: |:------: |:----: | | ||
| 0x48 | 0 | 1 | 2 | | ||
|
||
Attempted execution of a `BASEFEE` prior to `eip-1559` fork causes an _`abort`_: terminate execution with an `Invalid Operation` exception. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
### 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. |
There was a problem hiding this comment.
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. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed
Add a `BASEFEE (0x48)` that returns the value of the base fee of the current block it is executing in.
Create
BASEFEE
opcode EIP.