@@ -9,7 +9,6 @@ whatsnext: { "EVM Differences from Ethereum": "/en/technology/chain/differences/
9
9
10
10
import ClickToZoom from " ../../../../../components/ClickToZoom.astro"
11
11
import RollupProcess from " ../_images/rollup.png"
12
- import NetworkTabs from " ../../../../../components/Tabs/NetworkTabs.astro"
13
12
import { Tabs } from " ../../../../../components/Tabs/Tabs.tsx"
14
13
15
14
This document describes the rollup process in Scroll.
@@ -121,77 +120,89 @@ At this stage, the state root of the latest finalized batch can be used trustles
121
120
122
121
This section describes the codec of three data structures in the Rollup contract: ` BatchHeader ` , ` Chunk ` , and ` BlockContext ` .
123
122
124
- The latest update to the codec was introduced in the Bernoulli upgrade.
125
-
126
- ### Bernoulli
127
-
128
- #### ` BatchHeader ` Codec
129
-
130
- | Field | Bytes | Type | Offset | Description |
131
- | ------------------------ | ------- | ----------- | ------ | --------------------------------------------------------------- |
132
- | ` version ` | 1 | ` uint8 ` | 0 | The batch header version |
133
- | ` batchIndex ` | 8 | ` uint64 ` | 1 | The index of the batch |
134
- | ` l1MessagePopped ` | 8 | ` uint64 ` | 9 | The number of L1 messages popped in the batch |
135
- | ` totalL1MessagePopped ` | 8 | ` uint64 ` | 17 | The number of total L1 messages popped after the batch |
136
- | ` dataHash ` | 32 | ` bytes32 ` | 25 | The data hash of the batch |
137
- | ` blobVersionedHash ` | 32 | ` bytes32 ` | 57 | The versioned hash of the blob with this batch’s data |
138
- | ` parentBatchHash ` | 32 | ` bytes32 ` | 89 | The parent batch hash |
139
- | ` skippedL1MessageBitmap ` | dynamic | ` uint256[] ` | 121 | A bitmap to indicate which L1 messages are skipped in the batch |
140
-
141
- #### ` Chunk ` Codec
142
-
143
- | Field | Bytes | Type | Offset | Description |
144
- | ---------------- | ------- | -------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
145
- | ` numBlocks ` | 1 | ` uint8 ` | 0 | The number of blocks in the chunk |
146
- | ` block[0] ` | 60 | ` BlockContext ` | 1 | The block information of the 1st block |
147
- | ... | ... | ... | ... | ... |
148
- | ` block[i] ` | 60 | ` BlockContext ` | ` 60*i+1 ` | The block information of ` i+1 ` -th block |
149
- | ... | ... | ... | ... | ... |
150
- | ` block[n-1] ` | 60 | ` BlockContext ` | ` 60*n-59 ` | The block information of the last block |
151
-
152
- #### ` BlockContext ` Codec
153
-
154
- | Field | Bytes | Type | Offset | Description |
155
- | ----------------- | ----- | --------- | ------ | ----------------------------------------------------------------------------------- |
156
- | ` blockNumber ` | 8 | ` uint64 ` | 0 | The block number |
157
- | ` timestamp ` | 8 | ` uint64 ` | 8 | The block time |
158
- | ` baseFee ` | 32 | ` uint256 ` | 16 | The base fee of this block. Currently, it is always 0, because we disable EIP-1559. |
159
- | ` gasLimit ` | 8 | ` uint64 ` | 48 | The gas limit of this block |
160
- | ` numTransactions ` | 2 | ` uint16 ` | 56 | The number of transactions in this block, including both L1 & L2 txs |
161
- | ` numL1Messages ` | 2 | ` uint16 ` | 58 | The number of L1 messages in this block
162
-
163
- ### Archimedes
164
- #### ` BatchHeader ` Codec
165
-
166
- | Field | Bytes | Type | Offset | Description |
167
- | ------------------------ | ------- | ----------- | ------ | --------------------------------------------------------------- |
168
- | ` version ` | 1 | ` uint8 ` | 0 | The batch header version |
169
- | ` batchIndex ` | 8 | ` uint64 ` | 1 | The index of the batch |
170
- | ` l1MessagePopped ` | 8 | ` uint64 ` | 9 | The number of L1 messages popped in the batch |
171
- | ` totalL1MessagePopped ` | 8 | ` uint64 ` | 17 | The number of total L1 messages popped after the batch |
172
- | ` dataHash ` | 32 | ` bytes32 ` | 25 | The data hash of the batch |
173
- | ` parentBatchHash ` | 32 | ` bytes32 ` | 57 | The parent batch hash |
174
- | ` skippedL1MessageBitmap ` | dynamic | ` uint256[] ` | 89 | A bitmap to indicate which L1 messages are skipped in the batch |
175
-
176
- #### ` Chunk ` Codec
177
-
178
- | Field | Bytes | Type | Offset | Description |
179
- | ---------------- | ------- | -------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
180
- | ` numBlocks ` | 1 | ` uint8 ` | 0 | The number of blocks in the chunk |
181
- | ` block[0] ` | 60 | ` BlockContext ` | 1 | The block information of the 1st block |
182
- | ... | ... | ... | ... | ... |
183
- | ` block[i] ` | 60 | ` BlockContext ` | ` 60*i+1 ` | The block information of ` i+1 ` -th block |
184
- | ... | ... | ... | ... | ... |
185
- | ` block[n-1] ` | 60 | ` BlockContext ` | ` 60*n-59 ` | The block information of the last block
186
- | ` l2Transactions ` | dynamic | ` bytes ` | ` 60*n+1 ` | The concatenated RLP encoding of L2 transactions with signatures. The byte length (` uint32 ` ) of RLP encoding is inserted before each transaction. | |
187
-
188
- #### ` BlockContext ` Codec
189
-
190
- | Field | Bytes | Type | Offset | Description |
191
- | ----------------- | ----- | --------- | ------ | ----------------------------------------------------------------------------------- |
192
- | ` blockNumber ` | 8 | ` uint64 ` | 0 | The block number |
193
- | ` timestamp ` | 8 | ` uint64 ` | 8 | The block time |
194
- | ` baseFee ` | 32 | ` uint256 ` | 16 | The base fee of this block. Currently, it is always 0, because we disable EIP-1559. |
195
- | ` gasLimit ` | 8 | ` uint64 ` | 48 | The gas limit of this block |
196
- | ` numTransactions ` | 2 | ` uint16 ` | 56 | The number of transactions in this block, including both L1 & L2 txs |
197
- | ` numL1Messages ` | 2 | ` uint16 ` | 58 | The number of L1 messages in this block
123
+ The latest update to the codec was introduced in the [ Bernoulli upgrade] ( /technology/overview/scroll-upgrades#bernoulli-upgrade ) .
124
+
125
+ <Tabs sharedStore = " upgrades" client :visible >
126
+ <Fragment slot = " tab.bernoulli" >bernoulli</Fragment >
127
+ <Fragment slot = " tab.archimedes" >archimedes</Fragment >
128
+ <Fragment slot = " panel.bernoulli" >
129
+ <slot name = " bernoulli" />
130
+
131
+ This data format is still applicable post-Curie upgrade, and has not been changed.
132
+
133
+ #### ` BatchHeader ` Codec
134
+
135
+ | Field | Bytes | Type | Offset | Description |
136
+ | ------------------------ | ------- | ----------- | ------ | --------------------------------------------------------------- |
137
+ | ` version ` | 1 | ` uint8 ` | 0 | The batch header version |
138
+ | ` batchIndex ` | 8 | ` uint64 ` | 1 | The index of the batch |
139
+ | ` l1MessagePopped ` | 8 | ` uint64 ` | 9 | The number of L1 messages popped in the batch |
140
+ | ` totalL1MessagePopped ` | 8 | ` uint64 ` | 17 | The number of total L1 messages popped after the batch |
141
+ | ` dataHash ` | 32 | ` bytes32 ` | 25 | The data hash of the batch |
142
+ | ` blobVersionedHash ` | 32 | ` bytes32 ` | 57 | The versioned hash of the blob with this batch’s data |
143
+ | ` parentBatchHash ` | 32 | ` bytes32 ` | 89 | The parent batch hash |
144
+ | ` skippedL1MessageBitmap ` | dynamic | ` uint256[] ` | 121 | A bitmap to indicate which L1 messages are skipped in the batch |
145
+
146
+ #### ` Chunk ` Codec
147
+
148
+ | Field | Bytes | Type | Offset | Description |
149
+ | ---------------- | ------- | -------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
150
+ | ` numBlocks ` | 1 | ` uint8 ` | 0 | The number of blocks in the chunk |
151
+ | ` block[0] ` | 60 | ` BlockContext ` | 1 | The block information of the 1st block |
152
+ | ... | ... | ... | ... | ... |
153
+ | ` block[i] ` | 60 | ` BlockContext ` | ` 60*i+1 ` | The block information of ` i+1 ` -th block |
154
+ | ... | ... | ... | ... | ... |
155
+ | ` block[n-1] ` | 60 | ` BlockContext ` | ` 60*n-59 ` | The block information of the last block |
156
+
157
+ #### ` BlockContext ` Codec
158
+
159
+ | Field | Bytes | Type | Offset | Description |
160
+ | ----------------- | ----- | --------- | ------ | ----------------------------------------------------------------------------------- |
161
+ | ` blockNumber ` | 8 | ` uint64 ` | 0 | The block number |
162
+ | ` timestamp ` | 8 | ` uint64 ` | 8 | The block time |
163
+ | ` baseFee ` | 32 | ` uint256 ` | 16 | The base fee of this block. Currently, it is always 0, because we disable EIP-1559. |
164
+ | ` gasLimit ` | 8 | ` uint64 ` | 48 | The gas limit of this block |
165
+ | ` numTransactions ` | 2 | ` uint16 ` | 56 | The number of transactions in this block, including both L1 & L2 txs |
166
+ | ` numL1Messages ` | 2 | ` uint16 ` | 58 | The number of L1 messages in this block
167
+
168
+ </Fragment >
169
+
170
+ <Fragment slot = " panel.archimedes" >
171
+ <slot name = " archimedes" />
172
+ #### ` BatchHeader ` Codec
173
+
174
+ | Field | Bytes | Type | Offset | Description |
175
+ | ------------------------ | ------- | ----------- | ------ | --------------------------------------------------------------- |
176
+ | ` version ` | 1 | ` uint8 ` | 0 | The batch header version |
177
+ | ` batchIndex ` | 8 | ` uint64 ` | 1 | The index of the batch |
178
+ | ` l1MessagePopped ` | 8 | ` uint64 ` | 9 | The number of L1 messages popped in the batch |
179
+ | ` totalL1MessagePopped ` | 8 | ` uint64 ` | 17 | The number of total L1 messages popped after the batch |
180
+ | ` dataHash ` | 32 | ` bytes32 ` | 25 | The data hash of the batch |
181
+ | ` parentBatchHash ` | 32 | ` bytes32 ` | 57 | The parent batch hash |
182
+ | ` skippedL1MessageBitmap ` | dynamic | ` uint256[] ` | 89 | A bitmap to indicate which L1 messages are skipped in the batch |
183
+
184
+ #### ` Chunk ` Codec
185
+
186
+ | Field | Bytes | Type | Offset | Description |
187
+ | ---------------- | ------- | -------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
188
+ | ` numBlocks ` | 1 | ` uint8 ` | 0 | The number of blocks in the chunk |
189
+ | ` block[0] ` | 60 | ` BlockContext ` | 1 | The block information of the 1st block |
190
+ | ... | ... | ... | ... | ... |
191
+ | ` block[i] ` | 60 | ` BlockContext ` | ` 60*i+1 ` | The block information of ` i+1 ` -th block |
192
+ | ... | ... | ... | ... | ... |
193
+ | ` block[n-1] ` | 60 | ` BlockContext ` | ` 60*n-59 ` | The block information of the last block
194
+ | ` l2Transactions ` | dynamic | ` bytes ` | ` 60*n+1 ` | The concatenated RLP encoding of L2 transactions with signatures. The byte length (` uint32 ` ) of RLP encoding is inserted before each transaction. | |
195
+
196
+ #### ` BlockContext ` Codec
197
+
198
+ | Field | Bytes | Type | Offset | Description |
199
+ | ----------------- | ----- | --------- | ------ | ----------------------------------------------------------------------------------- |
200
+ | ` blockNumber ` | 8 | ` uint64 ` | 0 | The block number |
201
+ | ` timestamp ` | 8 | ` uint64 ` | 8 | The block time |
202
+ | ` baseFee ` | 32 | ` uint256 ` | 16 | The base fee of this block. Currently, it is always 0, because we disable EIP-1559. |
203
+ | ` gasLimit ` | 8 | ` uint64 ` | 48 | The gas limit of this block |
204
+ | ` numTransactions ` | 2 | ` uint16 ` | 56 | The number of transactions in this block, including both L1 & L2 txs |
205
+ | ` numL1Messages ` | 2 | ` uint16 ` | 58 | The number of L1 messages in this block
206
+
207
+ </Fragment >
208
+ </Tabs >
0 commit comments