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 selfdestruct for EIP-6780 with non-empty balances #493

Merged
merged 6 commits into from
Aug 15, 2024

Conversation

Nashtare
Copy link
Collaborator

The issue actually lied in the application of #461, that claimed to change only the native tracer behavior but actually removed the notion of self destructed accounts from jerigon payloads as well.

This was also incorrect, following the EIP specification of still considering as contract creation accounts with non-empty balances.

I've added a new test case from the previously failing payload b20472570 (cf #475).

closes #475

@Nashtare Nashtare added this to the Testing and Validation milestone Aug 14, 2024
@Nashtare Nashtare self-assigned this Aug 14, 2024
@Nashtare Nashtare requested a review from muursh as a code owner August 14, 2024 14:07
@github-actions github-actions bot added crate: trace_decoder Anything related to the trace_decoder crate. crate: zero_bin Anything related to the zero-bin subcrates. labels Aug 14, 2024
Copy link
Contributor

@LindaGuiga LindaGuiga left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

trace_decoder/src/typed_mpt.rs Show resolved Hide resolved
trace_decoder/src/processed_block_trace.rs Outdated Show resolved Hide resolved
trace_decoder/src/typed_mpt.rs Show resolved Hide resolved
@@ -209,6 +211,28 @@ fn process_nonce(
})
}

/// Processes the self destruct for the given account state.
fn process_self_destruct(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: returning an Option is a bit cryptic - could you document what it means?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also you never return Some(false), which feels odd

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

to be fair I just brought back what had been removed from a previous PR, but I can change it

Copy link
Collaborator Author

@Nashtare Nashtare Aug 15, 2024

Choose a reason for hiding this comment

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

I believe it's done that way to easily skip serde from serializing None variants, without having to provide a custom fn to deal with false values, given that these are 99% of the cases encountered. But I could be wrong.

trace_decoder/src/typed_mpt.rs Outdated Show resolved Hide resolved
@Nashtare Nashtare merged commit f0318d8 into develop Aug 15, 2024
15 checks passed
@Nashtare Nashtare deleted the fix/selfdestruct branch August 15, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate: trace_decoder Anything related to the trace_decoder crate. crate: zero_bin Anything related to the zero-bin subcrates.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Inconsistent trace_decoder output from Jerigon payload
4 participants