1
1
---
2
2
rip : 7711
3
- title : An RIP-7560 transactions bundle transaction type
4
- description : An RIP-7560 compatible transaction type that allows specifying a set of AA transactions that can be atomically validated together
3
+ title : Validation-Execution Separation in Native Account Abstraction
4
+ description : A change in the order of execution of frames of RIP-7560 transactions inside a block that enables efficient block building
5
5
author : Vitalik Buterin (@vbuterin), Yoav Weiss (@yoavw), Alex Forshtat (@forshtat), Dror Tirosh (@drortirosh), Shahaf Nacson (@shahafn)
6
6
discussions-to : https://ethereum-magicians.org/t/rip-7711-an-rip-7560-compatible-transactions-bundle-transaction-type/20093
7
7
status : Draft
@@ -17,7 +17,7 @@ requires: 7560
17
17
This proposal provides block builders with a mechanism to isolate validation from execution for
18
18
a set of RIP-7560 transactions.
19
19
By doing so we simplify the task of filling a block gas space with RIP-7560 transactions and prevent potential
20
- denial of service attacks against block builders.
20
+ denial-of- service attacks against block builders.
21
21
22
22
On "single sequencer" Layer 2 chains that do not have a "transaction mempool" in a traditional sense,
23
23
this proposal provides no benefit compared to the original RIP-7560.
@@ -43,61 +43,40 @@ before their respective execution frames.
43
43
44
44
## Specification
45
45
46
- ### Bundle header RIP-7560 transaction type
47
-
48
- ```
49
- BUNDLE_HEADER_TYPE = x
50
- ```
51
-
52
- Instead, we propose to introduce an explicit "counter" transaction type.
53
-
54
- The payload should be interpreted as:
55
-
56
- ```
57
- 0x04 || 0x01 || rlp([chainId, transactionCount])
58
- ```
59
-
60
- Header transactions have a unique hash calculated as follows:
61
-
62
- ```
63
- keccak256(AA_TX_TYPE || 0x01 || rlp(chainId, transactionCount, blockNumber, txIndex))
64
- ```
65
-
66
- The ` transactionCount ` is required to be strictly larger than ` 1 ` .
67
-
68
- The ` blockNumber ` and ` txIndex ` parameters are added to the hash to achieve unique header transaction IDs.
69
-
70
- The header transactions are only used to help execution clients determine how many of the ` AA_TX_TYPE ` transactions
71
- belong to each individual bundle.
72
-
73
- The block is not valid if a header transaction is located anywhere except before a set of ` AA_TX_TYPE ` transactions.
74
-
75
- Header transactions do not affect blockchain state and do not cost any gas.
76
-
77
46
### Non-atomic validation and execution transaction type
78
47
79
48
```
80
49
BUNDLE_TRANSACTION_TYPE = x
81
50
```
82
51
83
52
These transactions are completely identical to regular RIP-7560 transactions with the exceptions of being
84
- composable into bundles.
53
+ composed into "AA transaction bundles" .
85
54
86
55
It is important for the wallets to explicitly opt into this feature by accepting the ` BUNDLE_TRANSACTION_TYPE ` ,
87
56
as some Smart Contract Accounts
88
57
may be created in a way that relies on atomicity between validation and execution phases.
89
58
90
- ### All validation state changes apply before all execution ones
59
+ ### AA transaction bundles
60
+
61
+ In AA transaction bundles, all validation state changes apply before all execution ones.
91
62
92
63
Filling a block with AA transactions must not be a challenge for the block builder.
93
64
However, if each transaction during its execution can alter any state that affects the validity of another transaction
94
65
in the mempool, the block builder will be forced to revalidate all transactions in the mempool after each inclusion.
66
+ Transactions of ` BUNDLE_TRANSACTION_TYPE ` type mitigate the inherent computational complexity of building a block that
67
+ contains ` AA_TX_TYPE ` transactions.
68
+
69
+ With ` BUNDLE_TRANSACTION_TYPE ` transactions, ** all** the validation frames
70
+ of an uninterrupted sequence of AA transactions are run first,
71
+ and ** all** the execution frames are run immediately after that.
95
72
96
- We mitigate that by applying all changes in all the validation frames of a sequence of AA transactions first
97
- and all execution frames apply immediately after that.
73
+ ### Validation code sandboxing
98
74
99
- In theory, the validation frames can also invalidate each other, but we define ways to prevent that by applying
100
- certain rules for the mempool transactions in ERC-7562.
75
+ Even with RIP-7711, validation frames of a ` BUNDLE_TRANSACTION_TYPE ` transactions bundle can invalidate
76
+ other transactions in the same bundle.
77
+ We define a mechanism to prevent cross-validation dependencies by applying
78
+ certain rules for the mempool transactions which is fully described in [ ERC-7562] ( ../eip-7562 ) .
79
+ This is equivalent to the mechanism used by the ERC-4337 UserOperations mempool.
101
80
102
81
A builder that chooses not to enforce the rules from ERC-7562 ** must** take care to re-validate each transaction
103
82
against the mid-block state at the position where it is being included into a block.
@@ -109,8 +88,13 @@ Here is a visual representation of a block that contains multiple Account Abstra
109
88
The validation parts of AA transactions are executed as separate transactions,
110
89
but are not represented as separate transactions in the block data.
111
90
112
- ![ ] ( ../assets/rip-7560/block_overview.png )
113
- * The structure of a block containing multiple Native Account Abstraction Transactions*
91
+ ![ ] ( ../assets/rip-7711/rip_7711_block_overview.png )
92
+ * The structure of a block containing multiple RIP-7711 Native Account Abstraction Transactions*
93
+
94
+ For comparison, this is the diagram of a similar block using RIP-7560 transactions:
95
+
96
+ ![ ] ( ../assets/rip-7711/rip_7560_block_overview.png )
97
+ * The structure of a block containing multiple RIP-7560 Transactions*
114
98
115
99
### Transaction execution context
116
100
@@ -169,19 +153,6 @@ many times until a fully utilized block is discovered.
169
153
The effects of allowing transactions to specify unrestricted gas limits is shown on this diagram:
170
154
![ ] ( ../assets/rip-7560/unused_gas_attack_overview.png )
171
155
172
- ### Using a header transaction to carry metadata instead of adding a field to the block payload
173
-
174
- While in this particular case there is no execution frame that needs to happen for
175
- a ` BUNDLE_HEADER_TYPE ` transaction, in other similar scenarios it is possible we
176
- will require some execution for a header transaction.
177
-
178
- For example, in the upcoming Signature Aggregation RIP, the header transaction contains
179
- the execution of the aggregated signature verification code.
180
-
181
- For consistency with potential future extensions to the RIP-7560 it seems reasonable to
182
- introduce a transaction type that has zero execution frames.
183
- In addition, it couldn't be efficiently represented as one field because a block may contain any number of such bundles.
184
-
185
156
### Breaking up a transaction flow into non-atomic pieces
186
157
187
158
While changing the transaction flow is a departure from the norm for Ethereum transactions,
@@ -197,6 +168,11 @@ so there are no expected difficulties with implementing this proposal.
197
168
198
169
## Backwards Compatibility
199
170
171
+ The non-atomic flow of an RIP-7711 transaction requires attention from the Smart Contract Account developers
172
+ to ensure the accounts cannot be left in a broken state between the validation and execution frames.
173
+
174
+ However, as ERC-4337 has a very similar execution flow for UserOperations, it is a known property of
175
+ Account Abstractions and all existing code is likely to be compatible with RIP-7711 with only some minor modifications.
200
176
201
177
## Security Considerations
202
178
@@ -208,7 +184,7 @@ between validation and execution phases, which is wrong.
208
184
209
185
The state that exists at the end of the validation frame may be observed or modified by unrelated contracts before
210
186
the execution frame begins.
211
- ` Sender ` contracts must take great care in making sure their code does not make any false assumptions.
187
+ Smart Contract Account developers contracts must ensure that their code does not make any false assumptions.
212
188
213
189
## Copyright
214
190
0 commit comments