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

Implement pectra devnet-5 spec #3807

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from
Draft

Implement pectra devnet-5 spec #3807

wants to merge 26 commits into from

Conversation

jochem-brouwer
Copy link
Member

@jochem-brouwer jochem-brouwer commented Nov 25, 2024

This PR incorporates the changes of EIP-7702 and EIP-7685 for devnet-5 as outlined in: https://notes.ethereum.org/@ethpandaops/pectra-devnet-5

ethereum/EIPs#8969
ethereum/EIPs#8989
ethereum/execution-apis#574

Will keep this PR as draft, because the 7702 changes might get a follow-up PR (regarding the designator, see: ethereum/EIPs#8969 (comment)) Just got convinced that this is not a problem and we should stick to 0xef01 as "code" when reading from delegated accounts

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

Attention: Patch coverage is 88.40206% with 45 lines in your changes missing coverage. Please review.

Project coverage is 75.60%. Comparing base (3f0f3b5) to head (90fc63a).

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 73.74% <ø> (ø)
blockchain 83.23% <ø> (ø)
client 73.62% <45.94%> (-0.09%) ⬇️
common 89.87% <100.00%> (+0.04%) ⬆️
devp2p 71.84% <ø> (-0.11%) ⬇️
evm 64.87% <95.73%> (+0.27%) ⬆️
genesis 100.00% <ø> (ø)
mpt 52.05% <ø> (-0.04%) ⬇️
rlp 95.11% <ø> (ø)
statemanager 67.76% <ø> (ø)
tx 76.26% <35.29%> (-0.30%) ⬇️
util 72.81% <ø> (ø)
vm 57.67% <95.00%> (+0.64%) ⬆️
wallet 79.67% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@jochem-brouwer
Copy link
Member Author

Have added a review+blocked label, I suggest we use this PR as devnet-5 branch until devnet-4 is taken offline.

@jochem-brouwer
Copy link
Member Author

Devnet-4 is deleted, so we can now merge Devnet-5 changes into master, have removed blocked label.

@jochem-brouwer
Copy link
Member Author

Ah ok tests failing, will fix tomorrow (likely block hashes / request hashes since those have changed)

// TODO: verify that this is the correct designator
// The PR https://github.com/ethereum/EIPs/pull/8969 has two definitions of the
// designator: the original (0xef0100) and the designator added in the changes (0xef01)
const eip7702Designator = hexToBytes('0xef01')
Copy link
Contributor

Choose a reason for hiding this comment

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

Just confirming my thinking. These only get computed once at run time, right? They aren't recomputed every single time we access this code are they?

Copy link
Member Author

Choose a reason for hiding this comment

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

Only computed once! Can also move it somewhere else like types.ts.

@jochem-brouwer jochem-brouwer marked this pull request as ready for review November 26, 2024 15:29
@jochem-brouwer jochem-brouwer marked this pull request as draft November 26, 2024 17:37
@jochem-brouwer
Copy link
Member Author

Have converted this back to "draft" and added blocked label again. This will be our prep-branch for devnet-5. Our master branch will currently support devnet-4 (even though devnet-4 is now nuked). The reason is that the Mekong testnet is devnet-4 specced: https://notes.ethereum.org/@ethpandaops/mekong#Which-versionbranch-do-I-use and it is still up.

Point all devnet-5 related PRs to this PR :) (branch devnet-5)

Copy link
Contributor

@scorbajio scorbajio left a comment

Choose a reason for hiding this comment

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

This looks good, the comments are really useful 🙂

@g11tech
Copy link
Contributor

g11tech commented Dec 7, 2024

changed for ethereum/execution-apis#574 are now in the branch

@g11tech g11tech changed the title Add changes of EIP-7702 and EIP-7685 for devnet-5 to EVM/VM Implement pectra devnet-5 spec Dec 7, 2024
jochem-brouwer and others added 6 commits December 16, 2024 23:57
* common/evm/vm: implement EIP7623 calldata cost increase

* move the floorcost update and add debug log

* fix t8ntool empty requests reporting

* common: add 7623

* tx: add 7623 validator

* t8n: throw on invalid txs

* make cspell happy

---------

Co-authored-by: harkamal <gajinder@g11.in>
@jochem-brouwer
Copy link
Member Author

