From b73854da89de701622d2afc7e7c387267dfbb668 Mon Sep 17 00:00:00 2001 From: Chris O'Neil Date: Tue, 8 Sep 2026 23:00:16 +0100 Subject: [PATCH] fix(tests): build the test harness against ant-node's ChunkStore Closes V2-1033 ant-node #216 replaced the LMDB chunk store with one file per chunk and changed `AntProtocol::new` to take `Arc` instead of `Arc`. `ant-core/tests/support/mod.rs` still constructs the LMDB type, so all seven e2e test binaries fail to compile against it with `error[E0308]: mismatched types`. This was invisible until now because ant-client's CI compiles against the published ant-node 0.18.1, which predates #216. It surfaced at the rc-2026.9.2 cut, where ant-core's dev-dep points at ant-node's rc branch and `cargo check --all-targets --all-features` broke. `ChunkStoreConfig` is `LmdbStorageConfig` plus a `migration` field and `ChunkStore::new` has the same shape, so the harness change is mechanical. The ant-node pins move to rev 31fcbae (#216's merge on ant-node `main`) because 0.18.1 has no `ChunkStore` and the harness cannot compile against it. A rev rather than a branch, so the pin is immutable. Both pins revert to `ant-node = "0.19.0"` when the release train publishes it. Note for reviewers: these nodes start with no legacy environment, so the store comes up directly on the file backend and the migration never runs. This harness gives no LMDB-to-file migration coverage, and did not before. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01RAfH7vssjtvHycmbLCr5ov --- Cargo.lock | 5 ++--- ant-core/Cargo.toml | 13 +++++++++++-- ant-core/tests/support/mod.rs | 13 +++++++++---- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 71ccc4b5..8c1c9149 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -893,8 +893,7 @@ dependencies = [ [[package]] name = "ant-node" version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3490dfb2cd08f4873b32d4328506038067c43a3662c5f6cb9dbb9db9e078e6d0" +source = "git+https://github.com/WithAutonomi/ant-node?rev=31fcbae#31fcbae2688a1d81008ef1b57fe09eda4b13817b" dependencies = [ "ant-protocol", "bao", @@ -3304,7 +3303,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core 0.57.0", + "windows-core 0.61.2", ] [[package]] diff --git a/ant-core/Cargo.toml b/ant-core/Cargo.toml index 86c8a0a8..3485f418 100644 --- a/ant-core/Cargo.toml +++ b/ant-core/Cargo.toml @@ -67,7 +67,14 @@ sysinfo = { version = "0.32", default-features = false, features = ["system"] } # `ant-protocol` pin above points at a released version, this ant-node must # track the matching released version carrying the same saorsa-core / # ant-protocol lineage. -ant-node = { version = "0.18.1", optional = true } +# +# Temporarily pinned to the ant-node `main` commit that merged the file-per-chunk +# chunk store (WithAutonomi/ant-node#216, V2-1033). That change replaced +# `LmdbStorage` with `ChunkStore` in `AntProtocol::new`, which the test harness +# in tests/support/mod.rs constructs, so 0.18.1 no longer compiles against it. +# A rev, not a branch, so the pin is immutable. Swap back to a published +# version pin (`ant-node = "0.19.0"`) once the release train publishes it. +ant-node = { git = "https://github.com/WithAutonomi/ant-node", rev = "31fcbae", optional = true } tracing-subscriber = { version = "0.3", features = ["env-filter"] } [target.'cfg(unix)'.dependencies] @@ -98,7 +105,9 @@ test-utils = [] # always compile even without the `devnet` feature. Pinned to the same # version as the runtime dep so there is a single ant-node / # saorsa-core version across the whole graph. -ant-node = { version = "0.18.1", features = ["test-utils"] } +ant-node = { git = "https://github.com/WithAutonomi/ant-node", rev = "31fcbae", features = [ + "test-utils", +] } serial_test = "3" anyhow = "1" alloy = { version = "1.6", features = ["node-bindings"] } diff --git a/ant-core/tests/support/mod.rs b/ant-core/tests/support/mod.rs index 48a14ea1..a8a44aed 100644 --- a/ant-core/tests/support/mod.rs +++ b/ant-core/tests/support/mod.rs @@ -25,7 +25,7 @@ use ant_node::payment::{ QuotingMetricsTracker, }; use ant_node::replication::commitment_state::{BuiltCommitment, ResponderCommitmentState}; -use ant_node::storage::{AntProtocol, LmdbStorage, LmdbStorageConfig}; +use ant_node::storage::{AntProtocol, ChunkStore, ChunkStoreConfig, MigrationConfig}; // Wire / transport / EVM types: route through ant-protocol so the test // harness exercises the same surface the client does. use ant_protocol::evm::{testnet::Testnet, Network as EvmNetwork, RewardsAddress, Wallet}; @@ -315,15 +315,20 @@ impl MiniTestnet { let node = Arc::new(P2PNode::new(core_config).await.expect("create P2P node")); node.start().await.expect("start P2P node"); - // Create LMDB storage - let storage_config = LmdbStorageConfig { + // Create the chunk store. ant-node #216 replaced the LMDB chunk store + // with one file per chunk; `AntProtocol::new` now takes an + // `Arc`. These nodes start with no legacy environment, so + // the store comes up directly on the file backend and the migration + // never runs — this harness gives no LMDB-to-file migration coverage. + let storage_config = ChunkStoreConfig { root_dir: data_dir.to_path_buf(), verify_on_read: true, max_map_size: 0, disk_reserve: 0, + migration: MigrationConfig::default(), }; let storage = Arc::new( - LmdbStorage::new(storage_config) + ChunkStore::new(storage_config) .await .expect("create storage"), );