-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Implement London EVMVersion and the BASEFEE opcode #11647
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
Conversation
|
I really fix that just like with Berlin, this shouldn't be a single large PR, but rather:
I would merge 1) now, but would not merge 2) before the hardfork goes live (~3 weeks from now). |
|
@axic I'll split this up, once I can get the CI working. About the second part, why not add |
docs/cheatsheet.rst
Outdated
| to ``abi.encodeWithSelector(bytes4(keccak256(bytes(signature)), ...)``` | ||
| - ``bytes.concat(...) returns (bytes memory)``: :ref:`Concatenates variable number of | ||
| arguments to one byte array<bytes-concat>` | ||
| - ``block.basefee`` (``uint``): current block's basefee |
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.
Maybe we should explain basefee (at least mention it) in the documentation and link it here?
It worked before when we could mark those as "experimental", but you have removed that option 😅 |
cc4041d to
2457f10
Compare
|
This looks good to me, though:
|
| // data_acaf3289d7b601cbd114fb36c4d29c85bbfd5e133f14cb355c3fd8d99367964f 48656c6c6f2c20576f726c6421 | ||
| // Bytecode: 6006600055fe48656c6c6f2c20576f726c6421 | ||
| // Opcodes: PUSH1 0x6 PUSH1 0x0 SSTORE INVALID 0x48 PUSH6 0x6C6C6F2C2057 PUSH16 0x726C6421000000000000000000000000 | ||
| // Opcodes: PUSH1 0x6 PUSH1 0x0 SSTORE INVALID BASEFEE PUSH6 0x6C6C6F2C2057 PUSH16 0x726C6421000000000000000000000000 |
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.
:)
|
Why wait? As long as we do not change the default evm version it should be fine. |
Because if the fork falls through there's just extra stuff to be removed. It is really one week away so makes little difference in terms of "stalled PRs" waiting that out :) |
leonardoalt
left a comment
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.
Minor comment, looks good
Changelog.md
Outdated
| * Commandline Interface: option ``--pretty-json`` works also with ``--standard--json``. | ||
| * SMTChecker: Unproved targets are hidden by default, and the SMTChecker only states how many unproved targets there are. They can be listed using the command line option ``--model-checker-show-unproved`` or the JSON option ``settings.modelChecker.showUnproved``. | ||
| * SMTChecker: new setting to enable/disable encoding of division and modulo with slack variables. The command line option is ``--model-checker-div-mod-slacks`` and the JSON option is ``settings.modelChecker.divModWithSlacks``. | ||
| * Type System: Introduced global ``block.basefee`` for retrieving the base fee of the current block. |
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.
Maybe also add the added Yul function?
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.
Added this below.
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.
Isn't this a language feature instead of a compiler feature? Both of them?
Also added basefee to Yul grammar.
Also set the value of `block_base_fee` for testing to 7 wei.
docs/cheatsheet.rst
Outdated
| to ``abi.encodeWithSelector(bytes4(keccak256(bytes(signature)), ...)``` | ||
| - ``bytes.concat(...) returns (bytes memory)``: :ref:`Concatenates variable number of | ||
| arguments to one byte array<bytes-concat>` | ||
| - ``block.basefee`` (``uint``): current block's base fee (EIP-3198 and EIP-1559) |
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.
link to the EIP?
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.
Added links and fixed the changelog.
Changelog.md
Outdated
| ### 0.8.7 (unreleased) | ||
|
|
||
| Language Features: | ||
| * Type System: Introduced global ``block.basefee`` for retrieving the base fee of the current block. |
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.
| * Type System: Introduced global ``block.basefee`` for retrieving the base fee of the current block. | |
| * Introduced global ``block.basefee`` for retrieving the base fee of the current block. |
(also the code generator is affected)
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.
Fixed this.
| bool hasSelfBalance() const { return *this >= istanbul(); } | ||
| bool hasBaseFee() const { return *this >= london(); } | ||
|
|
||
| bool hasOpcode(evmasm::Instruction _opcode) const; |
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.
Needs change
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.
It's done in 0c8b612
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.
Or second commit in #11763
| | chainid() | | I | ID of the executing chain (EIP 1344) | | ||
| | chainid() | | I | ID of the executing chain (EIP-1344) | | ||
| +-------------------------+-----+---+-----------------------------------------------------------------+ | ||
| | basefee() | | L | current block's base fee (EIP-3198 and EIP-1559) | |
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.
The doc on the top also explains what these letters stand for, L is missing.
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.
Thanks. Fixed.
ekpyron
left a comment
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.
Any reason for not merging #11763 into this first :-)? Strictly speaking, that'd make more sense. Not that it matters too much, if we merge all of them anyways, though.
Anyways, looks fine despite minor comments.
Fixes #11390
Need to fix evmone CI issues.