Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix for #2599 #2632

Merged
merged 7 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions .github/workflows/memcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ jobs:
ls -l $ANT_DATA_PATH/client_first/logs
mkdir $ANT_DATA_PATH/client
ls -l $ANT_DATA_PATH
cp ./the-test-data.zip ./the-test-data_1.zip
./target/release/ant --log-output-dest data-dir file_TYPE upload "" > ./second_upload 2>&1
enrelease-candidatev:
./target/release/ant --log-output-dest=data-dir file upload --public "./the-test-data.zip" > ./upload_output_second 2>&1
rg 'Total cost: 0 AttoTokens' ./upload_output_second -c --stats
env:
ANT_LOG: "all"
timeout-minutes: 25

- name: showing the second upload terminal output
run: cat second_upload
run: cat upload_output_second
shell: bash
if: always()

Expand All @@ -115,7 +115,7 @@ jobs:
- name: Start the restart node again
run: |
./target/release/antnode \
--root-dir-type PARESTART_TEST_NODE_DATA_PATH \
--root-dir $RESTART_TEST_NODE_DATA_PATH \
--log-output-dest $RESTART_TEST_NODE_DATA_PATH \
--local \
--rewards-address "0x03B770D9cD32077cC0bF330c13C114a87643B124" &
Expand Down
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

*When editing this file, please respect a line length of 100.*

## 2025-01-14

### Client

#### Fixed

- Remove `uploaded` timestamp from archive metadata to prevent unnecessary re-uploads when archive
contents remain unchanged. This ensures we do not charge when uploading the same file more than
once on `ant file upload`.
- Switch from `HashMap` to `BTreeMap` for archive to ensure deterministic serialization, which also
prevents unnecessary re-uploads. As above, this facilitates the fix for the duplicate payment
issue.

## 2025-01-09

### Network

#### Changed

- Network discovery no longer queries the farthest full buckets. This significantly reduces the
number of messages as the network grows, resulting in fewer open connections and reduced resource
usage.

## 2025-01-06

### Network

#### Changed

- Memory and CPU metrics use more precise `f64` measurements

### Client

#### Fixed

- Apply a timeout for EVM transactions. This fixes an issue where some uploads would freeze indefinitely.
- The `ant` CLI was not selecting its network consistently from the environment variable.

## 2024-12-21

