Skip to content

Commit 908e95d

Browse files
authored
add sequencing section (#497)
* add sequencing section * add a diagram * v0.14.0 * update ignite tutorial with sequencer * minor fixes * minor * meh * fix * Delete ~/.celestia-light-mocha-4/config/app.toml * Delete ~/.celestia-light-mocha-4/config/client.toml * Delete ~/.celestia-light-mocha-4/config/config.toml
1 parent 99fb831 commit 908e95d

File tree

10 files changed

+127
-1
lines changed

10 files changed

+127
-1
lines changed

.vitepress/config.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,32 @@ function sidebarHome() {
243243
},
244244
],
245245
},
246+
{
247+
text: "Sequencing",
248+
collapsed: true,
249+
items: [
250+
{
251+
text: "Overview",
252+
link: "/tutorials/sequencing",
253+
},
254+
{
255+
text: "Centralized",
256+
link: "/tutorials/centralized",
257+
},
258+
{
259+
text: "Based",
260+
link: "/tutorials/based",
261+
},
262+
{
263+
text: "Forced Inclusion",
264+
link: "/tutorials/forced",
265+
},
266+
{
267+
text: "Astria",
268+
link: "/tutorials/astria",
269+
},
270+
],
271+
},
246272
{
247273
text: "Execution",
248274
collapsed: true,

.vitepress/constants/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const constants = Object.freeze({
1010
rollkitIgniteAppVersion: "rollkit/v0.2.1",
1111

1212
localDALatestTag: "v0.3.1",
13-
13+
goSequencingLatestTag: "v0.4.0",
1414
igniteVersionTag: "v28.5.3",
1515
});
1616
export default constants;

guides/ignite-rollkit.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ cd $HOME && curl -sSL https://rollkit.dev/install-local-da.sh | sh -s {{constant
4040

4141
This script builds and runs a DA node, which will listen on port `7980`.
4242

43+
## Run a local Sequencer node {#run-local-sequencer-node}
44+
45+
First, set up a local sequencer node:
46+
47+
```bash-vue
48+
cd $HOME && curl -sSL https://rollkit.dev/install-local-sequencer.sh | sh -s {{constants.goSequencingLatestTag}} gm
49+
```
50+
51+
This script builds and runs a local sequencer node, which will listen on port `50051`.
52+
4353
## Install Ignite App Rollkit {#install-ignite-app-rollkit}
4454

4555
In a new terminal window, you'll now install and run the Ignite App Rollkit.

public/img/sequencing.jpg

22.8 KB
Loading

public/install-local-sequencer.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
echo "Downloading local sequencer source code..."
4+
git clone https://github.com/rollkit/go-sequencing.git
5+
cd go-sequencing || { echo "Failed to find the downloaded repository"; exit 1; }
6+
git fetch --all --tags
7+
git checkout $1
8+
echo "Building and installing Local Sequencer..."
9+
make build
10+
echo "Starting Local Sequencer..."
11+
./build/local-sequencer -rollup-id $2

tutorials/astria.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Astria Sequencing
2+
3+
Coming soon ...

tutorials/based.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Based Sequencing
2+
3+
Coming soon ...

tutorials/centralized.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Centralized Sequencer
2+
3+
A centralized sequencer is a sequencing middleware that receives rollup transactions and provides a local sequencing capabilities. Meaning, the transactions are ordered in the order they are received by the sequencer without any censorship. Further, the sequenced batches are made available in the DA network (such as Celestia). Under the hood, the centralized sequencer is a GRPC server that implements `go-sequencing` interface and the server is hosted by the same node that is running the aggregator for the Rollkit rollup.
4+
5+
![Rollkit with Centralized Sequencer](/public/img/sequencing.jpg)
6+
7+
### Installation and Use
8+
9+
```sh
10+
git clone https://github.com/rollkit/centralized-sequencer.git
11+
cd centralized-sequencer
12+
make build
13+
./build/centralized-sequencer -h
14+
```
15+
16+
17+
```sh
18+
Usage:
19+
-host string
20+
centralized sequencer host (default "localhost")
21+
-port string
22+
centralized sequencer port (default "50051")
23+
-listen-all
24+
listen on all network interfaces (0.0.0.0) instead of just localhost
25+
-rollup-id string
26+
rollup id (default "rollupId")
27+
-batch-time duration
28+
time in seconds to wait before generating a new batch (default 2s)
29+
-da_address string
30+
DA address (default "http://localhost:26658")
31+
-da_auth_token string
32+
auth token for the DA
33+
-da_namespace string
34+
DA namespace where the sequencer submits transactions
35+
-db_path string
36+
path to the database
37+
```
38+
39+
As shown by the help command, a centralized sequencer is configured to serve a rollup (via `rollup_id`). The DA network to persist the sequenced batches are specified using `da_address`, `da_auth_token` and `da_namespace`.

tutorials/forced.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Forced Inclusion
2+
3+
Coming soon ...

tutorials/sequencing.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Sequencing
2+
3+
## Rollkit prior to Sequencing
4+
Rollkit's aggregator node was responsible for selecting and ordering transactions for including in the rollup blocks. The Rollkit aggregator used to follow a FCFS strategy, where every transaction submitted gets included in the block in order without any censorship. Use of a different sequencing strategy or connecting to a sequencing network (e.g., Astria) was not possible. Rollkit [v0.14.0](https://github.com/rollkit/rollkit/releases/tag/v0.14.0) onwards makes it possible for rollkit to connect to a sequencing network and communicate via grpc.
5+
6+
### Sequencing Interface
7+
8+
[go-sequencing](https://github.com/rollkit/go-sequencing) defines a sequencing interface for communicating between any sequencing network and Rollkit. The key functions of the interface are defined as shown below.
9+
10+
```go
11+
SubmitRollupTransaction(rollupId, data) returns (error)
12+
13+
GetNextBatch(rollupId, lastBatchHash, maxBytes) returns (batch, timestamp)
14+
15+
VerifyBatch(rollupId, batchHash) returns (status)
16+
```
17+
18+
It mainly consists of:
19+
* `SubmitRollupTransaction` relays the rollup transactions from Rollkit rollup to the sequencing network
20+
* `GetNextBatch` returns the next batch of transactions along with a deterministic timestamp
21+
* `VerifyBatch` validates the sequenced batch
22+
23+
### Sequencing Implementations
24+
25+
An implementation of the sequencing interface mainly acts as a middleware that connects Rollkit rollup and the sequencing layer. It implements the sequencing interface functions described above. For example, [centralized-sequencer](https://github.com/rollkit/centralized-sequencer) is the refactored functionality from the Rollkit prior to `v0.14.0`. The centralized sequencer is the middleware run by the aggregator node of the Rollkit rollup. The aggregator node relays rollup transactions to centralized sequencer which then submits them to the DA network (such as Celestia). The header producer node then retrieves (via `GetNextBatch`) the batched transaction from the centralized sequencer to execute the transactions and produce the updated rollup state. Similarly, there are other sequencing middlewares which can be built for various sequencing strategies or even for connecting to different third-party sequencing networks.
26+
27+
The sequencing implementations that are currently work in progress:
28+
* [centralized-sequencer](https://github.com/rollkit/centralized-sequencer)
29+
* [based-sequencer](https://github.com/rollkit/based-sequencer)
30+
* [forced-inclusion-sequencer]()
31+
* [astria-sequencer](https://github.com/rollkit/astria-sequencer)

0 commit comments

Comments
 (0)