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

Incorrect incarnation number for an re-created account #2443

Open
chfast opened this issue Oct 23, 2024 · 0 comments
Open

Incorrect incarnation number for an re-created account #2443

chfast opened this issue Oct 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@chfast
Copy link
Member

chfast commented Oct 23, 2024

Silkworm is failing the CREATE2 - recreate EEST test in variant recreate_on_separate_block=True.

The scenario is like this:

  1. Block 1
    1. Create account X with CREATE2 (incarnation 1)
    2. Set X storage [0] = 1
  2. Block 2
    1. Selfdestruct X
    2. Send value 1 to X
  3. Block 3
    1. Create account X with CREATE2 (incarnation 2).

In the final state the X should have empty storage. However, it has [0] == 1 because the incarnation number for the second CREATE2 is incorrectly 1.

This bug don't happen when the transaction 3.1 is in block 2 (same where selfdestruct happens): recreate_on_separate_block=False.

It seems we don't properly remember the X's prev_incarnation at the end of block 2. Formally, the account exist is not empty but has not been created with IntraBlockState::create_contract.

I tried to also keep prev_incarnation of "current" accounts in InMemoryState::update_account, but this didn't fix the problem.

@chfast chfast added the bug Something isn't working label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants
@chfast and others