### Network
Expand Down
8 changes: 4 additions & 4 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-build-info/src/release_info.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub const RELEASE_YEAR: &str = "2024";
pub const RELEASE_MONTH: &str = "12";
pub const RELEASE_CYCLE: &str = "1";
pub const RELEASE_CYCLE_COUNTER: &str = "8";
pub const RELEASE_CYCLE_COUNTER: &str = "9";
6 changes: 3 additions & 3 deletions ant-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors = ["MaidSafe Developers <[email protected]>"]
name = "ant-cli"
description = "CLI client for the Autonomi network"
license = "GPL-3.0"
version = "0.3.3"
version = "0.3.4"
edition = "2021"
homepage = "https://maidsafe.net"
readme = "README.md"
Expand All @@ -28,7 +28,7 @@ ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.3" }
ant-build-info = { path = "../ant-build-info", version = "0.1.23" }
ant-logging = { path = "../ant-logging", version = "0.2.44" }
ant-protocol = { path = "../ant-protocol", version = "0.3.3" }
autonomi = { path = "../autonomi", version = "0.3.3", features = [
autonomi = { path = "../autonomi", version = "0.3.4", features = [
"fs",
"vault",
"registers",
Expand Down Expand Up @@ -60,7 +60,7 @@ tracing = { version = "~0.1.26" }
walkdir = "2.5.0"

[dev-dependencies]
autonomi = { path = "../autonomi", version = "0.3.3", features = ["fs"]}
autonomi = { path = "../autonomi", version = "0.3.4", features = ["fs"]}
criterion = "0.5.1"
eyre = "0.6.8"
rand = { version = "~0.8.5", features = ["small_rng"] }
Expand Down
4 changes: 2 additions & 2 deletions ant-node-rpc-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "GPL-3.0"
name = "ant-node-rpc-client"
readme = "README.md"
repository = "https://github.com/maidsafe/autonomi"
version = "0.6.40"
version = "0.6.41"

[[bin]]
name = "antnode_rpc_client"
Expand All @@ -20,7 +20,7 @@ nightly = []
ant-build-info = { path = "../ant-build-info", version = "0.1.23" }
ant-logging = { path = "../ant-logging", version = "0.2.44" }
ant-protocol = { path = "../ant-protocol", version = "0.3.3", features=["rpc"] }
ant-node = { path = "../ant-node", version = "0.3.3" }
ant-node = { path = "../ant-node", version = "0.3.4" }
ant-service-management = { path = "../ant-service-management", version = "0.4.7" }
async-trait = "0.1"
bls = { package = "blsttc", version = "8.0.1" }
Expand Down
4 changes: 2 additions & 2 deletions ant-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors = ["MaidSafe Developers <[email protected]>"]
description = "The Autonomi node binary"
name = "ant-node"
version = "0.3.3"
version = "0.3.4"
edition = "2021"
license = "GPL-3.0"
homepage = "https://maidsafe.net"
Expand Down Expand Up @@ -86,7 +86,7 @@ xor_name = "5.0.0"
ant-protocol = { path = "../ant-protocol", version = "0.3.3", features = ["rpc"] }
assert_fs = "1.0.0"
evmlib = { path = "../evmlib", version = "0.1.8" }
autonomi = { path = "../autonomi", version = "0.3.3", features = ["registers"] }
autonomi = { path = "../autonomi", version = "0.3.4", features = ["registers"] }
reqwest = { version = "0.12.2", default-features = false, features = [
"rustls-tls-manual-roots",
] }
Expand Down
2 changes: 1 addition & 1 deletion autonomi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors = ["MaidSafe Developers <[email protected]>"]
description = "Autonomi client API"
name = "autonomi"
license = "GPL-3.0"
version = "0.3.3"
version = "0.3.4"
edition = "2021"
homepage = "https://maidsafe.net"
readme = "README.md"
Expand Down
11 changes: 4 additions & 7 deletions autonomi/src/client/files/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// permissions and limitations relating to use of the SAFE Network Software.

use std::{
collections::HashMap,
collections::BTreeMap,
path::{Path, PathBuf},
};

Expand Down Expand Up @@ -36,8 +36,6 @@ pub enum RenameError {
/// Metadata for a file in an archive. Time values are UNIX timestamps.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct Metadata {
/// When the file was (last) uploaded to the network.
pub uploaded: u64,
/// File creation time on local file system. See [`std::fs::Metadata::created`] for details per OS.
pub created: u64,
/// Last file modification time taken from local file system. See [`std::fs::Metadata::modified`] for details per OS.
Expand All @@ -55,7 +53,6 @@ impl Metadata {
.as_secs();

Self {
uploaded: now,
created: now,
modified: now,
size,
Expand All @@ -68,15 +65,15 @@ impl Metadata {
/// The data maps are stored within this structure instead of uploading them to the network, keeping the data private.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Default)]
pub struct PrivateArchive {
map: HashMap<PathBuf, (DataMapChunk, Metadata)>,
map: BTreeMap<PathBuf, (DataMapChunk, Metadata)>,
}

impl PrivateArchive {
/// Create a new emtpy local archive
/// Note that this does not upload the archive to the network
pub fn new() -> Self {
Self {
map: HashMap::new(),
map: BTreeMap::new(),
}
}

Expand Down Expand Up @@ -130,7 +127,7 @@ impl PrivateArchive {
}

/// Get the underlying map
pub fn map(&self) -> &HashMap<PathBuf, (DataMapChunk, Metadata)> {
pub fn map(&self) -> &BTreeMap<PathBuf, (DataMapChunk, Metadata)> {
&self.map
}

Expand Down
8 changes: 4 additions & 4 deletions autonomi/src/client/files/archive_public.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// permissions and limitations relating to use of the SAFE Network Software.

use std::{
collections::HashMap,
collections::BTreeMap,
path::{Path, PathBuf},
};

Expand All @@ -34,15 +34,15 @@ pub type ArchiveAddr = XorName;
/// to the network, of which the addresses are stored in this archive.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Default)]
pub struct PublicArchive {
map: HashMap<PathBuf, (DataAddr, Metadata)>,
map: BTreeMap<PathBuf, (DataAddr, Metadata)>,
}

impl PublicArchive {
/// Create a new emtpy local archive
/// Note that this does not upload the archive to the network
pub fn new() -> Self {
Self {
map: HashMap::new(),
map: BTreeMap::new(),
}
}

Expand Down Expand Up @@ -92,7 +92,7 @@ impl PublicArchive {
}

/// Get the underlying map
pub fn map(&self) -> &HashMap<PathBuf, (DataAddr, Metadata)> {
pub fn map(&self) -> &BTreeMap<PathBuf, (DataAddr, Metadata)> {
&self.map
}

Expand Down
5 changes: 0 additions & 5 deletions autonomi/src/client/files/fs_public.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ pub(crate) fn metadata_from_entry(entry: &walkdir::DirEntry) -> Metadata {
entry.path().display()
);
return Metadata {
uploaded: 0,
created: 0,
modified: 0,
size: 0,
Expand Down Expand Up @@ -224,10 +223,6 @@ pub(crate) fn metadata_from_entry(entry: &walkdir::DirEntry) -> Metadata {
let modified = unix_time("modified", fs_metadata.modified());

Metadata {
uploaded: SystemTime::now()
.duration_since(SystemTime::UNIX_EPOCH)
.unwrap_or(Duration::from_secs(0))
.as_secs(),
created,
modified,
size: fs_metadata.len(),
Expand Down
2 changes: 1 addition & 1 deletion release-cycle-info
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
release-year: 2024
release-month: 12
release-cycle: 1
release-cycle-counter: 8
release-cycle-counter: 9
Loading