feat(rpc): Add RpcTxConverter to allow for providing custom converters with extra context#17827
Merged
feat(rpc): Add RpcTxConverter to allow for providing custom converters with extra context#17827
RpcTxConverter to allow for providing custom converters with extra context#17827Conversation
…ers with extra context
…count for possible errors in custom implementations
0720e90 to
d694308
Compare
d694308 to
ba8ded6
Compare
lwedge99
pushed a commit
to sentioxyz/reth
that referenced
this pull request
Sep 16, 2025
…ers with extra context (paradigmxyz#17827)
theochap
pushed a commit
to ethereum-optimism/optimism
that referenced
this pull request
Jan 22, 2026
…ers with extra context (paradigmxyz/reth#17827)
theochap
pushed a commit
to ethereum-optimism/optimism
that referenced
this pull request
Feb 11, 2026
…ers with extra context (paradigmxyz/reth#17827)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of #17545
Motivation
Custom nodes with custom transactions need their own Consensus Transaction -> Rpc Transaction Response algorithm.
The input for this conversion is the consensus transaction, it's signer address and an associated TxInfo type.
Solution
Adds a new trait called
RpcTxConverterwith two blanket implementations:()assumingTximplementsIntoRpcTxand is used as default forRpcConverterFn(Tx, Address, TxInfo) -> RpcTxand can be applied usingRpcConverter::with_rpc_tx_converterDiscussion
Compared to TxEnv and SimTx, custom conversions are easy to achieve thanks to
TxInfoMapperbeing able to generate a custom extra context object that is then used as part of the input forIntoRpcTx. This is being actively used for Optimism deposit transactions.Therefore, it is somewhat questionable how useful this change is. At the very least it is being consistent with
SimTxConverterandTxEnvConverter. To make it more useful, we may mergeTxInfoMapperwithRpcTxConverter, but then we're broadening the scope of the custom overrides (just tx info vs rpc tx conversion).