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: prevent decoding U256 TxValue on mainnet #5344

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

Rjected
Copy link
Member

@Rjected Rjected commented Nov 7, 2023

This prevents TxValues larger than U256 from being decoded when the optimism feature is not enabled. This means there is no chance of the node decoding a transaction with a TxValue larger than U256, and attempting to commit that value in the DB, which would panic from the to conversion:

#[cfg(not(feature = "optimism"))]
{
self.0.to::<u128>().to_compact(buf)
}

@Rjected Rjected added the C-bug An unexpected or incorrect behavior label Nov 7, 2023
@Rjected Rjected requested a review from gakonst as a code owner November 7, 2023 18:50
@Rjected Rjected added the A-networking Related to networking in general label Nov 7, 2023
@Rjected Rjected added this pull request to the merge queue Nov 7, 2023
Merged via the queue into main with commit 1b2a4c7 Nov 7, 2023
25 checks passed
@Rjected Rjected deleted the dan/prevent-u256-decoding-tx-value-mainnet branch November 7, 2023 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-networking Related to networking in general C-bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants