Depend on ant-protocol; make ant-node optional; ant-core 0.2.0#45
Open
Depend on ant-protocol; make ant-node optional; ant-core 0.2.0#45
Conversation
af686c5 to
27032b9
Compare
Contributor
Author
Force-pushed fixes for adversarial reviewRe-authored commit ( BLOCKERs addressed:
MAJORs addressed:
Discussed but not changed (with reasoning):
Verification:
Dep-graph policy: Blocks on:
🤖 Generated with Claude Code |
e01d3d5 to
e169816
Compare
…o 0.2.0
Switch ant-core's runtime dependencies from ant-node (0.10.0) to
ant-protocol (2.0.0). ant-node becomes an optional dependency gated
behind the new `devnet` feature, used only by the LocalDevnet wrapper
that spins up an in-process network for development and testing.
This is the change that lets a client-only optimisation ship without
a corresponding ant-node release. Before: ant-core pulled ant-node at
runtime, so every client release forced a coordinated node release.
After: the wire types live in ant-protocol; ant-node only comes in
when you explicitly opt into LocalDevnet.
Changes:
- ant-core/Cargo.toml: drop direct evmlib / ant-node / saorsa-pqc
runtime deps. Add ant-protocol = "2" as the single pin. ant-node
moves to an optional dep behind `devnet` feature. ant-node remains
a dev-dep for tests/support/mod.rs which spins up real nodes.
- Workspace root: [patch.crates-io] points ant-protocol and ant-node
at local sibling checkouts during development. Remove once both
crates are published.
- src/data/**: every use of ant_node::* rewritten to its ant_protocol
equivalent. evmlib / saorsa-core / saorsa-pqc paths go through
ant_protocol::{evm, transport, pqc} so ant-core has no direct deps
on those crates (single-version-pin policy).
- src/data/mod.rs: DevnetManifest comes from ant_protocol (always
available); LocalDevnet gated behind `devnet` feature.
- src/data/error.rs: drop `impl From<ant_node::Error> for Error`;
LocalDevnet maps node errors inline via map_err.
- src/node/mod.rs: `pub mod devnet` gated behind `devnet` feature.
- src/node/devnet.rs: imports switched to ant_protocol::{evm, transport}.
- tests/: same rewrite. tests/support/mod.rs keeps a direct ant-node
dep (dev-only) for PaymentVerifier / QuoteGenerator / LmdbStorage
— the test harness needs to *be* a node.
Version pinning policy in ant-core:
- NO direct deps on evmlib, saorsa-core, or saorsa-pqc. Go through
ant_protocol::{evm, transport, pqc}. This guarantees Cargo sees
one version constraint and can't split into two copies between
ant-client and ant-node.
Verification:
- cargo fmt --all -- --check: clean
- cargo clippy --all-targets --all-features -- -D warnings: clean
- cargo test --lib --all: 135/135 passing
- cargo test -p ant-core --test unit_self_encrypt --test merkle_unit: 16/16
- cargo test -p ant-core --test daemon_integration --test node_add_integration: passing
- cargo build --no-default-features: clean (ant-node NOT in runtime tree)
- cargo tree -p ant-core: ant-node absent; ant-protocol is the single wire dep
- cargo tree -p ant-core --features devnet: ant-node appears as expected
- cargo doc --all-features --no-deps: builds
e169816 to
fc98597
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace the runtime
ant-node = "0.10.0"dep withant-protocol = "2". Makeant-nodeoptional (behind thedevnetfeature, only forLocalDevnet) and a dev-dep (for the test harness that spins up real nodes).ant-nodeis no longer in the default runtime tree ofant-core.This is the change Nic asked for: a client-only optimisation can now ship without a coordinated
ant-noderelease.Paired with WithAutonomi/ant-node#73 and the
ant-protocol 2.0.0publish.Version pinning policy
ant-corenow has no direct deps onevmlib,saorsa-core, orsaorsa-pqc. Everything goes throughant_protocol::{evm, transport, pqc}. This guarantees Cargo sees one version constraint for each of those crates and cannot split into two incompatible copies between client and node.Changes
ant-core/Cargo.toml: drop directevmlib/ant-node/saorsa-pqcdeps. Addant-protocol = "2". Addant-node = { version = "0.11", optional = true }and[features] devnet = ["dep:ant-node"]. ant-node remains a dev-dep fortests/support/mod.rs.ant-core/src/**: everyant_node::*/evmlib::*/saorsa_*::*import rewritten to theant_protocol::*equivalent.ant-core/src/data/mod.rs:DevnetManifestnow fromant_protocol(always available);LocalDevnetgated behinddevnet.ant-core/src/data/error.rs: dropimpl From<ant_node::Error>;LocalDevnetmaps node errors inline.ant-core/src/node/mod.rs:pub mod devnetbehind#[cfg(feature = "devnet")].[patch.crates-io]— REMOVE BEFORE MERGEThe workspace
Cargo.tomlcurrently has:This is for local testing until
ant-protocol 2.0.0andant-node 0.11.0are published. Must be removed before merge — the version pins inant-core/Cargo.toml(ant-protocol = "2",ant-node = "0.11") will then resolve from crates.io.Verification
cargo fmt --all -- --checkcleancargo clippy --all-targets --all-features -- -D warningscleancargo test --lib --all: 135/135 passingcargo test -p ant-core --test unit_self_encrypt --test merkle_unit: 16/16cargo test -p ant-core --test daemon_integration --test node_add_integration: passingcargo build --no-default-features: clean, ant-node absent from runtime tree (confirmed viacargo tree)cargo tree -p ant-core --features devnet: ant-node appears as expectedcargo doc --all-features --no-depsbuildsTest plan
mainmergeant-node 0.11.0andant-protocol 2.0.0published before merge[patch.crates-io]removed from workspaceCargo.tomlbefore mergeRelease
ant-core 0.2.0(minor bump —ant-noderuntime dep is gone, which is technically breaking for consumers that usedLocalDevnetwithout opting in;DevnetManifestmoved fromant-nodere-export toant-protocolre-export at the same public path).🤖 Generated with Claude Code