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

EIP-2681: Limit account nonce to 2^64-1 #401

Closed
axic opened this issue Nov 26, 2021 · 5 comments · Fixed by #454
Closed

EIP-2681: Limit account nonce to 2^64-1 #401

axic opened this issue Nov 26, 2021 · 5 comments · Fixed by #454
Labels
A-spec Area: specification C-eip Category: tracking implementation of an EIP

Comments

@axic
Copy link
Member

axic commented Nov 26, 2021

EIP-2681 applies from genesis. It was properly merged into Geth this week and also the state tests repository has it merged.

@SamWilsn SamWilsn added A-spec Area: specification C-eip Category: tracking implementation of an EIP labels Nov 30, 2021
@gurukamath
Copy link
Collaborator

Which test cases would one use to build this? I am unable to find any JSON under tests that mentions this issue.

@SamWilsn
Copy link
Collaborator

SamWilsn commented Jan 12, 2022

Which test cases would one use to build this? I am unable to find any JSON under tests that mentions this issue.

They can be found in the upstream repository: https://github.com/ethereum/tests/tree/develop/TransactionTests/ttNonce

The tests/fixtures directory is a submodule, and needs to be updated to get the latest tests.

@gurukamath
Copy link
Collaborator

gurukamath commented Jan 16, 2022

@SamWilsn Thanks.

Also for the other change mentioned in EIP-2681
"The CREATE and CREATE2 instructions to abort with an exceptional halt, where the account nonce is 2^64-1", I assume the relevant test is High Nonce Test.

However, I see that the structure of the above JSON is quite different from the fixtures that have been tested so far for the VM System Operations (I looked at suicide0 as a reference). For example, the "exec" key from the old JSON is missing in the new one (perhaps replaced by "transaction" based on a quick glance).

Is there any reference that could help me load the new format of tests? Or at least a dictionary that translates the old keys in JSON to the new one?

@lightclient
Copy link
Member

@gurukamath what you are seeing is the difference between the "state" tests, "blockchain" tests, and "transaction" tests. The state tests are essentially a subset of blockchain tests and have been discontinued. The transaction tests validate the static aspects of rlp encoded transactions (more info here). There really isn't a concept of a "transaction test validator" yet in the execution spec, so you'd need to implement something. But it should be straightforward - it should decode the rlp to a transaction object and determine if any exceptions were raise (e.g. nonce too large) and if the tx valid, it verifies the hash and a few other components.

@gurukamath
Copy link
Collaborator

gurukamath commented Jan 16, 2022

@lightclient Thanks for the information.
I have managed to implement the static transaction test validator on my local feature branch to test that the transaction nonce is too large.

I am however, having trouble with the second point of EIP-2681 where I need to pass a transaction with high nonce through the VM and make sure that the CREATE instruction aborts with exceptional halt. I am trying to draw parallels between the already implemented vm system tests (for example suicide0) and High Nonce, but am having trouble mapping the two JSON structures

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-spec Area: specification C-eip Category: tracking implementation of an EIP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@axic @lightclient @gurukamath @SamWilsn and others