-
Notifications
You must be signed in to change notification settings - Fork 9
ADR 003: typed sponsorship transactions and batch execution #96
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
15215c8
Draft ADR for typed sponsorship transactions
randygrok a531fc6
Add SponsorTransaction type
randygrok fd31a25
Revert "Add SponsorTransaction type"
randygrok 9682332
Update ADR for standard-signed typed tx
randygrok ef4dee4
Expand ADR with payload signing details
randygrok 6be2a11
Document sponsorship validation locations
randygrok f0f5b6f
Document fee payer execution hook
randygrok be828f2
update
randygrok eb43e12
update all the spec steps
randygrok 5a7b861
write reference for tempo
randygrok cea74f6
remove file
randygrok 0f6398b
update snippet for transaction signature
randygrok c7eb06a
use txkind to support also contracts
randygrok a391aea
clarify is not the only transaction
randygrok 29b239f
remove some text
randygrok 59aa4cf
simplify step 1
randygrok ef04cff
simplify step 2
randygrok 775ce82
Remove fee token from sponsorship ADR
randygrok 73eb0ce
Document dual-domain sponsorship signatures
randygrok 00e71ed
Clarify no pool usage for sponsorship tx
randygrok 9eafb5b
Define executor sender semantics and RPC exposure
randygrok e33f65f
Update ADR for local typed sponsorship tx
randygrok 6d4330d
Align sponsorship ADR with custom primitives approach
randygrok 1df493d
Clarify sponsor signature semantics
randygrok 3995eaf
docs: clarify txpoolExt_getTxs usage by ev-node
randygrok 869ced7
docs: add spec section for typed sponsorship tx
randygrok 897a338
Clarify txpool, engine, and forced inclusion validation for 0x76
randygrok d867aaf
Refine sponsorship ADR wording
randygrok b660754
Clarify persistence and remove ADR repetition
randygrok e4243b1
Clarify ADR layer scope
randygrok 99002f2
simplify spec
randygrok de884b9
include batch calls
randygrok f82b026
Merge branch 'main' into randygrok/typed-tx-adr
randygrok 3a33a93
clean adr
randygrok f05e5a8
Clarify executor signature envelope in ADR 0003
randygrok ae3f693
Note executor signature envelope in implementation strategy
randygrok db46ae0
Clarify signature domain separators and sponsor signature encoding
randygrok df0b6ca
Update ADR 0003 clarifications
randygrok 0fa7693
Remove fee_payer address from ADR 0003
randygrok 1dd29e5
Refine sponsorship flow and broadcast readiness
randygrok 6106723
Add Viem custom client note
randygrok 6f05f36
Merge branch 'main' into randygrok/typed-tx-adr
randygrok 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| # ADR 0003: Typed Transactions for Sponsorship | ||
|
|
||
| ## Changelog | ||
|
|
||
| * 2026-01-05: Initial draft structure. | ||
|
|
||
| ## Status | ||
|
|
||
| DRAFT Not Implemented | ||
|
|
||
| > Please have a look at the [PROCESS](./PROCESS.md#adr-status) page. | ||
| > Use DRAFT if the ADR is in a draft stage (draft PR) or PROPOSED if it's in review. | ||
|
|
||
| ## Abstract | ||
|
|
||
| This ADR proposes a simplified way to sponsor transactions in reth by using | ||
| typed transactions enabled by EIP-2718. The idea is to define a typed | ||
| transaction format that separates the gas payer from the executor so the cost | ||
| can be covered without altering the normal execution flow. This reduces | ||
| complexity for users and integrations. | ||
|
|
||
| ## Context | ||
|
|
||
| Gas sponsorship is a recurring requirement for onboarding users and for product | ||
| flows that should not require the end user to hold native funds. Today, the only | ||
| available approach in reth is to bundle sponsorship logic off-chain or via | ||
| custom infrastructure, which increases integration complexity and makes | ||
| transaction handling inconsistent across clients. | ||
|
|
||
| EIP-2718 introduces typed transactions, providing a structured way to extend | ||
| transaction formats while keeping backward compatibility with existing | ||
| processing pipelines. This creates an opportunity to standardize a sponsorship | ||
| mechanism within the transaction itself rather than relying on external | ||
| conventions. | ||
|
|
||
| The project needs a minimal, explicit mechanism to separate the gas payer from | ||
| the executor, without changing the execution semantics of the underlying call. | ||
| At the same time, it must remain compatible with existing tooling, avoid | ||
| breaking current transaction flows, and be straightforward to implement in | ||
| reth's transaction validation and propagation layers. | ||
|
|
||
| ## Alternatives | ||
|
|
||
| TODO | ||
|
|
||
| ## Decision | ||
|
|
||
| > This section describes our response to these forces. It is stated in full | ||
| > sentences, with active voice. "We will ..." | ||
| We will implement gas sponsorship by introducing a new EIP-2718 typed | ||
| transaction in ev-reth. The new type (0x76) encodes both the execution call | ||
| and a separate sponsor authorization, enabling a sponsor account to pay fees | ||
| while preserving normal EVM execution semantics for the user call. The type is | ||
| added to the transaction envelope, validated in the txpool, and executed by | ||
| charging the sponsor while the sender remains the call origin. | ||
|
|
||
| ## Implementation Plan | ||
|
|
||
| 1. Define the transaction envelope and typed transaction. | ||
| - We will mirror the Tempo-style envelope pattern, extending the envelope | ||
| with a sponsorship transaction type (0x76) and a typed wrapper. | ||
| - The sponsorship transaction is specific to ev-reth and is not a wrapper | ||
| around an existing type: it carries explicit sponsor authorization fields. | ||
|
|
||
| ```rust | ||
| #[derive(Clone, Debug, alloy_consensus::TransactionEnvelope)] | ||
| #[envelope( | ||
| tx_type_name = EvRethTxType, | ||
| typed = EvRethTypedTransaction, | ||
| arbitrary_cfg(any(test, feature = "arbitrary")), | ||
| serde_cfg(feature = "serde") | ||
| )] | ||
| #[cfg_attr(test, reth_codecs::add_arbitrary_tests(compact, rlp))] | ||
| #[expect(clippy::large_enum_variant)] | ||
| pub enum EvRethTxEnvelope { | ||
| #[envelope(ty = 0)] | ||
| Legacy(Signed<TxLegacy>), | ||
| #[envelope(ty = 1)] | ||
| Eip2930(Signed<TxEip2930>), | ||
| #[envelope(ty = 2)] | ||
| Eip1559(Signed<TxEip1559>), | ||
| #[envelope(ty = 3)] | ||
| Eip4844(Signed<TxEip4844>), | ||
| #[envelope(ty = 0x76, typed = SponsorTransaction)] | ||
| Sponsor(SponsorSigned), | ||
| } | ||
|
|
||
| pub struct SponsorTransaction { | ||
| // User/executor call fields (sender remains call origin) | ||
| pub chain_id: u64, | ||
| // Sponsorship fields (payer is separate) | ||
| pub fee_payer_signature: Signature, | ||
|
randygrok marked this conversation as resolved.
Outdated
|
||
| pub fee_token: Address, | ||
|
randygrok marked this conversation as resolved.
Outdated
|
||
| } | ||
|
randygrok marked this conversation as resolved.
Outdated
|
||
| ``` | ||
|
|
||
| ## Consequences | ||
|
|
||
| > This section describes the resulting context, after applying the decision. All | ||
| > consequences should be listed here, not just the "positive" ones. A particular | ||
| > decision may have positive, negative, and neutral consequences, but all of them | ||
| > affect the team and project in the future. | ||
|
|
||
| ### Backwards Compatibility | ||
|
|
||
| > All ADRs that introduce backwards incompatibilities must include a section | ||
| > describing these incompatibilities and their severity. The ADR must explain | ||
| > how the author proposes to deal with these incompatibilities. ADR submissions | ||
| > without a sufficient backwards compatibility treatise may be rejected outright. | ||
|
|
||
| ### Positive | ||
|
|
||
| > {positive consequences} | ||
|
|
||
| ### Negative | ||
|
|
||
| > {negative consequences} | ||
|
|
||
| ### Neutral | ||
|
|
||
| > {neutral consequences} | ||
|
|
||
| ## Further Discussions | ||
|
|
||
| > While an ADR is in the DRAFT or PROPOSED stage, this section should contain a | ||
| > summary of issues to be solved in future iterations (usually referencing comments | ||
| > from a pull-request discussion). | ||
| > | ||
| > Later, this section can optionally list ideas or improvements the author or | ||
| > reviewers found during the analysis of this ADR. | ||
|
|
||
| ## Test Cases [optional] | ||
|
|
||
| Test cases for an implementation are mandatory for ADRs that are affecting consensus | ||
| changes. Other ADRs can choose to include links to test cases if applicable. | ||
|
|
||
| ## References | ||
|
|
||
| * {reference link} | ||
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.
Uh oh!
There was an error while loading. Please reload this page.