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

bug: mismatch expected nonce in collision tests #33

Closed
4 tasks done
Tracked by #27
ftupas opened this issue Aug 29, 2023 · 1 comment
Closed
4 tasks done
Tracked by #27

bug: mismatch expected nonce in collision tests #33

ftupas opened this issue Aug 29, 2023 · 1 comment
Labels
runner bug Something related to normal test runner execution isn't working

Comments

@ftupas
Copy link
Contributor

ftupas commented Aug 29, 2023

Bug Report

Kakarot version: kkrt-labs/kakarot@0c6e7a6

Current behavior:
Tests for SSTORE provided by ethereum/tests fails during the following tests when transactions are expected to pass

Test Name Actual Expected
InitCollision_d0g0v0_Shanghai 0x0000000000000000000000000000000000000000000000000000000000000000 0x0000000000000000000000000000000000000000000000000000000000000001
InitCollisionNonZeroNonce_d0g0v0_Shanghai 0x0000000000000000000000000000000000000000000000000000000000000000 0x0000000000000000000000000000000000000000000000000000000000000001

Instead they are all failing with mismatch on expected nonce

Expected behavior:
Test should pass.

Steps to reproduce:

make setup
make target=InitCollision_d0g0v0_Shanghai ef-test

Failing output should be:

Test failed: failed test InitCollision_d0g0v0_Shanghai: expected nonce 0x0000000000000000000000000000000000000000000000000000000000000001, got 0x0000000000000000000000000000000000000000000000000000000000000000

Tasks

  1. bug runner bug
    ftupas
  2. Type: bug
    ftupas
  3. new-feature
    ftupas
  4. jobez
@ftupas ftupas self-assigned this Aug 29, 2023
@ftupas ftupas added the bug Something isn't working label Aug 29, 2023
@Eikix Eikix added this to the Official Ethereum Conformance milestone Aug 29, 2023
@ftupas ftupas changed the title bug: mismatch expected nonce bug: mismatch expected nonce in collision tests Aug 30, 2023
@ftupas
Copy link
Contributor Author

ftupas commented Aug 30, 2023

With @ClementWalter , we have done the following

  • realize that this tx is a create tx
  • use this util to compute the target address
  • confirmed resulting address is 0x6295ee1b4f6dd65047762f924ecd367c17eabf8f
  • this is a pre-deployed contract account
  • contract account nonce are not stored in the sequencer nonce storage
  • we need to check the managed nonce instead

Another problem

  • we realize that this has been pre-deployed as an eoa instead of a contract account, see here
  • we need to fix how we handle the pre-state for the accounts

Next steps

In handle_post_state:

  • if the account we are asserting against is an EOA, we use protocol-level nonce
  • if it's a contract account, we use the managed nonce

In write_test_state:

  • Check if the account has storage as well, not just code
  • Update these lines to include this logic

Appendix

@greged93 greged93 added the runner bug Something related to normal test runner execution isn't working label Aug 30, 2023
@ftupas ftupas removed their assignment Sep 8, 2023
@greged93 greged93 removed the bug Something isn't working label Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
runner bug Something related to normal test runner execution isn't working
Projects
Archived in project
Development

No branches or pull requests

4 participants