Skip to content

release: v0.1.0 final polish — API freeze, doc truth, offline benches, live-verified - #34

Merged
KaiCode2 merged 14 commits into
mainfrom
release/v0.1.0-polish
Jul 8, 2026
Merged

release: v0.1.0 final polish — API freeze, doc truth, offline benches, live-verified#34
KaiCode2 merged 14 commits into
mainfrom
release/v0.1.0-polish

Conversation

@KaiCode2

@KaiCode2 KaiCode2 commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Closes out every finding from the full pre-release review (docs, API surface, tests, benches, release mechanics) so v0.1.0 can be re-tagged and published from a state where nothing cheap-to-fix-now becomes breaking-later.

API surface (free today, breaking once a downstream exists)

  • sol! bindings privatized — module-scope sol! generates pub items, so ~30 internal ABI types (quote-call structs, event decls, factory events) rendered on docs.rs as public API. Each block now lives in a crate-internal mod abi (the existing pancake_v3/solidly_events idiom); the RPC-parity/WS tests that borrowed them declare their own local ground-truth ABI.
  • Public deps re-exportedpub use evm_fork_cache; + pub use alloy_primitives; at the root, with the 0.x lockstep policy documented: downstream no longer hand-pins matching versions to name EvmCache or Address.
  • docs.rs feature badgesrustdoc-args = ["--cfg", "docsrs"] + feature(doc_cfg) (post-1.92 auto-cfg): gated modules/items now render "Available on crate feature …" badges.
  • #[non_exhaustive] gaps closed on the cold_start/bytecode/state mirror structs (with documented constructors — ColdStartPlan already had a pending upstream probe_roots field waiting to break planner authors), BytecodeTemplateError joins the other error enums, SlotDelta documents why it deliberately stays exhaustive.
  • Small doc-truth on API: find_many's doc-merge artifact (stale block was the rustdoc summary), simulate_swap's stale from = ZERO claim, V3StorageLayout/SolidlyStorageLayout exported at the root unconditionally.

Shipped-docs truth pass

  • The last merge train outran four shipped docs: CHANGELOG [0.1.0], README (intro + protocol table), protocol-support-matrix.md, and trace-backed-sync.md all still said Balancer Swap → resync (pre-Event-source Balancer V2 swaps #33) — now they describe the event-sourced exact cash writes, and the changelog gains the omitted features (Event-source Balancer V2 swaps #33 event-sourcing, perf(cold-start): verify-only fast path for Curve + Balancer (+ optional Curve code seed) #31 verify-only fast path, CurveMetadata::with_code_seed, Balancer/Curve cold_start_many bundling, the new stateDiff parity suites).
  • Ghost mechanism removed: README/pool-discovery.md/CHANGELOG still described the MetaRegistry/ViewCall discovery mechanism dropped in 3a197f3.
  • Guides: writing-an-adapter table gains the missing pool_factories/code_seeds rows ("six defaulted" → nine), high-performance-bootstrap-defaults past-tenses its superseded narrative and marks checklist item 1 done, benchmarks.md no longer promises HTML reports this build can't produce (no plotters backend), iteration-count and CU figures are consistent everywhere (one auditable derivation: 7,674 × 17 CU).

README storefront

Badges (crates.io / docs.rs / CI / license / MSRV), an Installation section (cargo add, feature trimming, MSRV 1.88, re-export policy), a 12-example index with a zero-setup "start here" (custom_adapter), the Slipstream quoting caveat surfaced beside the Solidly one, and the quickstart now compiles as a doctest (cfg(doctest) README include; rust,ignorerust,no_run).

Tests & benches

  • Exact-boundary unit tests for the new packed-word arithmetic: V3 gross/net at u128::MAX/i128 limits, Balancer cash at the 2^112 field edges — pinning checked-None (resync) semantics, never wrap/saturate/carry into a co-tenant field.
  • Solidly V2 joins the AmmSyncEngine coverage (was the only protocol with no engine/WS test): a Sync applies as two exact writes with zero resync work, proven by panicking trace/storage fetchers.
  • New fully-offline benches/reactive_apply.rs (mock-backed cache, pre-warmed packed words — no env, runs in CI): measures every event-sourced apply path end-to-end through AdapterDriver::apply_log. Measured (July 2026, M-series host): V2 Sync ~283 ns, Balancer swap ~432 ns (TWO_TOKEN) / ~519 ns (GENERAL), V3 Mint/Burn ~1.4 µs. benchmarks.md's reactive table now carries all five paths instead of extrapolating from the single V2 row.
  • The two publicnode-fallback examples warn up front that free endpoints can rate-limit the run mid-way.

Release mechanics

  • .cargo/audit.toml: cargo audit is green with the one lockfile-only advisory (RUSTSEC-2025-0055, tracing-subscriber 0.2.25 via revm-precompile's optional, never-enabled arkworks backend) ignored with the justification checked in.
  • RELEASING.md: live suites are now a required release step covering all eight gated files (was "optional", naming three), package facts refreshed (56 files / seven guides), and the tag section documents the re-point procedure this release needs (the pushed v0.1.0 tag sits six merges behind main).
  • ROADMAP.md: factory discovery shipped in 0.1.0 (the plan still promised it for 0.2.0 under pre-implementation API names); 0.1.x/0.2.0 now lists the real candidates (PR perf(cold-start): eth_createAccessList two-shot warming for fast first boot #32 access-list warming — deliberately deferred, Balancer log-scan + Curve MetaRegistry discovery, PoolBalanceManaged subscription, Algebra forks, Bootstrapper, incremental interests).
  • A scheduled + on-demand live-test workflow (live.yml: weekly cargo test --all-features -- --ignored with the E2E_RPC_URL secret, plus a cargo-audit job) is ready on a separate branch — the gh token lacks workflow scope, so it needs an SSH push (see PR comment).
  • One real bug found by this PR's own gates: deleting an import orphaned its #[cfg] attribute in factory.rs, hiding ProtocolMetadata from solidly-only builds — caught by the isolation clippy matrix, fixed here.

Verification

Full battery on a clean tree, all green (22 checks):

  • cargo fmt --check; clippy -D warnings on all-features, no-default, and the 7-way per-protocol isolation matrix (which caught the orphaned-cfg bug above)
  • cargo test on all-features / default / no-default (198 offline tests + the README doctest)
  • docs -D warnings on stable (CI parity) and nightly --cfg docsrs (docs.rs parity — feature badges verified in the rendered HTML)
  • cargo +1.88 check --all-features (MSRV), experimental-protocols both bare and stacked
  • cargo audit (green with the checked-in policy), heavy-dep guard, cargo package --list (56 files), cargo publish --dry-run
  • cargo bench --bench reactive_apply runs offline and produced the numbers cited above

And the full live gate against an archive endpoint (cargo test --all-features -- --ignored): 25/25 passed, 0 failures — per-protocol quote parity (mainnet + Base), factory base-slot/CREATE2 constants, one-shot V3 sync parity, both per-transaction stateDiff write-parity suites for the event-sourced paths, and both live WS soaks (~190 s / ~302 s of real mainnet events applied with exact writes).

Not in this PR: live.yml (the scheduled live-test + audit workflow) — the gh token lacks workflow scope, so it rides the local ci/live-tests branch and needs one SSH push once the 1Password agent behaves. PR #32 (access-list warming) stays deferred to 0.1.x by design.

After merge: re-point the v0.1.0 tag at the merge commit (it currently sits six merges behind on 6187d50), then cargo publish.

🤖 Generated with Claude Code

KaiCode2 and others added 14 commits July 7, 2026 23:42
Module-scope sol! blocks generate pub items, so ~30 internal ABI types
(quote-call structs, event decls, factory events) rendered on docs.rs as
public API and froze ABI plumbing into the semver surface. Wrap each block
in a crate-internal mod: sim's quote ABI is pub(crate) (cross-module
consumers), event bindings are module-private, matching the existing
pancake_v3/solidly_events idiom. The RPC-parity and WS-soak tests that
borrowed these bindings now declare their own local sol! ground-truth ABI.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- pub use alloy_primitives / evm_fork_cache at the root: both appear
  irreducibly in the public API (EvmCache, reactive runtime, Address/U256),
  so downstream can name them without hand-pinning matching versions.
  Documents the evm-fork-cache 0.x lockstep policy.
- [package.metadata.docs.rs] rustdoc-args --cfg docsrs + feature(doc_cfg)
  (auto-cfg, post-1.92 form): gated items now render 'Available on crate
  feature X' badges on docs.rs.
- Export V3StorageLayout/SolidlyStorageLayout at the adapters root
  unconditionally (both always compiled; V3StorageLayout is a root-exported
  metadata field type).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- #[non_exhaustive] on the cold_start/bytecode/state mirror structs
  (ColdStartPlan and friends) so upstream field additions — e.g. the
  pending root-probe planner phase — land without breaking downstream;
  each type documents its construction path and gained a constructor
  (new/with_*) where Default + assignment wasn't enough.
- BytecodeTemplateError joins the crate's other error enums as
  non_exhaustive; SlotDelta documents why it deliberately stays
  exhaustive.
- Fix the find_many doc-merge artifact (stale internal doc block was
  the rustdoc summary line) and the stale 'from = ZERO' claim on
  AmmAdapter::simulate_swap (SimConfig::from is threaded through since
  tier-2).
- Tests/examples switch to the new constructors (external crates can
  no longer literal-construct the mirrors — that is the point).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… ViewCall

The last merged PRs (#30/#31/#33) outran four shipped docs: CHANGELOG,
README (intro + protocol table), protocol-support-matrix, and
trace-backed-sync still described Balancer Swap (and partly V3 Mint/Burn)
as resync-only, and the changelog omitted Balancer swap event-sourcing,
the verify-only cold-start fast path, CurveMetadata::with_code_seed, the
Balancer/Curve cold_start_many bundling, and the new stateDiff parity
suites. Also removes the MetaRegistry/ViewCall discovery mechanism that
3a197f3 dropped from code but three docs kept describing, and the unused
Cargo.toml link def.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- writing-an-adapter: the AmmAdapter table was missing pool_factories and
  code_seeds and claimed 'six defaulted' methods (nine); custom_adapter's
  header repeated the six.
- high-performance-bootstrap-defaults: past-tense the superseded 'currently'
  narrative (batched discovery + cold_start_many shipped) and mark checklist
  item 1 Done.
- benchmarks.md: cargo bench does NOT emit HTML reports in this build
  (criterion without plotters; gnuplot only) and mean/median need --verbose;
  align the trace-resync reproduce command with the seven-iteration run it
  documents; stamp the results as the v0.1.0 candidate.
- One auditable CU figure for the V3 full-sync comparison everywhere
  (7,674 reads x 17 CU ~= 130k; README/CHANGELOG said 153k, the example 134k).
- bytecode_golden header: make explicit the file itself needs no env.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ested quickstart

- crates.io / docs.rs / CI / license / MSRV badges
- Installation section: cargo add, feature trimming, MSRV 1.88, and the
  public-dependency re-export policy (evm_fork_cache / alloy_primitives at
  the root, lockstep releases)
- 12-example index with a zero-setup 'start here' entry point
- Slipstream quoting caveat surfaced beside the Solidly one (matches the
  support matrix); 'all protocol features on by default' corrected
  (pancake-v3/slipstream are uniswap-v3 aliases)
- README code samples compile as doctests via a cfg(doctest) include
  (quickstart flipped ignore -> no_run; verified by cargo test --doc)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- V3 apply_liquidity_delta and Balancer apply_cash_delta get exact-boundary
  unit tests: filling to u128::MAX / 2^112-1 is representable, one unit past
  is None (resync fallback) — never wrap/saturate/carry into a co-tenant
  field; oversize amounts are rejected up front.
- Solidly V2 joins the AmmSyncEngine coverage (it was the only protocol with
  no engine/WS test): a Sync ingests as two exact reserve writes with zero
  resync work, proven by panicking trace/storage fetchers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… rows

New benches/reactive_apply.rs (criterion, no env, mock-backed EvmCache with
pre-warmed packed words — the adapter_reactive.rs fixtures) measures the
event-sourced hot paths end-to-end through AdapterDriver::apply_log:

  v2_sync                    ~283 ns   (agrees with the RPC-warmed ~249 ns)
  balancer_swap_two_token    ~432 ns
  balancer_swap_general      ~519 ns
  v3_mint_warm               ~1.42 us
  v3_burn_warm               ~1.35 us

Headroom-sized initial state keeps millions of iterations on the warm path
(burns never empty the tick, cash never leaves its 112-bit field), and
pre-flight asserts pin exact writes before measuring. benchmarks.md's
reactive table now carries all five paths instead of scoping everything to
the single V2 row, and documents the offline reproduce command.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
sync_latency and curve_cold_start_phases run multi-iteration cold-start
loops; on the publicnode fallback a rate limit aborts them mid-run with a
bare transport error. Say so up front and point at E2E_RPC_URL.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
RUSTSEC-2025-0055 (tracing-subscriber 0.2.25) resolves into Cargo.lock via
revm-precompile's optional arkworks bn254 backend, which no feature of this
crate ever enables — cargo tree finds it in no build graph, even with
--target all --all-features. Ignore it with the justification checked in, so
cargo audit is green and gateable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
RELEASING: the live suites are now a required step covering all eight gated
files (was 'optional' naming three), the package is 56 files / seven guides,
the tag section documents the re-point procedure the v0.1.0 prep needed, and
the post-publish section drops the CI-auth cleanup that already happened in
favor of docs.rs badge checks and seeding the live workflow.

ROADMAP: factory discovery shipped in 0.1.0 (the plan still promised it for
0.2.0 with pre-implementation API names); the 0.1.x/0.2.0 section now lists
the real candidates — PR #32 access-list warming, Balancer log-scan + Curve
MetaRegistry discovery, PoolBalanceManaged subscription, Algebra forks,
Bootstrapper, incremental interests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deleting factory.rs's 'use alloy_sol_types::sol;' left its
cfg(uniswap-v2|uniswap-v3) attribute behind, which stacked onto the
ProtocolMetadata import below and compiled it out of solidly-2-only
builds — caught by the isolation clippy matrix, the exact bug class it
exists for. Also allow the sim::abi re-export to be unused in the bare
adapters-only build (all its consumers are feature-gated out there).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ocker

evm-fork-cache 0.2 already ships the incremental interests API
(ReactiveRuntime::unregister_handler; add_interest_owner(_with_backfill) /
remove_interest_owner / sync_handler_interests on the subscription engine).
The stale 'once the upstream API lands' framing survived from the pre-0.2
roadmap; the real remaining work is on this side — AmmSyncEngine still
rebuilds a fresh ReactiveRuntime per registry change, discarding reorg
tracking, instead of refreshing the handler registration in place.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The quickstart registers the V3-family adapter, so compiling it under
--no-default-features failed the doctest phase (caught by the battery's
CI-parity test-nodefault gate). Default and all-features runs still
compile it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@KaiCode2
KaiCode2 merged commit 6b6991b into main Jul 8, 2026
9 checks passed
@KaiCode2
KaiCode2 deleted the release/v0.1.0-polish branch July 8, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant