Skip to content

Commit 5c63ce1

Browse files
authored
Update RIP-7711: Remove the no-op header transaction type (#42)
* Simplify RIP-7711 by removing the no-op header type * Change title and description
1 parent c8e5881 commit 5c63ce1

File tree

4 files changed

+32
-56
lines changed

4 files changed

+32
-56
lines changed

RIPS/rip-7711.md

Lines changed: 32 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
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
55
author: Vitalik Buterin (@vbuterin), Yoav Weiss (@yoavw), Alex Forshtat (@forshtat), Dror Tirosh (@drortirosh), Shahaf Nacson (@shahafn)
66
discussions-to: https://ethereum-magicians.org/t/rip-7711-an-rip-7560-compatible-transactions-bundle-transaction-type/20093
77
status: Draft
@@ -17,7 +17,7 @@ requires: 7560
1717
This proposal provides block builders with a mechanism to isolate validation from execution for
1818
a set of RIP-7560 transactions.
1919
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.
2121

2222
On "single sequencer" Layer 2 chains that do not have a "transaction mempool" in a traditional sense,
2323
this proposal provides no benefit compared to the original RIP-7560.
@@ -43,61 +43,40 @@ before their respective execution frames.
4343

4444
## Specification
4545

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-
7746
### Non-atomic validation and execution transaction type
7847

7948
```
8049
BUNDLE_TRANSACTION_TYPE = x
8150
```
8251

8352
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".
8554

8655
It is important for the wallets to explicitly opt into this feature by accepting the `BUNDLE_TRANSACTION_TYPE`,
8756
as some Smart Contract Accounts
8857
may be created in a way that relies on atomicity between validation and execution phases.
8958

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.
9162

9263
Filling a block with AA transactions must not be a challenge for the block builder.
9364
However, if each transaction during its execution can alter any state that affects the validity of another transaction
9465
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.
9572

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
9874

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.
10180

10281
A builder that chooses not to enforce the rules from ERC-7562 **must** take care to re-validate each transaction
10382
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
10988
The validation parts of AA transactions are executed as separate transactions,
11089
but are not represented as separate transactions in the block data.
11190

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*
11498

11599
### Transaction execution context
116100

@@ -169,19 +153,6 @@ many times until a fully utilized block is discovered.
169153
The effects of allowing transactions to specify unrestricted gas limits is shown on this diagram:
170154
![](../assets/rip-7560/unused_gas_attack_overview.png)
171155

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-
185156
### Breaking up a transaction flow into non-atomic pieces
186157

187158
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.
197168

198169
## Backwards Compatibility
199170

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.
200176

201177
## Security Considerations
202178

@@ -208,7 +184,7 @@ between validation and execution phases, which is wrong.
208184

209185
The state that exists at the end of the validation frame may be observed or modified by unrelated contracts before
210186
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.
212188

213189
## Copyright
214190

assets/rip-7560/block_overview.png

-58.3 KB
Binary file not shown.
59 KB
Loading
58.1 KB
Loading

0 commit comments

Comments
 (0)