-
Notifications
You must be signed in to change notification settings - Fork 2
fix: Preload txn receipt from eth_api for historical deposit txns #28
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
base: main
Are you sure you want to change the base?
Conversation
The codebase has several other places where unsafe |
@@ -387,7 +395,41 @@ where | |||
block_number: Some(block_number), | |||
base_fee, | |||
}; | |||
Ok(Some(self.transform_tx(transaction, tx_info))) | |||
// preload transaction receipt if it's a deposit transaction | |||
if transaction.is_deposit() { |
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.
Why did all this move to this method and pass in the receipt? Why not keep this logic in the transform_tx
and prevent the addition of the receipt param? That way if the method is used anywhere else we won't have to replicate this logic. Otherwise looks good
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.
pretty much to avoid marking a bunch of other functions async because rust has colored functions
The Flashblocks RPC had a bug where it would panic if
getTransactionByHash
was used to load historical deposit transactions.These transactions did not exist in the mempool (system transaction) and did not exist in the cache (historical transaction) but in the case of deposit transactions we would always try to fetch a receipt from the cache to populate
deposit_receipt_version
anddeposit_nonce
.Since we did
unwrap()
without an error check in that path, it would cause a panic.This PR attempts to fix that by pre-loading the deposit transaction receipt from
eth_api
in case a historical deposit transaction is attempted to be fetched viagetTransactionByHash
.P.S. Opened this PR as the forked repo PR did not allow me to trigger a
base-builds
sepolia alpha deployment to test without more changes than necessary to those Dockerfiles.Edit; ignore the branch name. i thought the root cause was a race condition, it was not.