Skip to content

Commit 8233c65

Browse files
committed
restructure repo
1 parent b26f99e commit 8233c65

23 files changed

Lines changed: 419 additions & 185 deletions

Cargo.toml

Lines changed: 48 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
[workspace]
22
resolver = "2"
3-
members = ["crates/rollkit"]
3+
members = [
4+
"bin/lumen",
5+
"crates/common",
6+
"crates/node",
7+
"crates/rollkit",
8+
"crates/e2e-tests",
9+
]
410

511
[workspace.package]
612
version = "0.1.0"
@@ -13,52 +19,52 @@ authors = ["Rollkit Contributors"]
1319

1420
[workspace.dependencies]
1521
# Reth dependencies - Using the latest stable versions
16-
reth = { version = "1.1.3", default-features = false }
17-
reth-cli-util = { version = "1.1.3", default-features = false }
18-
reth-ethereum-cli = { version = "1.1.3", default-features = false }
19-
reth-ethereum = { version = "1.1.3", default-features = false }
20-
reth-node-builder = { version = "1.1.3", default-features = false }
21-
reth-chainspec = { version = "1.1.3", default-features = false }
22-
reth-ethereum-payload-builder = { version = "1.1.3", default-features = false }
23-
reth-payload-primitives = { version = "1.1.3", default-features = false }
24-
reth-primitives = { version = "1.1.3", default-features = false }
25-
reth-primitives-traits = { version = "1.1.3", default-features = false }
26-
reth-node-api = { version = "1.1.3", default-features = false }
27-
reth-provider = { version = "1.1.3", default-features = false }
28-
reth-payload-builder = { version = "1.1.3", default-features = false }
29-
reth-basic-payload-builder = { version = "1.1.3", default-features = false }
30-
reth-engine-local = { version = "1.1.3", default-features = false }
31-
reth-revm = { version = "1.1.3", default-features = false }
32-
reth-trie-db = { version = "1.1.3", default-features = false }
33-
reth-node-types = { version = "1.1.3", default-features = false }
34-
reth-payload-builder-primitives = { version = "1.1.3", default-features = false }
35-
reth-execution-types = { version = "1.1.3", default-features = false }
36-
reth-evm-ethereum = { version = "1.1.3", default-features = false }
37-
reth-evm = { version = "1.1.3", default-features = false }
38-
reth-errors = { version = "1.1.3", default-features = false }
39-
reth-node-core = { version = "1.1.3", default-features = false }
40-
reth-rpc-builder = { version = "1.1.3", default-features = false }
41-
reth-rpc-api = { version = "1.1.3", default-features = false }
42-
reth-rpc-engine-api = { version = "1.1.3", default-features = false }
43-
reth-engine-primitives = { version = "1.1.3", default-features = false }
44-
reth-ethereum-primitives = { version = "1.1.3", default-features = false }
22+
reth = { version = "1.1", default-features = false }
23+
reth-cli-util = { version = "1.1", default-features = false }
24+
reth-ethereum-cli = { version = "1.1", default-features = false }
25+
reth-ethereum = { version = "1.1", default-features = false }
26+
reth-node-builder = { version = "1.1", default-features = false }
27+
reth-chainspec = { version = "1.1", default-features = false }
28+
reth-ethereum-payload-builder = { version = "1.1", default-features = false }
29+
reth-payload-primitives = { version = "1.1", default-features = false }
30+
reth-primitives = { version = "1.1", default-features = false }
31+
reth-primitives-traits = { version = "1.1", default-features = false }
32+
reth-node-api = { version = "1.1", default-features = false }
33+
reth-provider = { version = "1.1", default-features = false }
34+
reth-payload-builder = { version = "1.1", default-features = false }
35+
reth-basic-payload-builder = { version = "1.1", default-features = false }
36+
reth-engine-local = { version = "1.1", default-features = false }
37+
reth-revm = { version = "1.1", default-features = false }
38+
reth-trie-db = { version = "1.1", default-features = false }
39+
reth-node-types = { version = "1.1", default-features = false }
40+
reth-payload-builder-primitives = { version = "1.1", default-features = false }
41+
reth-execution-types = { version = "1.1", default-features = false }
42+
reth-evm-ethereum = { version = "1.1", default-features = false }
43+
reth-evm = { version = "1.1", default-features = false }
44+
reth-errors = { version = "1.1", default-features = false }
45+
reth-node-core = { version = "1.1", default-features = false }
46+
reth-rpc-builder = { version = "1.1", default-features = false }
47+
reth-rpc-api = { version = "1.1", default-features = false }
48+
reth-rpc-engine-api = { version = "1.1", default-features = false }
49+
reth-engine-primitives = { version = "1.1", default-features = false }
50+
reth-ethereum-primitives = { version = "1.1", default-features = false }
4551

