Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a47789e
Phase 2: add spec + roadmap design-of-record
KaiCode2 Jun 14, 2026
dc47336
Phase 2 (step 1): clock-agnostic SlotObservationTracker + FreshnessPa…
KaiCode2 Jun 14, 2026
bffdb15
Phase 2 (step 2): Validity/FreshnessRegistry, clocks, policies
KaiCode2 Jun 14, 2026
71f8aa5
Phase 2 (step 3): verify_slots, purge_account, fetcher + overlay seams
KaiCode2 Jun 14, 2026
4725020
Phase 2 (step 4): FreshnessController + SpeculativeSim optimistic loop
KaiCode2 Jun 14, 2026
320d148
Phase 2 (step 5): docs, offline example, README, re-exports, ROADMAP
KaiCode2 Jun 14, 2026
dc375f0
Phase 2 review: output field, controller cleanup, clock advance
KaiCode2 Jun 14, 2026
ed92b1c
Phase 2 review: make the test suite pin freshness contracts
KaiCode2 Jun 15, 2026
8ab2532
Phase 2: add freshness optimistic-loop benchmarks
KaiCode2 Jun 15, 2026
00653d2
Phase 2 review fixes (F1-F7) + in-progress engine/OSS-prep work
KaiCode2 Jun 15, 2026
81efa6b
Phase 3: state-update primitives (Pillar B.1) + relative RMW + audit …
KaiCode2 Jun 16, 2026
55acddf
Phase 3 fix-review: extend account_state-awareness to the snapshot + …
KaiCode2 Jun 16, 2026
d027bb3
Phase 2 review + round-2 fixes: validator trust contract + account-ax…
KaiCode2 Jun 16, 2026
286d5e4
Phase 4: add event-pipeline spec (Pillar B.2)
KaiCode2 Jun 16, 2026
c3efe40
Phase 4: acceptance tests (red contract) for the event pipeline
KaiCode2 Jun 16, 2026
52d956b
Phase 4 step 1: SlotMasked cold-aware masked-write vocabulary
KaiCode2 Jun 16, 2026
5f28db2
Phase 4 steps 2-5: events module, decoders, pipeline
KaiCode2 Jun 16, 2026
0749dfb
Phase 4: offline example, benchmark, docs (overseer deliverables)
KaiCode2 Jun 16, 2026
d7adfd2
Phase 4: differential ground-truth test for the event processor
KaiCode2 Jun 16, 2026
80eb91f
Merge pull request #3 from KaiCode2/phase-4-event-pipeline
KaiCode2 Jun 16, 2026
b95f5f8
Phase 5: spec (COW snapshots, Pillar A) + red acceptance contract
KaiCode2 Jun 16, 2026
3c407c6
Phase 5: copy-on-write snapshots (Pillar A) + overlay reuse
KaiCode2 Jun 16, 2026
776fe3e
Configurable EVM shared-memory pre-allocation (SharedMemoryCapacity)
KaiCode2 Jun 16, 2026
eb0bad6
Deflake the drop-abort freshness test with a deterministic gate
KaiCode2 Jun 17, 2026
85c3cf8
Phase 5 review fixes: prune stale COW code_by_hash + doc/test gaps
KaiCode2 Jun 17, 2026
0379c28
Merge pull request #6 from KaiCode2/fix-flaky-freshness-drop-abort
KaiCode2 Jun 17, 2026
a140fc6
Merge pull request #5 from KaiCode2/configurable-shared-memory
KaiCode2 Jun 17, 2026
6e317c5
address known issues
KaiCode2 Jun 17, 2026
149e4dd
Deflake into_optimistic freshness abort test
KaiCode2 Jun 17, 2026
0a2a9c9
Merge pull request #7 from KaiCode2/codex/phase-5-known-issues-top5
KaiCode2 Jun 17, 2026
66213c5
Merge pull request #4 from KaiCode2/phase-5-cow-snapshots
KaiCode2 Jun 17, 2026
7304697
Merge pull request #2 from KaiCode2/phase-3-state-updates
KaiCode2 Jun 17, 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
316 changes: 316 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

99 changes: 99 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Contributing to evm-fork-cache

Thanks for your interest in contributing! This crate is pre-1.0 and developed
against a phased [roadmap](docs/ROADMAP.md). Contributions — bug reports, tests,
docs, examples, and code — are welcome.

## Getting started

```sh
git clone https://github.com/KaiCode2/evm-fork-cache
cd evm-fork-cache
cargo test
```

The crate is a standalone workspace (it has its own `Cargo.lock`) and needs no
network for the default test suite: every integration test builds the cache over
a mocked provider. A handful of examples and benchmarks fork live mainnet state
behind an `RPC_URL` environment variable and are skipped when it is unset.

## The green bar

CI runs the checks below, and every commit on a feature branch is expected to
pass **all** of them. Run them locally before pushing:

```sh
cargo fmt --all --check
cargo clippy --all-targets --no-deps -- -D warnings
# The generic engine must also build and lint cleanly without the protocols feature:
cargo clippy --lib --no-default-features --no-deps -- -D warnings
cargo test
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps
```

A convenience one-liner:

```sh
cargo fmt --all --check && \
cargo clippy --all-targets --no-deps -- -D warnings && \
cargo clippy --lib --no-default-features --no-deps -- -D warnings && \
cargo test && \
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps
```

### MSRV

The minimum supported Rust version is **1.88** (edition 2024), enforced by a
dedicated CI job (`cargo check --lib --locked` on 1.88). Do not use std APIs
newer than 1.88 in the library. Dev-only code (examples, benches, tests) is not
MSRV-constrained.

### Feature configurations

The `protocols` feature (default on) gates DeFi protocol knowledge. The generic
simulation engine must compile and lint with `--no-default-features`. Any new
DeFi-specific surface (protocol storage layouts, pool injection) must be gated
behind `protocols`; generic machinery stays always-on. When you add a public
item behind `#[cfg(feature = "protocols")]`, also add
`#[cfg_attr(docsrs, doc(cfg(feature = "protocols")))]` so docs.rs renders the
feature badge.

## Tests, benchmarks, and examples

- **Tests** live in `tests/` (integration) and inline `#[cfg(test)]` modules
(unit). Shared offline helpers are in `tests/common/`. Keep tests deterministic
and network-free; use the stub `StorageBatchFetchFn` helpers for the freshness
paths. A test should pin a behavior, not merely exercise a code path.
- **Benchmarks** use Criterion and live in `benches/`. Offline benches must stay
reproducible; RPC-gated benches must `return` early (skip, not fail) when
`RPC_URL` is unset, so `cargo bench` is offline by default.
- **Examples** live in `examples/`. Offline examples share `examples/support/mock.rs`.
Each example should explain *what* it shows and *why* it matters, and be listed
in the README table with its network requirement and level.

## Documentation

- Document every public item. There is no `missing_docs` gate, but
`cargo doc` runs with `-D warnings`, so broken intra-doc links and malformed
doc comments fail CI.
- Functions returning `Result` should carry an `# Errors` section; functions that
can panic should carry a `# Panics` section.
- Prefer runnable doctests; mark network-dependent snippets `no_run` or `ignore`.

## Commits and branches

- Branch from `main` (or the active phase branch). Feature/phase branches follow
the `phase-N-<topic>` convention.
- Write focused commits with a clear subject line and a body explaining the *why*.
- Update `CHANGELOG.md` under `[Unreleased]` for any user-visible change.

## Reporting issues

Please include the crate version, Rust version, feature flags, and a minimal
reproduction. Known limitations are tracked in
[`docs/KNOWN_ISSUES.md`](docs/KNOWN_ISSUES.md) — check there first.

## License

By contributing, you agree that your contributions will be dual-licensed under
the MIT and Apache-2.0 licenses, as described in the [README](README.md#license).
1 change: 1 addition & 0 deletions Cargo.lock

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

27 changes: 27 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ readme = "README.md"
repository = "https://github.com/KaiCode2/evm-fork-cache"
documentation = "https://docs.rs/evm-fork-cache"

# Build docs.rs with every feature enabled so the `protocols` surface is
# documented, and pass `--cfg docsrs` so feature-gated items render an
# "available on crate feature X" badge (see `#![cfg_attr(docsrs, feature(doc_cfg))]`
# in lib.rs). `docsrs` is only set on docs.rs and never affects local/CI builds.
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

# Standalone workspace root: keeps this crate from being absorbed by any
# ancestor-directory workspace and gives it its own Cargo.lock.
[workspace]
Expand All @@ -30,6 +38,7 @@ alloy-eips = "1.0.38"
alloy-network = "1.0.38"
alloy-primitives = { version = "1.4", features = ["map"] }
alloy-provider = "1.0.38"
alloy-rlp = "0.3"
alloy-rpc-client = "1.0.38"
alloy-rpc-types-eth = "1.0.38"
alloy-sol-types = "1.4"
Expand Down Expand Up @@ -73,3 +82,21 @@ harness = false
[[bench]]
name = "simulation"
harness = false

[[bench]]
name = "freshness"
harness = false

[[bench]]
name = "state_update"
harness = false

[[bench]]
name = "event_pipeline"
harness = false

# RPC-gated real-contract benchmarks. Skipped (not failed) when RPC_URL is unset,
# so `cargo bench` stays offline by default.
[[bench]]
name = "rpc_mainnet"
harness = false
Loading
Loading