Skip to content
114 changes: 103 additions & 11 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 ant-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ant-cli"
version = "0.1.6"
version = "0.2.0-rc.1"
edition = "2021"

[[bin]]
Expand Down
8 changes: 7 additions & 1 deletion ant-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ tracing = "0.1"
bytes = "1"
lru = "0.16"
rand = "0.8"
ant-node = { git = "https://github.com/withAutonomi/ant-node.git", branch = "mick/always-masque-relay-rebased" }
ant-node = { git = "https://github.com/WithAutonomi/ant-node.git", branch = "rc-2026.4.2" }
saorsa-pqc = "0.5"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

Expand All @@ -57,6 +57,12 @@ serial_test = "3"
anyhow = "1"
alloy = { version = "1.6", features = ["node-bindings"] }
tokio-test = "0.4"
rmp-serde = "1"
# Direct access to BootstrapManager used by the cold-start-from-disk test,
# which populates a cache via `add_peer_trusted` (bypasses Sybil rate limits)
# and then verifies reload after save. Version tracks ant-node's transitive
# saorsa-core dep.
saorsa-core = "0.23"

[[example]]
name = "start-local-devnet"
Expand Down
26 changes: 21 additions & 5 deletions ant-core/src/data/client/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//! Chunks are immutable, content-addressed data blocks where the address
//! is the BLAKE3 hash of the content.

use crate::data::client::peer_cache::record_peer_outcome;
use crate::data::client::Client;
use crate::data::error::{Error, Result};
use ant_node::ant_protocol::{
Expand All @@ -15,7 +16,7 @@ use ant_node::CLOSE_GROUP_MAJORITY;
use bytes::Bytes;
use futures::stream::{FuturesUnordered, StreamExt};
use std::future::Future;
use std::time::Duration;
use std::time::{Duration, Instant};
use tracing::{debug, warn};

/// Data type identifier for chunks (used in quote requests).
Expand Down Expand Up @@ -171,7 +172,7 @@ impl Client {
let addr_hex = hex::encode(address);
let timeout_secs = self.config().store_timeout_secs;

send_and_await_chunk_response(
let result = send_and_await_chunk_response(
node,
target_peer,
message_bytes,
Expand Down Expand Up @@ -204,7 +205,15 @@ impl Client {
))
},
)
.await
.await;

// No RTT recorded on the PUT path: the wall-clock is dominated by
// the ~4 MB payload upload, which reflects the uploader's uplink
// rather than the peer's responsiveness. Quote-path and GET-path
// RTTs still feed quality scoring.
record_peer_outcome(node, *target_peer, peer_addrs, result.is_ok(), None).await;

result
}

/// Retrieve a chunk from the Autonomi network.
Expand Down Expand Up @@ -278,7 +287,8 @@ impl Client {
let addr_hex = hex::encode(address);
let timeout_secs = self.config().store_timeout_secs;

send_and_await_chunk_response(
let start = Instant::now();
let result = send_and_await_chunk_response(
node,
peer,
message_bytes,
Expand Down Expand Up @@ -325,7 +335,13 @@ impl Client {
))
},
)
.await
.await;

let success = result.is_ok();
let rtt_ms = success.then(|| start.elapsed().as_millis() as u64);
record_peer_outcome(node, *peer, peer_addrs, success, rtt_ms).await;

result
}

/// Check if a chunk exists on the network.
Expand Down
1 change: 1 addition & 0 deletions ant-core/src/data/client/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ impl Client {
prepared_chunks,
payment_intent,
},
data_map_address: None,
})
}

Expand Down
Loading
Loading