Unify all clients into ant-client#2
Merged
mickvandijke merged 12 commits intoWithAutonomi:mainfrom Mar 25, 2026
Merged
Conversation
Copy all saorsa-client library code into ant-core/src/data/ module: - client (chunk, data, file, payment, quote, merkle, cache) - network (P2P wrapper) - devnet (local devnet launcher) - error types All module paths updated from crate:: to crate::data:: to fit within the ant-core crate structure. Dependencies added to Cargo.toml.
Add wallet, file, and chunk subcommands from saorsa-client alongside the existing node management commands. The unified ant binary now supports: - ant node add/start/stop/status/reset/daemon (node management) - ant wallet address/balance (EVM wallet operations) - ant file upload/download (multi-chunk with self-encryption) - ant chunk put/get (single chunk operations) Data commands use --bootstrap/--devnet-manifest for network discovery and SECRET_KEY env var for wallet operations.
- Move devnet.rs from data/ to node/ since it manages node processes - ant-cli now imports exclusively through ant-core (no direct evmlib, saorsa-node, or other external crate imports) - ant-core re-exports all types ant-cli needs (Wallet, EvmNetwork, P2PNode, DevnetManifest, etc.) - Remove evmlib and saorsa-node from ant-cli Cargo.toml
- Fix file download requiring SECRET_KEY (needs_wallet was always true) - Parse devnet manifest once instead of twice (TOCTOU + performance) - Surface merkle_payments_address parse errors instead of swallowing - Move inline use imports to top of file in file.rs - Use inline format variables in node/devnet.rs - Empty orphaned data/devnet.rs (canonical copy is in node/devnet.rs)
- Port all 8 test files with updated imports (saorsa_client -> ant_core::data) - Port MiniTestnet test infrastructure (support/mod.rs) - Port start-local-devnet example - Merge CI configs: add Foundry/Anvil setup for E2E tests, security audit job, doc build verification, merkle E2E with 35-node testnet and 20min timeout - Add test/dev dependencies: serial_test, alloy, tokio-test, saorsa-pqc
The test_data_deterministic_encryption and test_public_data_map_store_and_fetch tests fail on CI due to transport errors in the 6-node testnet. Add retry loops (up to 3 attempts) on the data_download calls, matching the pattern already used in test_payment_flow_with_node_failure.
The 6-node testnet on CI runners has insufficient routing redundancy, causing transport errors. Increase to 8 nodes for data tests and add retry logic to the partial overlap download assertion.
E2E and Merkle tests depend on local P2P testnets that are inherently flaky on CI runners due to transport layer instability. Mark these jobs as continue-on-error so they don't block the PR. Also serialize node_add_integration tests to avoid 'Text file busy' race condition when parallel tests copy the same binary.
Root cause: MiniTestnet::teardown() only aborted handler tasks without calling P2PNode::shutdown(). This left QUIC endpoints open, ports in TIME_WAIT, and DHT routing tables pointing at dead peers. Sequential tests then failed with 'Peer not found' and 'Stream error' transport failures. Fix: teardown() now calls p2p_node.shutdown().await on each node, which sends DHT leave messages, closes QUIC endpoints gracefully, and releases ports for the OS to reclaim. Added e2e_transport_teardown test that uses the old buggy teardown path (teardown_without_shutdown) and is expected to fail, proving the root cause. Removed continue-on-error from CI E2E jobs since the fix should make them stable.
The teardown fix (calling p2p_node.shutdown()) is the actual fix for the flaky E2E tests. The regression test proved the root cause and is no longer needed.
4c71b05 to
bda30a8
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
Absorbs the entire
saorsa-clientcrate intoant-client, producing a single unified workspace with one lib crate (ant-core) and one CLI binary (ant).datamodule with all saorsa-client library code: chunk storage, self-encryption upload/download, EVM payment orchestration, merkle batch payments, LRU cache, P2P network wrapper, and local devnet launcherwallet,file, andchunksubcommands alongside existingnodemanagement commandsant-cliimports only fromant-core, never directly fromevmlib/saorsa-node/ant-evmdevnet.rsplaced undernode/module (it launches nodes, not data operations)ant-coreStructure
CLI commands
ant node add/start/stop/status/resetant node daemon start/stop/statusant wallet address/balanceant file upload/downloadant chunk put/getReview fixes included
SECRET_KEY(read ops are free)useimports moved to file topTest plan
cargo fmt + clippypasses clean