-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
//! Helpers for working with Optimism. | ||
|
||
/* --------------------- REPLAYED TRANSACTIONS IN BLOCKS BELOW BEDROCK --------------------- */ | ||
emhane marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/// Transaction 0x9ed8f713b2cc6439657db52dcd2fdb9cc944915428f3c6e2a7703e242b259cb9 in block 985, | ||
/// replayed in blocks: | ||
/// | ||
/// 19 022 | ||
/// 45 036 | ||
pub const TX_BLOCK_985: [u64; 2] = [19_022, 45_036]; | ||
|
||
/// Transaction 0xc033250c5a45f9d104fc28640071a776d146d48403cf5e95ed0015c712e26cb6 in block | ||
/// 123 322, replayed in block: | ||
/// | ||
/// 123 542 | ||
pub const TX_BLOCK_123_322: u64 = 123_542; | ||
|
||
/// Transaction 0x86f8c77cfa2b439e9b4e92a10f6c17b99fce1220edf4001e4158b57f41c576e5 in block | ||
/// 1 133 328, replayed in blocks: | ||
/// | ||
/// 1 135 391 | ||
/// 1 144 468 | ||
pub const TX_BLOCK_1_133_328: [u64; 2] = [1_135_391, 1_144_468]; | ||
|
||
/// Transaction 0x3cc27e7cc8b7a9380b2b2f6c224ea5ef06ade62a6af564a9dd0bcca92131cd4e in block | ||
/// 1 244 152, replayed in block: | ||
/// | ||
/// 1 272 994 | ||
pub const TX_BLOCK_1_244_152: u64 = 1_272_994; | ||
|
||
/// The six blocks with replayed transactions. | ||
pub const BLOCK_NUMS_REPLAYED_TX: [u64; 6] = [ | ||
TX_BLOCK_985[0], | ||
TX_BLOCK_985[1], | ||
TX_BLOCK_123_322, | ||
TX_BLOCK_1_133_328[0], | ||
TX_BLOCK_1_133_328[1], | ||
TX_BLOCK_1_244_152, | ||
]; | ||
|
||
/// Returns `true` if transaction is the second or third appearance of the transaction. The blocks | ||
/// with replayed transaction happen to only contain the single transaction. | ||
pub fn is_dup_tx(block_number: u64) -> bool { | ||
if block_number > BLOCK_NUMS_REPLAYED_TX[5] { | ||
return false | ||
} | ||
|
||
// these blocks just have one transaction! | ||
if BLOCK_NUMS_REPLAYED_TX.contains(&block_number) { | ||
return true | ||
} | ||
|
||
false | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.