From aaf5b0fb2e4e702125f46a76aa6380fcc142eb6d Mon Sep 17 00:00:00 2001 From: John Wick <153378704+JohnwickBC@users.noreply.github.com> Date: Tue, 12 Dec 2023 08:37:58 +0800 Subject: [PATCH 1/7] datas -> data --- specs/span-batches.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/specs/span-batches.md b/specs/span-batches.md index e1141874dddc..3daa5425643a 100644 --- a/specs/span-batches.md +++ b/specs/span-batches.md @@ -106,7 +106,7 @@ Where: - `block_tx_counts`: for each block, a `uvarint` of `len(block.transactions)`. - `txs`: L2 transactions which is reorganized and encoded as below. - `txs = contract_creation_bits ++ y_parity_bits ++ - tx_sigs ++ tx_tos ++ tx_datas ++ tx_nonces ++ tx_gases ++ protected_bits` + tx_sigs ++ tx_tos ++ tx_data ++ tx_nonces ++ tx_gases ++ protected_bits` - `contract_creation_bits`: standard bitlist of `sum(block_tx_counts)` bits: 1 bit per L2 transactions, indicating if transaction is a contract creation transaction. - `y_parity_bits`: standard bitlist of `sum(block_tx_counts)` bits: @@ -115,7 +115,7 @@ Where: - `r` is encoded as big-endian `uint256` - `s` is encoded as big-endian `uint256` - `tx_tos`: concatenated list of `to` field. `to` field in contract creation transaction will be `nil` and ignored. - - `tx_datas`: concatenated list of variable length rlp encoded data, + - `tx_data`: concatenated list of variable length rlp encoded data, matching the encoding of the fields as in the [EIP-2718] format of the `TransactionType`. - `legacy`: `rlp_encode(value, gasPrice, data)` - `1`: ([EIP-2930]): `0x01 ++ rlp_encode(value, gasPrice, data, accessList)` @@ -186,7 +186,7 @@ The following fields stores truncated data: ### `tx_data_headers` removal from initial specs -We do not need to store length per each `tx_datas` elements even if those are variable length, +We do not need to store length per each `tx_data` elements even if those are variable length, because the elements itself is RLP encoded, containing their length in RLP prefix. ### `Chain ID` removal from initial specs @@ -347,7 +347,7 @@ Span-batch rules, in validation order: - `len(block_input.transactions) > 0`: -> `drop`: when exceeding the sequencer time drift, never allow the sequencer to include transactions. - And for all transactions: - - `drop` if the `batch.tx_datas` list contains a transaction + - `drop` if the `batch.tx_data` list contains a transaction 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`) From aa7fcd597acf978125007ff55b2186616318489d Mon Sep 17 00:00:00 2001 From: John Wick <153378704+JohnwickBC@users.noreply.github.com> Date: Tue, 12 Dec 2023 08:38:38 +0800 Subject: [PATCH 2/7] Datas -> Data --- specs/span-batches.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/span-batches.md b/specs/span-batches.md index 3daa5425643a..46cbb1dc1a3f 100644 --- a/specs/span-batches.md +++ b/specs/span-batches.md @@ -225,7 +225,7 @@ Deposit transactions are excluded in batches and are never written at L1 so excl There are (7 choose 2) * 5! = 2520 permutations of ordering fields of `txs`. It is not 7! because `contract_creation_bits` must be first decoded in order to decode `tx_tos`. We experimented to find out the best layout for compression. -It turned out placing random data together(`TxSigs`, `TxTos`, `TxDatas`), +It turned out placing random data together(`TxSigs`, `TxTos`, `TxData`), then placing leftovers helped gzip to gain more size reduction. ### `fee_recipients` Encoding Scheme From 15ff079d082cadc6d7cf796cd33b21248d827a81 Mon Sep 17 00:00:00 2001 From: John Wick <153378704+JohnwickBC@users.noreply.github.com> Date: Tue, 12 Dec 2023 08:39:38 +0800 Subject: [PATCH 3/7] transacion -> transaction --- specs/span-batches.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/span-batches.md b/specs/span-batches.md index 46cbb1dc1a3f..446d940fbf27 100644 --- a/specs/span-batches.md +++ b/specs/span-batches.md @@ -126,7 +126,7 @@ Where: - `1`: ([EIP-2930]): `gasLimit` - `2`: ([EIP-1559]): `gas_limit` - `protected_bits`: standard bitlist of length of number of legacy transactions: - 1 bit per L2 legacy transactions, indicating if transacion is protected([EIP-155]) or not. + 1 bit per L2 legacy transactions, indicating if transaction is protected([EIP-155]) or not. Introduce version `2` to the [batch-format](./derivation.md#batch-format) table: From db33924111d5dc346881e27f9e07d2feaf5f1762 Mon Sep 17 00:00:00 2001 From: John Wick <153378704+JohnwickBC@users.noreply.github.com> Date: Tue, 12 Dec 2023 08:40:35 +0800 Subject: [PATCH 4/7] timestap -> timestamp --- specs/glossary.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/glossary.md b/specs/glossary.md index 01b6c535d6cf..c20a69f6c130 100644 --- a/specs/glossary.md +++ b/specs/glossary.md @@ -564,7 +564,7 @@ The state of the L2 genesis block comprises: how native ETH balances were stored in the storage trie. - [Predeployed contracts][predeploy] -The timestap of the L2 genesis block must be a multiple of the [block time][block-time] (i.e. a even number, since the +The timestamp of the L2 genesis block must be a multiple of the [block time][block-time] (i.e. a even number, since the block time is 2 seconds). When updating the rollup protocol to a new version, we may perform a *squash fork*, a process that entails the creation From 8f8ae92aa05c85e2360cc351ff6b6cbe65a2050f Mon Sep 17 00:00:00 2001 From: John Wick <153378704+JohnwickBC@users.noreply.github.com> Date: Tue, 12 Dec 2023 08:41:34 +0800 Subject: [PATCH 5/7] specifiction -> specification --- specs/glossary.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/glossary.md b/specs/glossary.md index c20a69f6c130..d6bc7debe322 100644 --- a/specs/glossary.md +++ b/specs/glossary.md @@ -492,7 +492,7 @@ The purpose of channel timeouts is dual: sent). - Bound the number of L1 blocks we have to look back in order to decode [sequencer batches][sequencer-batch] from channels. This is particularly relevant during L1 re-orgs, see the [Resetting Channel Buffering][reset-channel-buffer] - section of the L2 Chain Derivation specifiction for more information. + section of the L2 Chain Derivation specification for more information. [reset-channel-buffer]: derivation.md#resetting-channel-buffering From 7e875cf8d5cc1542c4895138d562a9ebf9bd30f5 Mon Sep 17 00:00:00 2001 From: John Wick <153378704+JohnwickBC@users.noreply.github.com> Date: Tue, 12 Dec 2023 08:42:33 +0800 Subject: [PATCH 6/7] missing timestamp fixed --- specs/glossary.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/glossary.md b/specs/glossary.md index d6bc7debe322..55bf9f15bc34 100644 --- a/specs/glossary.md +++ b/specs/glossary.md @@ -483,7 +483,7 @@ The channel timeout is a duration (in L1 blocks) during which [channel frames][c The acceptable time range for the frames of a [channel][channel] is `[channel_id.timestamp, channel_id.timestamp + CHANNEL_TIMEOUT]`. The acceptable L1 block range for these frames are any L1 block whose timestamp falls inside this -time range. (Note that `channel_id.timetamp` must be lower than the L1 block timestamp of any L1 block in which frames +time range. (Note that `channel_id.timestamp` must be lower than the L1 block timestamp of any L1 block in which frames of the channel are seen, or else these frames are ignored.) The purpose of channel timeouts is dual: From e9fcd348ade52df00d81151ecc2887177fad5ba4 Mon Sep 17 00:00:00 2001 From: John Wick <153378704+JohnwickBC@users.noreply.github.com> Date: Tue, 12 Dec 2023 09:00:40 +0800 Subject: [PATCH 7/7] revert intentionally plural in datas --- specs/span-batches.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/specs/span-batches.md b/specs/span-batches.md index 446d940fbf27..6acf7ca2ed84 100644 --- a/specs/span-batches.md +++ b/specs/span-batches.md @@ -106,7 +106,7 @@ Where: - `block_tx_counts`: for each block, a `uvarint` of `len(block.transactions)`. - `txs`: L2 transactions which is reorganized and encoded as below. - `txs = contract_creation_bits ++ y_parity_bits ++ - tx_sigs ++ tx_tos ++ tx_data ++ tx_nonces ++ tx_gases ++ protected_bits` + tx_sigs ++ tx_tos ++ tx_datas ++ tx_nonces ++ tx_gases ++ protected_bits` - `contract_creation_bits`: standard bitlist of `sum(block_tx_counts)` bits: 1 bit per L2 transactions, indicating if transaction is a contract creation transaction. - `y_parity_bits`: standard bitlist of `sum(block_tx_counts)` bits: @@ -115,7 +115,7 @@ Where: - `r` is encoded as big-endian `uint256` - `s` is encoded as big-endian `uint256` - `tx_tos`: concatenated list of `to` field. `to` field in contract creation transaction will be `nil` and ignored. - - `tx_data`: concatenated list of variable length rlp encoded data, + - `tx_datas`: concatenated list of variable length rlp encoded data, matching the encoding of the fields as in the [EIP-2718] format of the `TransactionType`. - `legacy`: `rlp_encode(value, gasPrice, data)` - `1`: ([EIP-2930]): `0x01 ++ rlp_encode(value, gasPrice, data, accessList)` @@ -186,7 +186,7 @@ The following fields stores truncated data: ### `tx_data_headers` removal from initial specs -We do not need to store length per each `tx_data` elements even if those are variable length, +We do not need to store length per each `tx_datas` elements even if those are variable length, because the elements itself is RLP encoded, containing their length in RLP prefix. ### `Chain ID` removal from initial specs @@ -225,7 +225,7 @@ Deposit transactions are excluded in batches and are never written at L1 so excl There are (7 choose 2) * 5! = 2520 permutations of ordering fields of `txs`. It is not 7! because `contract_creation_bits` must be first decoded in order to decode `tx_tos`. We experimented to find out the best layout for compression. -It turned out placing random data together(`TxSigs`, `TxTos`, `TxData`), +It turned out placing random data together(`TxSigs`, `TxTos`, `TxDatas`), then placing leftovers helped gzip to gain more size reduction. ### `fee_recipients` Encoding Scheme @@ -347,7 +347,7 @@ Span-batch rules, in validation order: - `len(block_input.transactions) > 0`: -> `drop`: when exceeding the sequencer time drift, never allow the sequencer to include transactions. - And for all transactions: - - `drop` if the `batch.tx_data` list contains a transaction + - `drop` if the `batch.tx_datas` list contains a transaction 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`)