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

fix(inspector): always call selfdestruct if entry is made #1746

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

jsvisa
Copy link
Contributor

@jsvisa jsvisa commented Sep 4, 2024

fix paradigmxyz/reth#10554

If EIP-6780 is enabled and selfdestruct is called not in the same create transaction, then no AccountDestroyed event will be returned:

// EIP-6780 (Cancun hard-fork): selfdestruct only if contract is created in the same tx
let journal_entry = if acc.is_created() || !is_cancun_enabled {
acc.mark_selfdestruct();
acc.info.balance = U256::ZERO;
Some(JournalEntry::AccountDestroyed {
address,
target,
was_destroyed: previously_destroyed,
had_balance: balance,
})

but actually in that case we also need to log the selfdestruct event.

Signed-off-by: jsvisa <delweng@gmail.com>
Copy link
Member

@rakita rakita left a comment

Choose a reason for hiding this comment

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

good find!

@rakita rakita merged commit 32f357f into bluealloy:main Sep 4, 2024
27 checks passed
@jsvisa jsvisa deleted the fix-selfdestruct-after-cancun branch September 4, 2024 11:31
This was referenced Sep 16, 2024
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

Successfully merging this pull request may close these issues.

Geth Debug Tracing Inconsistency when having selfdestruct
2 participants