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 production of "final state" #885

Open
chfast opened this issue Apr 12, 2023 · 0 comments
Open

Incorrect production of "final state" #885

chfast opened this issue Apr 12, 2023 · 0 comments

Comments

@chfast
Copy link
Member

chfast commented Apr 12, 2023

The (77) defines transaction's final state σ′ where both selfdestructed and empty-but-touched accounts are deleted. This is not how this is implemented in practice.

What YP suggests is the following workflow:

for tx in transactions:
    execute(state, tx)
    delete_selfdestructed(state)
    delete_empty_but_touched(state)

apply_coinbase_reward()
apply_withdrawals()

Practical implementations are done as the following:

for tx in transactions:
    execute(state, tx)
    delete_selfdestructed(state)

apply_coinbase_reward()
apply_withdrawals()
delete_empty_but_touched(state)

The difference is subtle: in case we apply 0 block reward or 0 withdrawal to an empty account this account will be deleted.

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

No branches or pull requests

2 participants
@chfast and others