Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Default: repo owner owns everything
* @Troublor

# validator-core
/crates/validator-core/ @flyq
# stateless-core
/crates/stateless-core/ @flyq

# stateless-common (shared by both)
/crates/stateless-common/ @flyq @krabat-l
Expand Down
26 changes: 26 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
coverage:
range: 60..100
round: down
precision: 1
status:
project:
stateless-core:
threshold: 1%
patch:
stateless-core:
target: auto
threshold: 1%
base: auto
only_pulls: true

comment:
layout: "condensed_header, condensed_files, condensed_footer"
require_changes: true
hide_project_coverage: false

ignore:
- "bin/**/*"
- "crates/stateless-common/**/*"

fixes:
- "/home/runner/work/stateless-validator/stateless-validator/::"
61 changes: 61 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Coverage

on:
workflow_dispatch:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
stateless-core:
name: stateless-core coverage
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: llvm-tools-preview

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stateless-core unit tests don't use forge or anvil — Foundry is only needed by the debug-trace-server integration tests. This step adds unnecessary CI time and can be dropped.


- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- name: Generate coverage reports
run: scripts/coverage_stateless_core.sh

- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: stateless-core-coverage
path: target/coverage/stateless-core
if-no-files-found: error

- name: Record Rust version
run: echo "RUST=$(rustc --version)" >> "$GITHUB_ENV"

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
disable_search: true
fail_ci_if_error: false
files: target/coverage/stateless-core/lcov.info
flags: stateless-core
name: stateless-core
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: RUST
verbose: true
22 changes: 11 additions & 11 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ cargo build --release

# Test
cargo test # all tests
cargo test -p validator-core # core crate only
cargo test -p validator-core -- test_name # single test
cargo test -p stateless-core # core crate only
cargo test -p stateless-core -- test_name # single test

# Check compiler errors (preferred over clippy for quick checks)
cargo check
cargo check -p validator-core
cargo check -p stateless-core

# Lint (CI runs all of these)
cargo fmt --all --check
Expand All @@ -36,7 +36,7 @@ The project uses nightly `2026-02-03` toolchain (edition 2024, rust-version 1.95

| Crate | Path | Purpose |
| -------------------- | -------------------------- | ---------------------------------------------------------- |
| `validator-core` | `crates/validator-core` | Core validation logic, database, EVM execution, RPC client |
| `stateless-core` | `crates/stateless-core` | Core validation logic, database, EVM execution, RPC client |
| `stateless-common` | `crates/stateless-common` | Common utilities including logging configuration |
| `stateless-validator`| `bin/stateless-validator` | Main binary: chain sync, parallel validation workers |
| `debug-trace-server` | `bin/debug-trace-server` | Standalone RPC server for debug/trace methods |
Expand Down Expand Up @@ -103,13 +103,13 @@ The server includes an HTTP response cache (`quick_cache`) for pre-serialized JS

| File | Purpose |
| -------------------------------------------------- | ------------------------------------------------- |
| `crates/validator-core/src/validator_db.rs` | Central database with 10 redb tables |
| `crates/validator-core/src/executor.rs` | Block validation and EVM replay |
| `crates/validator-core/src/tracing_executor.rs` | Block tracing with TracerKind deduplication |
| `crates/validator-core/src/database.rs` | WitnessDatabase implementing `revm::DatabaseRef` |
| `crates/validator-core/src/rpc_client.rs` | RPC client for blocks, witnesses, and bytecode |
| `crates/validator-core/src/chain_sync.rs` | Chain synchronization and remote chain tracking |
| `crates/validator-core/src/withdrawals.rs` | Withdrawal validation and MPT witness handling |
| `crates/stateless-core/src/validator_db.rs` | Central database with 10 redb tables |
| `crates/stateless-core/src/executor.rs` | Block validation and EVM replay |
| `crates/stateless-core/src/tracing_executor.rs` | Block tracing with TracerKind deduplication |
| `crates/stateless-core/src/database.rs` | WitnessDatabase implementing `revm::DatabaseRef` |
| `crates/stateless-core/src/rpc_client.rs` | RPC client for blocks, witnesses, and bytecode |
| `crates/stateless-core/src/chain_sync.rs` | Chain synchronization and remote chain tracking |
| `crates/stateless-core/src/withdrawals.rs` | Withdrawal validation and MPT witness handling |
| `bin/stateless-validator/src/main.rs` | CLI, chain sync loop, parallel validation workers |
| `bin/debug-trace-server/src/rpc_service.rs` | RPC method definitions and handlers |
| `bin/debug-trace-server/src/data_provider.rs` | Block data fetching with single-flight coalescing |
Expand Down
100 changes: 50 additions & 50 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = [
"bin/debug-trace-server",
"bin/stateless-validator",
"crates/stateless-common",
"crates/validator-core",
"crates/stateless-core",
]
resolver = "2"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This validator enables efficient block verification using cryptographic witness
## Project Structure

- **`bin/stateless-validator`**: Main validator binary that coordinates chain synchronization and manages validation workers
- **`crates/validator-core`**: Core library providing validation logic, database operations, and EVM execution
- **`crates/stateless-core`**: Core library providing validation logic, database operations, and EVM execution
- **`test_data/`**: Integration test data including blocks, witnesses, and contract bytecode

## Quick Start
Expand Down
12 changes: 8 additions & 4 deletions bin/debug-trace-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
[package]
name = "debug-trace-server"
version = "0.1.0"
edition = "2021"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
exclude.workspace = true

[dependencies]

Expand Down Expand Up @@ -44,9 +48,9 @@ tower = "0.4"
# Logging and metrics
tracing.workspace = true

# Reuse validator-core
# Reuse stateless-core
stateless-common = { path = "../../crates/stateless-common" }
validator-core = { path = "../../crates/validator-core" }
stateless-core = { path = "../../crates/stateless-core" }

[dev-dependencies]
alloy-consensus.workspace = true
Expand Down
Loading
Loading