EVMs BLS tests fail because the test files are outdated. I have updated the addresses, but the tests now fail with "x should not throw" - this throws because we have an assertion check on the gas used and the test files report the old gas (the gas schedule got an update).

if (this.blobVersionedHashes.length > LIMIT_BLOBS_PER_TX) {
const msg = Legacy.errorMsg(this, `tx can contain at most ${LIMIT_BLOBS_PER_TX} blobs`)

const limitBlobsPerTx = this.common.param('maxblobGasPerBlock') / this.common.param('blobGasPerBlob')
Copy link
Member Author

Choose a reason for hiding this comment

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

This param is only available if we activate EIP 7691 🤔 Should we introduce a similar value for EIP-4844? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this was intended, have done so.

@jochem-brouwer
Copy link
Member Author

Ran the latest EEST release, we have some errors on blockchain tests

https://github.com/ethereum/execution-spec-tests/releases/tag/pectra-devnet-5%40v1.1.0

Errors thrown in file: ip2935_historical_block_hashes_from_state/block_hashes/block_hashes_history.json test: tests/prague/eip2935_historical_block_hashes_from_state/test_block_hashes.py::test_block_hashes_history[fork_Prague-blockchain_test-full_history_plus_one_check_blockhash_first]:
	Error: invalid receiptTrie (vm hf=prague -> block number=8192 hash=0xe58c2161d21819bbabe2ec6d1d7bad85c6e7886cce82be6d397353184142731b hf=prague baseFeePerGas=7 txs=1 uncles=0)
	correct last header block
Errors thrown in file: ip7702_set_code_tx/set_code_txs/ext_code_on_chain_delegating_set_code.json test: tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_ext_code_on_chain_delegating_set_code[fork_Prague-blockchain_test]:
	Error: invalid receiptTrie (vm hf=prague -> block number=1 hash=0xdc6e0f5d571acdd4a5fdf48989b4ee673304b4f5d860b0872dfe91e27722ee01 hf=prague baseFeePerGas=7 txs=1 uncles=0)
	correct last header block
Errors thrown in file: ip7702_set_code_tx/set_code_txs/ext_code_on_self_delegating_set_code.json test: tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_ext_code_on_self_delegating_set_code[fork_Prague-blockchain_test-balance_0]:
	Error: invalid receiptTrie (vm hf=prague -> block number=1 hash=0x62c61b509469ba30e9510b1a538a3c4446bfd394714b7e6e2724948b6f15cd92 hf=prague baseFeePerGas=7 txs=1 uncles=0)
	correct last header block
Errors thrown in file: ip7702_set_code_tx/set_code_txs/ext_code_on_self_delegating_set_code.json test: tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_ext_code_on_self_delegating_set_code[fork_Prague-blockchain_test-balance_1]:
	Error: invalid receiptTrie (vm hf=prague -> block number=1 hash=0x96b2ff1d79ff80ae691a4aad4ddd5b721c4eff1085fb409ad70df7139b3ec0b6 hf=prague baseFeePerGas=7 txs=1 uncles=0)
	correct last header block
Errors thrown in file: ip7702_set_code_tx/set_code_txs/ext_code_on_self_set_code.json test: tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_ext_code_on_self_set_code[fork_Prague-blockchain_test-balance_0]:
	Error: invalid receiptTrie (vm hf=prague -> block number=1 hash=0xea1cfe58782c54c546ce3a5ea5393111261647fe15b8ecc28745222c4b5eed23 hf=prague baseFeePerGas=7 txs=1 uncles=0)
	correct last header block
Errors thrown in file: ip7702_set_code_tx/set_code_txs/ext_code_on_self_set_code.json test: tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_ext_code_on_self_set_code[fork_Prague-blockchain_test-balance_1]:
	Error: invalid receiptTrie (vm hf=prague -> block number=1 hash=0x80d4b803f6b2ccb3b967fb6c424ebf3a69e5c519454ce13dda8dea8211167609 hf=prague baseFeePerGas=7 txs=1 uncles=0)
	correct last header block
Errors thrown in file: ip7702_set_code_tx/set_code_txs/ext_code_on_set_code.json test: tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_ext_code_on_set_code[fork_Prague-blockchain_test-EMPTY_ACCOUNT-balance_0]:
	Error: invalid receiptTrie (vm hf=prague -> block number=1 hash=0x04e2aa994dac139ba29645c7e856c2cff46c8d79dcdeb2d6c3de5a021c78ed8c hf=prague baseFeePerGas=7 txs=1 uncles=0)
	correct last header block
Errors thrown in file: ip7702_set_code_tx/set_code_txs/ext_code_on_set_code.json test: tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_ext_code_on_set_code[fork_Prague-blockchain_test-EMPTY_ACCOUNT-balance_1]:
	Error: invalid receiptTrie (vm hf=prague -> block number=1 hash=0xd1f99a6be37085659c0b79fc566ee0c4853e571f3afa0f56e4e16c7026416be5 hf=prague baseFeePerGas=7 txs=1 uncles=0)
	correct last header block
Errors thrown in file: ip7702_set_code_tx/set_code_txs/ext_code_on_set_code.json test: tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_ext_code_on_set_code[fork_Prague-blockchain_test-EOA-balance_0]:
	Error: invalid receiptTrie (vm hf=prague -> block number=1 hash=0xac7062c0d52823ca8d8c38ab5d740cba372fbdf01be90f464e83b135d9f84a28 hf=prague baseFeePerGas=7 txs=1 uncles=0)
	correct last header block
Errors thrown in file: ip7702_set_code_tx/set_code_txs/ext_code_on_set_code.json test: tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_ext_code_on_set_code[fork_Prague-blockchain_test-EOA-balance_1]:
	Error: invalid receiptTrie (vm hf=prague -> block number=1 hash=0xdca92b183eb934e5fed31a79b15e403050ec34b0c99f459f19ff4eaad0411cb4 hf=prague baseFeePerGas=7 txs=1 uncles=0)
	correct last header block
Errors thrown in file: ip7702_set_code_tx/set_code_txs/ext_code_on_set_code.json test: tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_ext_code_on_set_code[fork_Prague-blockchain_test-EOA_WITH_SET_CODE-balance_0]:
	Error: invalid receiptTrie (vm hf=prague -> block number=1 hash=0x1f3016ca4472d44b99fbdeeb19e15cfe0f863a8a729e266996359a715b32f356 hf=prague baseFeePerGas=7 txs=1 uncles=0)
	correct last header block
Errors thrown in file: ip7702_set_code_tx/set_code_txs/ext_code_on_set_code.json test: tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_ext_code_on_set_code[fork_Prague-blockchain_test-EOA_WITH_SET_CODE-balance_1]:
	Error: invalid receiptTrie (vm hf=prague -> block number=1 hash=0x33b7d69f6f77dffee4832972dfc7d9ebc49162756ac535b04eda51f1dc1475e2 hf=prague baseFeePerGas=7 txs=1 uncles=0)
	correct last header block
Errors thrown in file: ip7702_set_code_tx/set_code_txs/ext_code_on_set_code.json test: tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_ext_code_on_set_code[fork_Prague-blockchain_test-CONTRACT-balance_0]:
	Error: invalid receiptTrie (vm hf=prague -> block number=1 hash=0xf589d619b7169d5e33077b7af781e03e9a78b2e40729118af7ec199b7015e761 hf=prague baseFeePerGas=7 txs=1 uncles=0)
	correct last header block
Errors thrown in file: ip7702_set_code_tx/set_code_txs/ext_code_on_set_code.json test: tests/prague/eip7702_set_code_tx/test_set_code_txs.py::test_ext_code_on_set_code[fork_Prague-blockchain_test-CONTRACT-balance_1]:
	Error: invalid receiptTrie (vm hf=prague -> block number=1 hash=0xc84139ae8f5583d65b36017c363950b47cd2a8a03bcd28ced290d53f7a97ec36 hf=prague baseFeePerGas=7 txs=1 uncles=0)
	correct last header block

Did not yet check state or transaction tests.

@jochem-brouwer
Copy link
Member Author

We now pass all blockchain, state and transaction tests. To run the transaction tests:

  • Put the transaction_tests folder of the fixtures inside ethereum-tests/TransactionTests
  • Ensure that Prague is added to tx/test/transactionRunner.spec.ts in forkNames and forkNameMap
  • Now run npx vitest run ./test/transactionRunner.spec.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants