Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
dbc719bd
Unverified
Commit
dbc719bd
authored
Jul 19, 2023
by
protolambda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
specs: span-batch spec fixes, issues found by @testinprod-io @ImTei
Co-authored-by:
Tei Im
<
tei.im@testinprod.io
>
parent
ab7496c8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
span-batches.md
specs/span-batches.md
+7
-6
No files found.
specs/span-batches.md
View file @
dbc719bd
...
@@ -64,7 +64,8 @@ Introduce version `1` to the [batch-format](./derivation.md#batch-format) table:
...
@@ -64,7 +64,8 @@ Introduce version `1` to the [batch-format](./derivation.md#batch-format) table:
Notation:
Notation:
`++`
: concatenation of byte-strings.
`++`
: concatenation of byte-strings.
`anchor`
: first L2 block in the span
`span_start`
: first L2 block in the span
`span_end`
: last L2 block in the span
`uvarint`
: unsigned Base128 varint, as defined in
[
protobuf spec
]
`uvarint`
: unsigned Base128 varint, as defined in
[
protobuf spec
]
[
protobuf spec
]:
https://protobuf.dev/programming-guides/encoding/#varints
[
protobuf spec
]:
https://protobuf.dev/programming-guides/encoding/#varints
...
@@ -72,11 +73,11 @@ Notation:
...
@@ -72,11 +73,11 @@ Notation:
Where:
Where:
-
`prefix = rel_timestamp ++ parent_check ++ l1_origin_check`
-
`prefix = rel_timestamp ++ parent_check ++ l1_origin_check`
-
`rel_timestamp`
: relative time since genesis, i.e.
`
anchor
.timestamp - config.genesis.timestamp`
.
-
`rel_timestamp`
: relative time since genesis, i.e.
`
span_start
.timestamp - config.genesis.timestamp`
.
-
`parent_check`
: first 20 bytes of parent hash, i.e.
`
anchor
.parent_hash[:20]`
.
-
`parent_check`
: first 20 bytes of parent hash, i.e.
`
span_start
.parent_hash[:20]`
.
-
`l1_origin_check`
: to ensure the intended L1 origins of this span of
-
`l1_origin_check`
: to ensure the intended L1 origins of this span of
L2 blocks are consistent with the L1 chain, the blockhash of the last L1 origin is referenced.
L2 blocks are consistent with the L1 chain, the blockhash of the last L1 origin is referenced.
The hash is truncated to 20 bytes for efficiency, i.e.
`
anchor
.l1_origin.hash[:20]`
.
The hash is truncated to 20 bytes for efficiency, i.e.
`
span_end
.l1_origin.hash[:20]`
.
-
`payload = block_count ++ block_tx_counts ++ tx_data_headers ++ tx_data ++ tx_sigs`
:
-
`payload = block_count ++ block_tx_counts ++ tx_data_headers ++ tx_data ++ tx_sigs`
:
-
`block_count`
:
`uvarint`
number of L2 blocks.
-
`block_count`
:
`uvarint`
number of L2 blocks.
-
`origin_bits`
: bitlist of
`block_count`
bits, right-padded to a multiple of 8 bits:
-
`origin_bits`
: bitlist of
`block_count`
bits, right-padded to a multiple of 8 bits:
...
@@ -149,10 +150,10 @@ Span-batch rules, in validation order:
...
@@ -149,10 +150,10 @@ Span-batch rules, in validation order:
-
Rules:
-
Rules:
-
`start_epoch_num + sequence_window_size < inclusion_block_number`
->
`drop`
:
-
`start_epoch_num + sequence_window_size < inclusion_block_number`
->
`drop`
:
i.e. the batch must be included timely.
i.e. the batch must be included timely.
-
`
end_epoch_num <
epoch.number`
->
`future`
: i.e. all referenced L1 epochs must be there.
-
`
start_epoch_num >
epoch.number`
->
`future`
: i.e. all referenced L1 epochs must be there.
-
`end_epoch_num == epoch.number`
:
-
`end_epoch_num == epoch.number`
:
-
If
`batch.l1_origin_check != epoch.hash[:20]`
->
`drop`
: verify the batch is intended for this L1 chain.
-
If
`batch.l1_origin_check != epoch.hash[:20]`
->
`drop`
: verify the batch is intended for this L1 chain.
-
`end_epoch_num
>
epoch.number`
->
`drop`
: must have been duplicate batch,
-
`end_epoch_num
<
epoch.number`
->
`drop`
: must have been duplicate batch,
we may be past this L1 block in the safe L2 chain.
we may be past this L1 block in the safe L2 chain.
-
Max Sequencer time-drift checks:
-
Max Sequencer time-drift checks:
-
Note: The max time-drift is enforced for the
*batch as a whole*
, to keep the possible output variants small.
-
Note: The max time-drift is enforced for the
*batch as a whole*
, to keep the possible output variants small.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment