From b74a9760326a692610b34f10fd9d69a97afb1c1c Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Fri, 7 Feb 2025 15:21:51 +0100 Subject: [PATCH 1/2] isthmus: Clarify SetCode tx type handling in span batches --- specs/protocol/isthmus/derivation.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/specs/protocol/isthmus/derivation.md b/specs/protocol/isthmus/derivation.md index 64a9ec246..96f0d0025 100644 --- a/specs/protocol/isthmus/derivation.md +++ b/specs/protocol/isthmus/derivation.md @@ -14,6 +14,7 @@ - [GasPriceOracle Enable Isthmus](#gaspriceoracle-enable-isthmus) - [EIP-2935 Contract Deployment](#eip-2935-contract-deployment) - [Span Batch Updates](#span-batch-updates) + - [Activation](#activation) @@ -322,7 +323,7 @@ transaction. This corresponds with a new RLP-encoding of the `tx_datas` list as specified in [the Delta span batch spec](../delta/span-batches.md), adding a new transaction type: -Transaction type `4` ([EIP-7702]): +Transaction type `4` ([EIP-7702] `SetCode`): `0x04 ++ rlp_encode(value, max_priority_fee_per_gas, max_fee_per_gas, data, access_list, authorization_list)` The [EIP-7702] transaction extends [EIP-1559] to include a new `authorization_list` field. @@ -336,7 +337,18 @@ The [EIP-7702] transaction format is as follows. - `access_list`: The [EIP-2930] access list. - `authorization_list`: The [EIP-7702] signed authorization list. -Span batches with transaction type `4` should only be accepted after Isthmus is enabled. +## Activation + +Singular batches with transactions of type `4` must only be accepted if Isthmus is active at the +timestamp of the batch. If a singular batch contains a transaction of type `4` before Isthmus is +active, this batch must be _dropped_. Note that according to Holocene derivation, this will also +lead to the remaining span batch, and channel that contained it, to get dropped. + +Also note that this check must happen at the level of individual batches that are derived from span +batches, not to span batches as a whole. In particular, it is allowed for a span batch to span the +Isthmus activation timestamp and contain SetCode transactions in singular batches that have a +timestamp at or after the Isthmus activation time, even if the timestamp of the span batch is before +the Isthmus activation time. [EIP-1559]: https://eips.ethereum.org/EIPS/eip-1559 [EIP-7702]: https://eips.ethereum.org/EIPS/eip-7702 From dc3bfe6154d7fbbaac711f488babe316d8a44440 Mon Sep 17 00:00:00 2001 From: Sebastian Stammler Date: Mon, 10 Feb 2025 20:06:48 +0100 Subject: [PATCH 2/2] clarify, add rule to pre-Isthmus singular and span batches to forbid type >2 txs --- specs/protocol/delta/span-batches.md | 3 +++ specs/protocol/derivation.md | 3 +++ specs/protocol/isthmus/derivation.md | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/specs/protocol/delta/span-batches.md b/specs/protocol/delta/span-batches.md index c58eeb0be..eac517e09 100644 --- a/specs/protocol/delta/span-batches.md +++ b/specs/protocol/delta/span-batches.md @@ -359,6 +359,9 @@ Span-batch rules, in validation order: that is invalid or derived by other means exclusively: - any transaction that is empty (zero length `tx_data`) - any [deposited transactions][g-deposit-tx-type] (identified by the transaction type prefix byte in `tx_data`) + - any transaction of a future type > 2 (note that + [Isthmus adds support](../isthmus/derivation.md#activation) + for `SetCode` transactions of type 4) - Overlapped blocks checks: - Note: If the span batch overlaps the current L2 safe chain, we must validate all overlapped blocks. - Variables: diff --git a/specs/protocol/derivation.md b/specs/protocol/derivation.md index 4936d9402..30248cc2f 100644 --- a/specs/protocol/derivation.md +++ b/specs/protocol/derivation.md @@ -671,6 +671,9 @@ Rules, in validation order: that is invalid or derived by other means exclusively: - any transaction that is empty (zero length byte string) - any [deposited transactions][g-deposit-tx-type] (identified by the transaction type prefix byte) + - any transaction of a future type > 2 (note that + [Isthmus adds support](isthmus/derivation.md#activation) + for `SetCode` transactions of type 4) If no batch can be `accept`-ed, and the stage has completed buffering of all batches that can fully be read from the L1 block at height `epoch.number + sequence_window_size`, and the `next_epoch` is available, diff --git a/specs/protocol/isthmus/derivation.md b/specs/protocol/isthmus/derivation.md index 96f0d0025..e3ebb0fbc 100644 --- a/specs/protocol/isthmus/derivation.md +++ b/specs/protocol/isthmus/derivation.md @@ -341,7 +341,7 @@ The [EIP-7702] transaction format is as follows. Singular batches with transactions of type `4` must only be accepted if Isthmus is active at the timestamp of the batch. If a singular batch contains a transaction of type `4` before Isthmus is -active, this batch must be _dropped_. Note that according to Holocene derivation, this will also +active, this batch must be _dropped_. Note that if Holocene is active, this will also lead to the remaining span batch, and channel that contained it, to get dropped. Also note that this check must happen at the level of individual batches that are derived from span