Skip to content

Commit

Permalink
specs: add minimal batch submitter spec, fix broken links
Browse files Browse the repository at this point in the history
  • Loading branch information
protolambda committed Aug 2, 2022
1 parent d4e80a8 commit da212a3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
24 changes: 24 additions & 0 deletions specs/batcher.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Batch Submitter

The batch submitter, also referred to as the batcher, is the entity submitting the L2 sequencer data to L1,
to make it available for verifiers.

[derivation-spec]: ./derivation.md

The format of the data transactions is defined in the [derivation spec]: the data is constructed from L2 blocks
in the reverse order as it is derived from data into L2 blocks.

The timing, operation and transaction signing is implementation-specific: any data can be submitted at any time,
but only the data that matches the [derivation spec] rules will be valid from the verifier perspective.

The most minimal batcher implementation can be defined as a loop of the following operations:

1. See if the `unsafe` L2 block number is past the `safe` block number: `unsafe` data needs to be submitted.
2. Iterate over all unsafe L2 blocks, skip any that were previously submitted.
3. Open a channel, buffer all the L2 block data to be submitted,
while applying the encoding and compression as defined in the [derivation spec].
4. Pull frames from the channel to fill data transactions with, until the channel is empty.
5. Submit the data transactions to L1

The L2 view of safe/unsafe does not instantly update after data is submitted, nor when it gets confirmed on L1,
so special care may have to be taken to not duplicate data submissions.
6 changes: 3 additions & 3 deletions specs/derivation.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
[g-avail-provider]: glossary.md#data-availability-provider
[g-batcher]: glossary.md#batcher
[g-l2-output]: glossary.md#l2-output
[g-fault-proof]: glosary.md#fault-proof
[g-fault-proof]: glossary.md#fault-proof
[g-channel]: glossary.md#channel
[g-channel-frame]: glossary.md#channel-frame
[g-rollup-node]: glossary.md#rollup-node
Expand Down Expand Up @@ -181,7 +181,7 @@ by a correct output root **for the existing sequencer batches.**

Refer to the [Batch Submission specification][batcher-spec] for more information.

[batcher-spec]: batching.md
[batcher-spec]: batcher.md

> **TODO** rewrite the batch submission specification
>
Expand Down Expand Up @@ -303,7 +303,7 @@ where:
> can influence things down the line!!
[sqlite-uvarint]: https://www.sqlite.org/src4/doc/trunk/www/varint.wiki
[batcher-spec]: batching.md
[batcher-spec]: batcher.md

### Channel Format

Expand Down
4 changes: 0 additions & 4 deletions specs/rollup-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,3 @@ The input and return types here are as defined by the [engine API specs][engine-
- returns:
1. `version`: `DATA`, 32 Bytes - the output root version number, beginning with 0.
1. `l2OutputRoot`: `DATA`, 32 Bytes - the output root

## L2 Batch creation RPC method

See [Batch derivation](./batching.md) for an RPC specification for batch data submission.

0 comments on commit da212a3

Please sign in to comment.