4652
# Test dependencies
47-
reth-testing-utils = { version = "1.1.3", default-features = false }
48-
reth-db = { version = "1.1.3", default-features = false }
49-
reth-transaction-pool = { version = "1.1.3", default-features = false }
50-
reth-consensus = { version = "1.1.3", default-features = false }
51-
reth-tasks = { version = "1.1.3", default-features = false }
52-
reth-tracing = { version = "1.1.3", default-features = false }
53+
reth-testing-utils = { version = "1.1", default-features = false }
54+
reth-db = { version = "1.1", default-features = false }
55+
reth-transaction-pool = { version = "1.1", default-features = false }
56+
reth-consensus = { version = "1.1", default-features = false }
57+
reth-tasks = { version = "1.1", default-features = false }
58+
reth-tracing = { version = "1.1", default-features = false }
5359

5460
# Alloy dependencies
55-
alloy-rpc-types = { version = "0.7.3", default-features = false }
56-
alloy-rpc-types-engine = { version = "0.7.3", default-features = false }
61+
alloy-rpc-types = { version = "0.7", default-features = false }
62+
alloy-rpc-types-engine = { version = "0.7", default-features = false }
5763
alloy-primitives = { version = "0.8", default-features = false }
58-
alloy-eips = { version = "0.7.3", default-features = false }
59-
alloy-consensus = { version = "0.7.3", default-features = false }
64+
alloy-eips = { version = "0.7", default-features = false }
65+
alloy-consensus = { version = "0.7", default-features = false }
6066
alloy-rlp = { version = "0.3", default-features = false }
61-
alloy-genesis = { version = "0.7.3", default-features = false }
67+
alloy-genesis = { version = "0.7", default-features = false }
6268

6369
# Core dependencies
6470
eyre = "0.6"
@@ -175,4 +181,4 @@ too_long_first_doc_paragraph = "allow"
175181
[profile.release]
176182
opt-level = 3
177183
lto = "thin"
178-
strip = "debuginfo"
184+
strip = "debuginfo"

Makefile

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Build configuration
44
CARGO = cargo
5-
BINARY_NAME = rollkit-reth
5+
BINARY_NAME = lumen
66
TARGET_DIR = target
77

88
# Default target
@@ -15,35 +15,35 @@ help:
1515

1616
##@ Building
1717

18-
## build: Build the rollkit-reth binary in release mode
18+
## build: Build the lumen binary in release mode
1919
build:
2020
$(CARGO) build --release --bin $(BINARY_NAME)
2121

22-
## build-dev: Build the rollkit-reth binary in debug mode
22+
## build-dev: Build the lumen binary in debug mode
2323
build-dev:
2424
$(CARGO) build --bin $(BINARY_NAME)
2525

2626
##@ Testing
2727

2828
## test: Run all tests
2929
test:
30-
$(CARGO) test --all
30+
$(CARGO) test --workspace
3131

3232
## test-verbose: Run all tests with verbose output
3333
test-verbose:
34-
$(CARGO) test --all -- --nocapture
34+
$(CARGO) test --workspace -- --nocapture
3535

3636
## test-unit: Run unit tests only
3737
test-unit:
3838
$(CARGO) test --lib
3939

4040
## test-integration: Run integration tests only
4141
test-integration:
42-
$(CARGO) test --test '*'
42+
$(CARGO) test -p lumen-e2e-tests
4343

4444
##@ Development
4545

46-
## run: Run the rollkit-reth node with default settings
46+
## run: Run the lumen node with default settings
4747
run: build-dev
4848
./$(TARGET_DIR)/debug/$(BINARY_NAME) node
4949

@@ -65,7 +65,7 @@ lint:
6565

6666
## check: Run cargo check
6767
check:
68-
$(CARGO) check --all
68+
$(CARGO) check --workspace
6969

7070
##@ Maintenance
7171

@@ -89,4 +89,22 @@ doc:
8989

9090
## doc-all: Build documentation including dependencies
9191
doc-all:
92-
$(CARGO) doc --open
92+
$(CARGO) doc --open
93+
94+
##@ Workspace Management
95+
96+
## build-all: Build all workspace members
97+
build-all:
98+
$(CARGO) build --workspace --release
99+
100+
## test-node: Test only the node crate
101+
test-node:
102+
$(CARGO) test -p lumen-node
103+
104+
## test-rollkit: Test only the rollkit crate
105+
test-rollkit:
106+
$(CARGO) test -p lumen-rollkit
107+
108+
## test-common: Test only the common crate
109+
test-common:
110+
$(CARGO) test -p lumen-common

README.md

Lines changed: 55 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ make test
5050

5151
## Usage
5252

53-
### Running the Rollkit-Reth Node
53+
### Running the Lumen Node
5454

5555
Basic usage:
5656
```bash
57-
./target/release/rollkit-reth node
57+
./target/release/lumen node
5858
```
5959

6060
With custom configuration:
6161
```bash
62-
./target/release/rollkit-reth node \
62+
./target/release/lumen node \
6363
--chain <CHAIN_SPEC> \
6464
--datadir <DATA_DIR> \
6565
--http \
@@ -96,20 +96,40 @@ When using the Engine API, you can include transactions in the payload attribute
9696

9797
## Architecture
9898

99+
### Modular Design
100+
101+
Lumen follows a modular architecture similar to Odyssey, with clear separation of concerns:
102+
103+
- **`bin/lumen`**: The main executable binary
104+
- **`crates/common`**: Shared utilities and constants used across all crates
105+
- **`crates/node`**: Core node implementation including the payload builder
106+
- **`crates/rollkit`**: Rollkit-specific types and integration logic
107+
- **`crates/e2e-tests`**: Comprehensive end-to-end tests
108+
109+
This modular design allows for:
110+
- Better code organization and maintainability
111+
- Easier testing of individual components
112+
- Clear separation between Rollkit-specific and general node logic
113+
- Reusable components for other projects
114+
99115
### Components
100116

101-
1. **RollkitPayloadBuilder** (`crates/rollkit/src/builder.rs`)
117+
1. **RollkitPayloadBuilder** (`crates/node/src/builder.rs`)
102118
- Handles payload construction with transactions from Engine API
103119
- Manages state execution and block assembly
104120

105-
2. **RollkitEngineTypes** (`crates/rollkit/bin/src/main.rs`)
121+
2. **RollkitEngineTypes** (`bin/lumen/src/main.rs`)
106122
- Custom Engine API types supporting transaction attributes
107123
- Payload validation and attribute processing
108124

109-
3. **RollkitEngineValidator** (`crates/rollkit/bin/src/main.rs`)
125+
3. **RollkitEngineValidator** (`bin/lumen/src/main.rs`)
110126
- Modified validator for Rollkit-specific requirements
111127
- Bypasses certain validations while maintaining security
112128

129+
4. **Rollkit Types** (`crates/rollkit/src/types.rs`)
130+
- Rollkit-specific payload attributes and types
131+
- Transaction encoding/decoding utilities
132+
113133
### Transaction Flow
114134

115135
1. Rollkit submits transactions via Engine API payload attributes
@@ -140,18 +160,35 @@ All standard Reth configuration options are supported. Key options for Rollkit i
140160

141161
```
142162
lumen/
163+
├── bin/
164+
│ └── lumen/ # Main binary
165+
│ ├── Cargo.toml
166+
│ └── src/
167+
│ └── main.rs # Binary with Engine API integration
143168
├── crates/
144-
│ └── rollkit/
145-
│ ├── src/
146-
│ │ ├── lib.rs # Library root
147-
│ │ ├── builder.rs # Payload builder implementation
148-
│ │ ├── config.rs # Configuration types
149-
│ │ ├── types.rs # Rollkit-specific types
150-
│ │ └── tests.rs # Unit tests
151-
│ ├── tests/ # Integration tests
152-
│ └── bin/
153-
│ └── src/
154-
│ └── main.rs # Binary with Engine API integration
169+
│ ├── common/ # Shared utilities and constants
170+
│ │ ├── Cargo.toml
171+
│ │ └── src/
172+
│ │ ├── lib.rs
173+
│ │ └── constants.rs
174+
│ ├── node/ # Core node implementation
175+
│ │ ├── Cargo.toml
176+
│ │ └── src/
177+
│ │ ├── lib.rs
178+
│ │ ├── builder.rs # Payload builder implementation
179+
│ │ └── config.rs # Configuration types
180+
│ ├── rollkit/ # Rollkit-specific types
181+
│ │ ├── Cargo.toml
182+
│ │ └── src/
183+
│ │ ├── lib.rs
184+
│ │ └── types.rs # Rollkit payload attributes
185+
│ └── e2e-tests/ # End-to-end tests
186+
│ ├── Cargo.toml
187+
│ └── src/
188+
│ ├── lib.rs
189+
│ └── *.rs # Test files
190+
├── etc/ # Configuration files
191+
│ └── lumen-genesis.json # Genesis configuration
155192
├── Cargo.toml # Workspace configuration
156193
├── Makefile # Build automation
157194
└── README.md # This file
@@ -200,7 +237,7 @@ make run-dev
200237

201238
Enable detailed logging:
202239
```bash
203-
RUST_LOG=debug,rollkit=trace ./target/release/rollkit-reth node
240+
RUST_LOG=debug,lumen=trace ./target/release/lumen node
204241
```
205242

206243
## Contributing

bin/lumen/Cargo.toml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
[package]
2+
name = "lumen"
3+
version.workspace = true
4+
edition.workspace = true
5+
rust-version.workspace = true
6+
license.workspace = true
7+
homepage.workspace = true
8+
repository.workspace = true
9+
description = "Lumen node binary"
10+
11+
[[bin]]
12+
name = "lumen"
13+
path = "src/main.rs"
14+
15+
[dependencies]
16+
# Core lumen crates
17+
lumen-node = { path = "../../crates/node" }
18+
lumen-common = { path = "../../crates/common" }
19+
20+
# Reth CLI and core dependencies
21+
reth-cli-util.workspace = true
22+
reth-ethereum-cli.workspace = true
23+
reth-ethereum = { workspace = true, features = ["node", "cli", "pool"] }
24+
reth-node-builder.workspace = true
25+
reth-chainspec.workspace = true
26+
27+
# Core dependencies
28+
eyre.workspace = true
29+
tracing.workspace = true
30+
tokio = { workspace = true, features = ["full"] }
31+
clap = { workspace = true, features = ["derive", "env"] }
32+
33+
[lints]
34+
workspace = true
35+
36+
[features]
37+
default = ["jemalloc"]
38+
39+
jemalloc = ["reth-cli-util/jemalloc", "reth-ethereum-cli/jemalloc"]
40+
jemalloc-prof = ["reth-cli-util/jemalloc-prof"]
41+
tracy-allocator = ["reth-cli-util/tracy-allocator"]
42+
43+
asm-keccak = ["reth-ethereum-cli/asm-keccak"]
44+
45+
dev = ["reth-ethereum-cli/dev", "reth-ethereum/arbitrary"]
46+
47+
min-error-logs = ["tracing/release_max_level_error"]
48+
min-warn-logs = ["tracing/release_max_level_warn"]
49+
min-info-logs = ["tracing/release_max_level_info"]
50+
min-debug-logs = ["tracing/release_max_level_debug"]
51+
min-trace-logs = ["tracing/release_max_level_trace"]
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ use reth_payload_builder::{EthBuiltPayload, EthPayloadBuilderAttributes, Payload
4848
use reth_provider::HeaderProvider;
4949
use reth_revm::cached::CachedReads;
5050
use reth_trie_db::MerklePatriciaTrie;
51-
use rollkit_reth::{
52-
PayloadAttributesError, RollkitPayloadAttributes, RollkitPayloadBuilder,
53-
RollkitPayloadBuilderConfig,
54-
};
51+
use lumen_node::{RollkitPayloadBuilder, RollkitPayloadBuilderConfig};
52+
use lumen_rollkit::{PayloadAttributesError, RollkitPayloadAttributes};
5553
use serde::{Deserialize, Serialize};
5654
use std::sync::Arc;
5755
use thiserror::Error;

0 commit comments

Comments
 (0)