-
Notifications
You must be signed in to change notification settings - Fork 57
add sequencing section #497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7707331
add sequencing section
gupadhyaya 5150299
add a diagram
gupadhyaya 290f380
v0.14.0
gupadhyaya cf15f4b
update ignite tutorial with sequencer
gupadhyaya 99105e0
minor fixes
gupadhyaya 9422240
Merge branch 'main' into sequencer
gupadhyaya 0f8e2aa
minor
gupadhyaya ec644a1
meh
gupadhyaya ccbee16
fix
gupadhyaya 1d59aa2
Delete ~/.celestia-light-mocha-4/config/app.toml
gupadhyaya 73fb710
Delete ~/.celestia-light-mocha-4/config/client.toml
gupadhyaya 636bae3
Delete ~/.celestia-light-mocha-4/config/config.toml
gupadhyaya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
echo "Downloading local sequencer source code..." | ||
git clone https://github.com/rollkit/go-sequencing.git | ||
gupadhyaya marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cd go-sequencing || { echo "Failed to find the downloaded repository"; exit 1; } | ||
git fetch --all --tags | ||
git checkout $1 | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
echo "Building and installing Local Sequencer..." | ||
make build | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
echo "Starting Local Sequencer..." | ||
./build/local-sequencer -rollup-id $2 | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Astria Sequencing | ||
|
||
Coming soon ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Based Sequencing | ||
|
||
Coming soon ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Centralized Sequencer | ||
|
||
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. | ||
|
||
 | ||
|
||
### Installation and Use | ||
|
||
```sh | ||
git clone https://github.com/rollkit/centralized-sequencer.git | ||
cd centralized-sequencer | ||
make build | ||
./build/centralized-sequencer -h | ||
``` | ||
|
||
|
||
```sh | ||
Usage: | ||
-host string | ||
centralized sequencer host (default "localhost") | ||
-port string | ||
centralized sequencer port (default "50051") | ||
-listen-all | ||
listen on all network interfaces (0.0.0.0) instead of just localhost | ||
-rollup-id string | ||
rollup id (default "rollupId") | ||
-batch-time duration | ||
time in seconds to wait before generating a new batch (default 2s) | ||
-da_address string | ||
DA address (default "http://localhost:26658") | ||
-da_auth_token string | ||
auth token for the DA | ||
-da_namespace string | ||
DA namespace where the sequencer submits transactions | ||
-db_path string | ||
path to the database | ||
``` | ||
|
||
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`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Forced Inclusion | ||
|
||
Coming soon ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Sequencing | ||
|
||
## Rollkit prior to Sequencing | ||
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. | ||
|
||
### Sequencing Interface | ||
|
||
[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. | ||
|
||
```go | ||
SubmitRollupTransaction(rollupId, data) returns (error) | ||
|
||
GetNextBatch(rollupId, lastBatchHash, maxBytes) returns (batch, timestamp) | ||
|
||
VerifyBatch(rollupId, batchHash) returns (status) | ||
``` | ||
|
||
It mainly consists of: | ||
* `SubmitRollupTransaction` relays the rollup transactions from Rollkit rollup to the sequencing network | ||
* `GetNextBatch` returns the next batch of transactions along with a deterministic timestamp | ||
* `VerifyBatch` validates the sequenced batch | ||
|
||
### Sequencing Implementations | ||
|
||
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. | ||
|
||
The sequencing implementations that are currently work in progress: | ||
* [centralized-sequencer](https://github.com/rollkit/centralized-sequencer) | ||
* [based-sequencer](https://github.com/rollkit/based-sequencer) | ||
* [forced-inclusion-sequencer]() | ||
gupadhyaya marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* [astria-sequencer](https://github.com/rollkit/astria-sequencer) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.