-
Notifications
You must be signed in to change notification settings - Fork 1
feat: integrate sequencer with node #65
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
Merged
Changes from all commits
Commits
Show all changes
68 commits
Select commit
Hold shift + click to select a range
a04f6b7
test: move calldata to files
greged93 4c328cc
feat: batch header decoding
greged93 53af94f
feat: improve codec interface
greged93 c17d65e
chore: manifests fixes
greged93 a2929e0
feat: revert some codec changes
greged93 05cc350
feat: wip derivation pipeline
greged93 54a557c
feat: batch header v7
greged93 a5e31c9
feat: add batch abstraction
greged93 57c0992
feat: basic derivation pipeline
greged93 2edae45
feat: implement batch data hash
greged93 113f18e
feat: move PayloadData
greged93 9186662
feat: improve batch data hash computation
greged93 42bbace
test: derivation
greged93 50962ca
chore: cleaning
greged93 2aa6b85
fix: lints
greged93 32e56fc
fix: lints
greged93 2f56e24
fix: skip wasm for derivation pipeline
greged93 fb85ecf
fix: data hash computation for batch
greged93 6341957
Merge branch 'main' into feat/derivation-pipeline
greged93 23be55b
fix: lint
greged93 df9d787
fix: lint
greged93 4bba46d
fix: lints
greged93 485f66c
fix: answer comments
greged93 b1b223e
fix: lints
greged93 1cf831a
feat: wip
greged93 f1de162
feat: changes to the data model
greged93 86f3880
fix: codec issue
greged93 a8f18d9
feat: modify derivation pipeline to fetch blob
greged93 d5c7313
test: move test data to file
greged93 3a6da41
fix: lints
greged93 eeb7a63
fix: answer comments
greged93 52f35cf
test: fix migration
greged93 0e5fa79
Merge branch 'main' into feat/integrate-batch-changes
greged93 72831db
fix: comments
greged93 82cbcac
feat: providers crate
greged93 27c0c59
feat: l1 providers crate
greged93 e5be688
feat: l1 provider implementation
greged93 b4188fa
feat: l1 message provider
greged93 59c1603
feat: pipeline modifications
greged93 58c1e8e
fix: avoid iterating the cache
greged93 b47d913
chore: simplify derivation pipeline interface
greged93 1ceab4f
fix: lints
greged93 1fe124e
fix: rebasing
greged93 aca4f24
fix: answer comments
greged93 2778837
feat: add sequencer
frisitano 0a55743
sequencer initial implementation
frisitano 5b73485
Merge branch 'main' into feat/sequencer
frisitano 1ffad5f
sequencer implementation
frisitano 0625ba0
sequencer implementation
frisitano 57be97d
Merge branch 'main' into feat/sequencer
frisitano 1655bee
refactor sequencer provider
frisitano 906dac6
sequencer implementation
frisitano 6b42b1b
lint
frisitano cde0bef
lint deps
frisitano c4a7453
address comments
frisitano f21edce
feat: sequencer integration
frisitano 5c3858d
Merge branch 'main' into feat/sequencer-rnm-integration
frisitano aef55ba
remove redundant file
frisitano 47337da
add std feature for scroll-reth-primitives
frisitano dee0907
comments and clean up
frisitano dd0fb48
feat: L1 message delay
frisitano 74feda5
feat: integrate sequencer with node
frisitano 08f9173
Merge branch 'main' into feat/integrate-sequencer-with-node
frisitano 30d8e4b
merge conflict resoltuion
frisitano 7932b42
chore: introduce README and repoint deps
frisitano 431cf03
Merge branch 'main' into feat/integrate-sequencer-with-node
frisitano 322e07e
address feedback
frisitano 51abcb2
lints
frisitano 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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1,159 @@ | ||
# rollup-node | ||
# Scroll Rollup Node Workspace | ||
|
||
[](https://github.com/scroll-tech/rollup-node/actions/workflows/test.yaml) | ||
[](https://github.com/scroll-tech/rollup-node/actions/workflows/lint.yaml) | ||
 | ||
 | ||
|
||
## Overview | ||
|
||
This repository is a modular Rust workspace for the Scroll rollup node. It is designed for extensibility, maintainability, and ease of contribution. It consists of multiple internal crates (libraries) and a main binary crate, organized for clear separation of concerns and reusability. | ||
|
||
## Directory Structure | ||
|
||
``` | ||
. | ||
├── bin/ | ||
│ └── rollup/ # Main binary crate (the node) | ||
│ ├── src/ | ||
│ └── assets/ | ||
├── crates/ # Internal library crates | ||
│ ├── codec/ | ||
│ ├── database/ | ||
│ │ ├── db/ | ||
│ │ └── migration/ | ||
│ ├── derivation-pipeline/ | ||
│ ├── engine/ | ||
│ ├── indexer/ | ||
│ ├── l1/ | ||
│ ├── network/ | ||
│ ├── node/ | ||
│ ├── primitives/ | ||
│ ├── providers/ | ||
│ ├── scroll-wire/ | ||
│ ├── sequencer/ | ||
│ └── watcher/ | ||
├── Cargo.toml # Workspace manifest | ||
└── ... | ||
``` | ||
|
||
## Crate Descriptions | ||
|
||
- **bin/rollup/**: The main binary crate. This is the entry point for running the rollup node. | ||
- **crates/codec/**: Implements encoding/decoding logic for rollup data and payloads. | ||
- **crates/database/db/**: Database abstraction and storage logic for batches, blocks, and messages. | ||
- **crates/database/migration/**: Database schema migrations using SeaORM. | ||
- **crates/derivation-pipeline/**: Stateless pipeline for transforming batches into block-building payloads. | ||
- **crates/engine/**: Core engine logic for block execution, fork choice, and payload management. | ||
- **crates/indexer/**: Indexes L1 and L2 data for efficient querying and notification. | ||
- **crates/l1/**: Primitives and ABI bindings for L1 contracts and messages. | ||
- **crates/network/**: P2P networking stack for node communication. | ||
- **crates/node/**: Node manager and orchestration logic. | ||
- **crates/primitives/**: Shared primitive types (blocks, batches, attributes, etc.). | ||
- **crates/providers/**: Abstractions for data providers (L1, beacon, block, etc.). | ||
- **crates/scroll-wire/**: Wire protocol definitions for Scroll-specific networking. | ||
- **crates/sequencer/**: Sequencer logic for ordering and batching transactions. | ||
- **crates/watcher/**: Monitors L1 chain state and handles reorgs and notifications. | ||
|
||
## Building the Project | ||
|
||
Ensure you have [Rust](https://www.rust-lang.org/tools/install) installed. | ||
|
||
To build the main binary: | ||
|
||
```sh | ||
cargo build --bin rollup-node | ||
``` | ||
|
||
Or, from the binary crate directory: | ||
|
||
```sh | ||
cd bin/rollup | ||
cargo build | ||
``` | ||
|
||
## Running the Node | ||
|
||
After building, run the node with: | ||
|
||
```sh | ||
cargo run --workspace --bin rollup-node -- [ARGS] | ||
``` | ||
|
||
Replace `[ARGS]` with any runtime arguments you require. | ||
|
||
## Running Tests | ||
|
||
To run all tests across the workspace: | ||
|
||
```sh | ||
make test | ||
``` | ||
|
||
To test a specific crate: | ||
|
||
```sh | ||
cargo test -p <crate-name> | ||
``` | ||
|
||
## Running Lints | ||
|
||
To run all lints across the workspace: | ||
|
||
```sh | ||
make lint | ||
``` | ||
|
||
## Building a Release Binary | ||
|
||
For optimized production builds: | ||
|
||
```sh | ||
cargo build --release --bin rollup-node | ||
``` | ||
|
||
The release binary will be located at `target/release/rollup-node`. | ||
|
||
## Running a Sequencer Node | ||
|
||
To run a sequencer node you should build the binary in release mode using the instructions defined above. | ||
|
||
Then, you can run the sequencer node with the following command: | ||
|
||
```sh | ||
./target/release/rollup-node node --chain dev -d --scroll-sequencer-enabled --http --http.api admin,debug,eth,net,trace,txpool,web3,rpc,reth,ots,flashbots,miner,mev | ||
``` | ||
|
||
This will start a dev node in sequencer mode with all rpc apis enabled. You can adjust the `--http.api` flag to include or exclude specific APIs as needed. | ||
|
||
The chain will be configured with a genesis that funds 20 addresses derived from the mnemonic: | ||
``` | ||
test test test test test test test test test test test junk | ||
``` | ||
|
||
|
||
A list of sequencer specific configuration options can be seen below: | ||
|
||
```sh | ||
--scroll-sequencer-enabled | ||
Enable the scroll block sequencer | ||
--scroll-block-time <SCROLL_BLOCK_TIME> | ||
The block time for the sequencer [default: 2000] | ||
--payload-building-duration <PAYLOAD_BUILDING_DURATION> | ||
The payload building duration for the sequencer (milliseconds) [default: 500] | ||
--max-l1-messages-per-block <MAX_L1_MESSAGES_PER_BLOCK> | ||
The max L1 messages per block for the sequencer [default: 4] | ||
--fee-recipient <FEE_RECIPIENT> | ||
The fee recipient for the sequencer [default: 0x5300000000000000000000000000000000000005] | ||
``` | ||
|
||
## Contributing | ||
|
||
- Fork and clone the repository. | ||
- Use `make pr` to ensure code quality. | ||
- Submit pull requests with clear descriptions. | ||
- See each crate's README or source for more details on its purpose and usage. | ||
|
||
--- | ||
|
||
For more details, see the documentation in each crate or open an issue if you have questions! |
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
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
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.