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(op): skip tx root validation for filtered out dup txns #8316

Merged
merged 2 commits into from
May 21, 2024

Conversation

emhane
Copy link
Member

@emhane emhane commented May 19, 2024

  • Skips tx root validation for filtered out transactions in bodies stage
  • Fixes method FileClient::bodies_iter_mut that could cause undefined behaviour

@emhane emhane added A-downloaders Related to headers/bodies downloaders A-op-reth Related to Optimism and op-reth labels May 19, 2024
@emhane emhane added the C-bug An unexpected or incorrect behavior label May 19, 2024
Copy link
Member

@Rjected Rjected left a comment

Choose a reason for hiding this comment

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

one nit w.r.t. module docs and a question regarding the new check

crates/primitives/src/op_mainnet.rs Outdated Show resolved Hide resolved
Comment on lines -127 to -128
body.transactions.retain(|tx| {
if is_duplicate(tx.hash, *block_number) {
Copy link
Member

Choose a reason for hiding this comment

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

hmm, are the dup transactions the only transactions in their blocks? Or do the headers with duplicate transactions always contain an empty transactions root? it would seem like the previous check is more correct

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah they are the only transactions in their blocks, I verified. agreed that checking tx hash feels more intuitive, but then again, this is a specific solution to a specific problem, so loss of generality is fine for less LOC.

@emhane emhane requested a review from Rjected May 21, 2024 08:57
@emhane emhane enabled auto-merge May 21, 2024 08:57
Copy link
Member

@Rjected Rjected left a comment

Choose a reason for hiding this comment

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

lgtm!

@emhane emhane added this pull request to the merge queue May 21, 2024
Merged via the queue into main with commit c97963b May 21, 2024
28 checks passed
@emhane emhane deleted the emhane/fix-op-body-validation branch May 21, 2024 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-downloaders Related to headers/bodies downloaders A-op-reth Related to Optimism and op-reth C-bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants