Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
f722747
feat: add execution layer types crate
qj0r9j0vc2 Dec 29, 2025
45548b2
chore: document execution dependency constraints
qj0r9j0vc2 Dec 29, 2025
47d4d70
chore: add cargo deny check to CI
qj0r9j0vc2 Dec 29, 2025
2b601e7
chore: add dev dependencies for testing
qj0r9j0vc2 Dec 29, 2025
52d062d
feat: add core execution types
qj0r9j0vc2 Dec 29, 2025
f544090
feat: add ExecutionLayer API skeleton
qj0r9j0vc2 Dec 29, 2025
d4435fc
feat: add evm config and receipts modules
qj0r9j0vc2 Dec 29, 2025
8fab941
chore: merge feat/el-types
qj0r9j0vc2 Dec 29, 2025
967ef5d
chore: switch to alloy 0.8 for revm compat
qj0r9j0vc2 Dec 29, 2025
e49149f
fix: resolve revm/alloy API compatibility
qj0r9j0vc2 Dec 29, 2025
608674b
feat: add block_env_from_cut helper method
qj0r9j0vc2 Dec 29, 2025
af61c85
feat: add database and state management
qj0r9j0vc2 Dec 29, 2025
312017b
Merge pull request #17 from decipherhub/feat/el-evm
qj0r9j0vc2 Dec 29, 2025
7b62319
Merge branch 'feat/el-database' of github.com:decipherhub/cipherbft i…
qj0r9j0vc2 Dec 29, 2025
d6289f2
fix: remove duplicate Account export
qj0r9j0vc2 Dec 29, 2025
75f8132
Merge pull request #18 from decipherhub/feat/el-database
qj0r9j0vc2 Dec 29, 2025
fd0dfde
feat: implement execution engine
qj0r9j0vc2 Dec 29, 2025
b0dfa9e
feat: add signature recovery for transactions
qj0r9j0vc2 Dec 29, 2025
776b954
style: add blank line in database
qj0r9j0vc2 Dec 29, 2025
01de13e
test: add execution engine integration tests
qj0r9j0vc2 Dec 29, 2025
ab4e6e3
chore: add test dependencies for signing
qj0r9j0vc2 Dec 29, 2025
bb033c2
style: refactor EIP-1559 tx params to struct
qj0r9j0vc2 Dec 29, 2025
ce2e365
test: add Phase 4 integration tests
qj0r9j0vc2 Dec 29, 2025
a4e6b22
test: add state root determinism tests
qj0r9j0vc2 Dec 29, 2025
a6a2e7b
feat: add staking precompile
qj0r9j0vc2 Dec 30, 2025
c8fb1e4
Merge remote-tracking branch 'origin/feat/el-staking' into feat/el-in…
qj0r9j0vc2 Dec 30, 2025
9f503f2
feat: add staking precompile adapter
qj0r9j0vc2 Dec 30, 2025
358dc46
feat: add EVM precompile registration
qj0r9j0vc2 Dec 30, 2025
d73c75f
feat: integrate staking precompile in engine
qj0r9j0vc2 Dec 30, 2025
69c8a85
feat: add execution bridge for consensus
qj0r9j0vc2 Dec 30, 2025
63bf724
feat: wire cut execution in node event loop
qj0r9j0vc2 Dec 30, 2025
4458ab7
feat: add transaction validator to mempool
qj0r9j0vc2 Dec 30, 2025
1a845de
test: add staking precompile integration tests
qj0r9j0vc2 Dec 30, 2025
85754f4
chore: upgrade revm to 33.1.0 and resolve dependencies
qj0r9j0vc2 Dec 30, 2025
26761b4
feat: implement PrecompileProvider for revm 33
qj0r9j0vc2 Dec 30, 2025
5d507ab
refactor: update imports for revm 33 module structure
qj0r9j0vc2 Dec 30, 2025
1988a1a
wip: mark evm module as needing revm 33 refactor
qj0r9j0vc2 Dec 30, 2025
e47de9e
fix: update PrecompileProvider for revm 33 API
qj0r9j0vc2 Dec 30, 2025
6c59156
fix: update TxEnv fields for revm 33 API
qj0r9j0vc2 Dec 30, 2025
6049220
fix: update precompile types for revm 33
qj0r9j0vc2 Dec 30, 2025
ac3603e
fix: remove deprecated Header field
qj0r9j0vc2 Dec 30, 2025
9eed5bc
fix: simplify PrecompileProvider trait bounds
qj0r9j0vc2 Dec 30, 2025
7add6c9
feat: implement EVM builder and tx execution
qj0r9j0vc2 Dec 30, 2025
f5d6d0e
fix: persist state between transactions in revm33
qj0r9j0vc2 Dec 30, 2025
a2e03c8
fix: update staking precompile selectors for alloy
qj0r9j0vc2 Dec 30, 2025
df7c798
Merge pull request #21 from decipherhub/feat/bump-revm33
qj0r9j0vc2 Dec 30, 2025
1608789
chore: fix CI checks for license and advisory
qj0r9j0vc2 Dec 30, 2025
b5bc01b
style: apply rustfmt formatting
qj0r9j0vc2 Dec 30, 2025
3b2e476
fix: resolve clippy warnings
qj0r9j0vc2 Dec 30, 2025
b16f899
chore: switch to cargo-llvm-cov for faster coverage
qj0r9j0vc2 Dec 30, 2025
91c7947
refactor: make state root interval constant
qj0r9j0vc2 Dec 31, 2025
59737ac
docs: add execution layer design document
qj0r9j0vc2 Dec 31, 2025
c15f428
style: apply rustfmt formatting
qj0r9j0vc2 Dec 31, 2025
afc6caf
feat(storage): implement MDBX storage backend
dokpark21 Dec 28, 2025
da66573
feat(storage): enhance MDBX implementation with table definitions and…
dokpark21 Dec 29, 2025
bbf5722
feat(storage): update deny.toml to ignore RUSTSEC-2024-0436 advisory
dokpark21 Dec 29, 2025
f3c70ee
feat(storage): enhance MDBX implementation with full DclStore operati…
dokpark21 Jan 2, 2026
bb9b94d
refactor(storage): improve code readability by reordering use stateme…
dokpark21 Jan 2, 2026
1ff7a14
feat(storage): update .gitignore to include .claude and enhance MDBX …
dokpark21 Jan 2, 2026
8c47368
feat(storage): implement background pruning service for garbage colle…
dokpark21 Jan 2, 2026
95f6d58
feat(deny): add advisory for unmaintained bincode dependency (RUSTSEC…
dokpark21 Jan 8, 2026
b385cb6
feat(storage): implement database statistics retrieval from MDBX
dokpark21 Jan 8, 2026
f1ade41
fix: improve error handling and use parking_lot
qj0r9j0vc2 Jan 11, 2026
2a4d7b2
style: apply rustfmt formatting
qj0r9j0vc2 Jan 11, 2026
150696c
chore: allow bincode unmaintained advisory
qj0r9j0vc2 Jan 11, 2026
ae18ff3
Merge branch 'feat/el-integration' into kyrie/storage-layer
dokpark21 Jan 13, 2026
6927acd
feat(storage): add MDBX-based EVM and staking storage implementations
dokpark21 Jan 13, 2026
6595430
feat(storage): implement MDBX-based EVM and staking storage with comp…
dokpark21 Jan 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,31 +88,47 @@ jobs:
coverage:
name: Code Coverage
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview

- name: Cache dependencies
uses: Swatinem/rust-cache@v2

- name: Install cargo-tarpaulin
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2
with:
tool: cargo-tarpaulin
tool: cargo-llvm-cov

- name: Generate coverage
run: cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out xml
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./cobertura.xml
files: ./lcov.info
fail_ci_if_error: false
verbose: true

deny:
name: Cargo Deny
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run cargo deny
uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check
arguments: --all-features

build:
name: Build Release
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ criterion/

# Testnet data
testnet/

.serena
.claude
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ members = [
"crates/data-chain",
"crates/storage",
"crates/node",
"crates/execution",
]
resolver = "2"

Expand Down Expand Up @@ -44,6 +45,10 @@ bitvec = "1.0"

# Storage
rocksdb = { version = "0.21", default-features = false, features = ["lz4"] }
reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", default-features = false, features = ["mdbx"] }
reth-db-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-codecs = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-libmdbx = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", features = ["return-borrowed"] }

# Networking
futures = "0.3"
Expand Down
61 changes: 60 additions & 1 deletion crates/data-chain/src/worker/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,21 @@ pub trait WorkerNetwork: Send + Sync {
async fn request_batches(&self, peer: ValidatorId, digests: Vec<Hash>);
}

/// Transaction validator for mempool CheckTx
#[async_trait::async_trait]
pub trait TransactionValidator: Send + Sync {
/// Validate a transaction before accepting it into the mempool
///
/// # Arguments
///
/// * `tx` - Transaction bytes to validate
///
/// # Returns
///
/// Returns `Ok(())` if valid, or an error if validation fails.
async fn validate_transaction(&self, tx: &[u8]) -> Result<(), String>;
}

/// Handle for a spawned Worker task
pub struct WorkerHandle {
/// Join handle for the worker task
Expand Down Expand Up @@ -159,6 +174,8 @@ pub struct Worker {
network: Box<dyn WorkerNetwork>,
/// Optional persistent storage for batches
storage: Option<Arc<dyn BatchStore>>,
/// Optional transaction validator for CheckTx
validator: Option<Arc<dyn TransactionValidator>>,
/// Shutdown flag
shutdown: bool,
}
Expand All @@ -168,7 +185,7 @@ impl Worker {
///
/// Returns a handle that can be used to interact with the worker
pub fn spawn(config: WorkerConfig, network: Box<dyn WorkerNetwork>) -> WorkerHandle {
Self::spawn_with_storage(config, network, None)
Self::spawn_with_all(config, network, None, None)
}

/// Spawn a new Worker task with optional persistent storage
Expand All @@ -181,6 +198,22 @@ impl Worker {
config: WorkerConfig,
network: Box<dyn WorkerNetwork>,
storage: Option<Arc<dyn BatchStore>>,
) -> WorkerHandle {
Self::spawn_with_all(config, network, storage, None)
}

/// Spawn a new Worker task with all optional features
///
/// # Arguments
/// * `config` - Worker configuration
/// * `network` - Network interface for peer communication
/// * `storage` - Optional persistent batch storage
/// * `validator` - Optional transaction validator for CheckTx
pub fn spawn_with_all(
config: WorkerConfig,
network: Box<dyn WorkerNetwork>,
storage: Option<Arc<dyn BatchStore>>,
validator: Option<Arc<dyn TransactionValidator>>,
) -> WorkerHandle {
let (to_primary_tx, to_primary_rx) = mpsc::channel(1024);
let (from_primary_tx, from_primary_rx) = mpsc::channel(256);
Expand All @@ -198,6 +231,7 @@ impl Worker {
Some(peer_receiver),
network,
storage,
validator,
);
worker.run().await;
});
Expand Down Expand Up @@ -228,6 +262,7 @@ impl Worker {
None,
network,
None,
None,
)
}

Expand All @@ -248,10 +283,12 @@ impl Worker {
None,
network,
storage,
None,
)
}

/// Internal constructor with all options
#[allow(clippy::too_many_arguments)]
fn new_internal(
config: WorkerConfig,
to_primary: mpsc::Sender<WorkerToPrimary>,
Expand All @@ -260,6 +297,7 @@ impl Worker {
peer_receiver: Option<mpsc::Receiver<(ValidatorId, WorkerMessage)>>,
network: Box<dyn WorkerNetwork>,
storage: Option<Arc<dyn BatchStore>>,
validator: Option<Arc<dyn TransactionValidator>>,
) -> Self {
let state = WorkerState::new(config.validator_id, config.worker_id);
let batch_maker = BatchMaker::new(
Expand All @@ -283,6 +321,7 @@ impl Worker {
peer_receiver,
network,
storage,
validator,
shutdown: false,
}
}
Expand Down Expand Up @@ -364,6 +403,26 @@ impl Worker {
"Received transaction"
);

// Validate transaction if validator is available (CheckTx)
if let Some(ref validator) = self.validator {
match validator.validate_transaction(&tx).await {
Ok(()) => {
trace!(
worker_id = self.config.worker_id,
"Transaction validation passed"
);
}
Err(e) => {
debug!(
worker_id = self.config.worker_id,
error = %e,
"Transaction validation failed, rejecting"
);
return; // Reject invalid transaction
}
}
}

// Add to batch maker
if let Some(batch) = self.batch_maker.add_transaction(tx) {
self.process_batch(batch).await;
Expand Down
4 changes: 3 additions & 1 deletion crates/data-chain/src/worker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ pub mod state;
pub mod synchronizer;

pub use config::WorkerConfig;
pub use core::{Worker, WorkerCommand, WorkerEvent, WorkerHandle, WorkerNetwork};
pub use core::{
TransactionValidator, Worker, WorkerCommand, WorkerEvent, WorkerHandle, WorkerNetwork,
};
pub use state::WorkerState;
80 changes: 80 additions & 0 deletions crates/execution/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
[package]
name = "cipherbft-execution"
version = "0.1.0"
edition = "2021"
rust-version = "1.75"
license.workspace = true

[dependencies]
# Internal dependencies
cipherbft-types = { path = "../types" }
cipherbft-crypto = { path = "../crypto" }
cipherbft-storage = { path = "../storage", optional = true }

# EVM execution (revm 33.x uses modular crates)
revm = { version = "33.1.0", default-features = false, features = ["std", "secp256k1"] }
revm-primitives = "21"
revm-state = "8"

# Merkle trie for root computation (compatible with alloy 1.x)
alloy-trie = "0.9"

# Ethereum types (using Alloy v1.x for c-kzg 2.x compatibility with revm 33)
# Note: revm 33 uses c-kzg 2.x, requires alloy 1.x series
alloy-primitives = "1"
alloy-consensus = { version = "1", features = ["serde"] }
alloy-eips = "1"
alloy-rlp = "0.3"
alloy-sol-types = "1"

# Error handling
thiserror = "2"

# Derive macros (required by alloy dependencies)
derive_more = { version = "1.0", features = ["display", "from"] }

# Async runtime
tokio = { version = "1", features = ["full"] }
async-trait = "0.1"

# Concurrency
parking_lot = "0.12"

# Logging
tracing = "0.1"

# Serialization
serde = { version = "1", features = ["derive"] }
bincode = "1.3"

# Collections
lru = "0.12"
dashmap = "6"

# Encoding
hex = "0.4"

# c-kzg compatibility (force version 2.x for revm 33)
c-kzg = "2.0"

[dev-dependencies]
# Property-based testing
proptest = "1"

# Benchmarking
criterion = { version = "0.5", features = ["html_reports"] }

# Test utilities
tempfile = "3"

# Transaction signing for tests
alloy-signer = "1"
alloy-signer-local = "1"


[features]
default = []
mdbx = ["cipherbft-storage/mdbx", "cipherbft-storage"]

[lints.rust]
unsafe_code = "deny"
Loading