Conversation
There was a problem hiding this comment.
Pull request overview
Updates darn to newer subduction_*/sedimentree_* crate versions and adjusts the core/CLI code to the new connection + sync APIs, including a refactor of Subduction initialization/hydration.
Changes:
- Bump workspace + crate versions (
0.5.1→0.6.0) and update Rust dependency versions (subduction_*,sedimentree_*), including lockfiles. - Migrate from
register/full_sync/sync_allAPIs toadd_connection/full_sync_with_all_peers/sync_with_all_peers. - Refactor Subduction creation to use
SubductionBuilderand implement a manual hydration path that pre-populates aShardedMap.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| flake.lock | Updates pinned Nix inputs (nixpkgs + rust-overlay revisions/hashes). |
| darn_core/src/subduction.rs | Moves Subduction initialization to SubductionBuilder; rewrites hydration to pre-load sedimentrees into a ShardedMap; updates error aliasing. |
| darn_core/src/serde_base58.rs | Adjusts imports for Audience/DiscoveryId module path changes. |
| darn_core/src/peer.rs | Adjusts Audience import path. |
| darn_core/src/darn.rs | Migrates connection registration + sync calls to new Subduction API; updates error types and some logging call sites. |
| darn_core/Cargo.toml | Bumps crate version to 0.6.0. |
| darn_cli/src/commands.rs | Migrates CLI flows to new Subduction API (add connection + sync-with-all-peers). |
| darn_cli/Cargo.toml | Bumps crate version to 0.6.0. |
| Cargo.toml | Updates workspace dependency versions for darn_core, sedimentree_*, subduction_*. |
| Cargo.lock | Lockfile updates reflecting dependency/version changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| @@ -316,8 +316,8 @@ pub(crate) async fn clone_cmd(root_id_str: &str, path: &Path, out: Output) -> ey | |||
| match darn.connect_peer(peer).await { | |||
| Ok((connection, peer_id)) => { | |||
| // Register connection (without auto-syncing - we sync specific sedimentrees below) | |||
| /// Create a new Subduction instance and spawn its background tasks. | ||
| /// | ||
| /// The listener and manager futures are spawned onto the tokio runtime. | ||
| /// The listener, handler, and manager futures are spawned onto the tokio runtime. | ||
| #[must_use] | ||
| pub fn spawn(signer: MemorySigner, storage: FsStorage) -> Arc<DarnSubduction> { | ||
| let (subduction, listener_fut, manager_fut) = DarnSubduction::new( | ||
| None, // discovery_id - not using mDNS discovery yet | ||
| signer, | ||
| storage, | ||
| OpenPolicy, | ||
| NonceCache::default(), | ||
| CountLeadingZeroBytes, | ||
| ShardedMap::new(), | ||
| TokioSpawn, | ||
| DEFAULT_MAX_PENDING_BLOB_REQUESTS, | ||
| ); | ||
| let (subduction, _handler, listener_fut, manager_fut) = SubductionBuilder::new() | ||
| .signer(signer) | ||
| .storage(storage, Arc::new(OpenPolicy)) | ||
| .spawner(TokioSpawn) | ||
| .build::<Sendable, DarnConnection>(); |
| let (subduction, _handler, listener_fut, manager_fut) = SubductionBuilder::new() | ||
| .signer(signer) | ||
| .storage(storage, Arc::new(OpenPolicy)) | ||
| .spawner(TokioSpawn) | ||
| .sedimentrees(sedimentrees) | ||
| .build::<Sendable, DarnConnection>(); |
There was a problem hiding this comment.
Pull request overview
This PR upgrades the workspace to newer sedimentree_* and subduction_* crate versions and updates darn’s integration code to the updated Subduction APIs (builder-based construction, connection add, and new sync helpers).
Changes:
- Bump
darn_core/darn_cliversions to0.6.0and update workspace dependency versions/locks (Cargo + Nix). - Migrate Subduction initialization to
SubductionBuilderand rework hydration to explicitly load sedimentree state into aShardedMap. - Update connection/sync call sites and handshake type imports to match the new
subduction_coremodule layout.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| flake.lock | Updates Nix inputs (nixpkgs, rust-overlay) to newer locked revisions. |
| darn_core/src/subduction.rs | Switches Subduction creation to SubductionBuilder and replaces prior hydrate flow with explicit storage loading into a ShardedMap. |
| darn_core/src/serde_base58.rs | Fixes import paths for Audience/DiscoveryId after handshake module refactor. |
| darn_core/src/peer.rs | Updates Audience import path to new handshake layout. |
| darn_core/src/darn.rs | Migrates to add_connection, updated sync APIs, and adjusts peer-id access/logging for new connection types. |
| darn_core/Cargo.toml | Bumps darn_core version to 0.6.0. |
| darn_cli/src/commands.rs | Updates CLI to add_connection and new sync helpers; removes no-longer-needed Connection import. |
| darn_cli/Cargo.toml | Bumps darn_cli version to 0.6.0. |
| Cargo.toml | Updates workspace dependency versions (notably sedimentree_* and subduction_*) and darn_core version reference. |
| Cargo.lock | Refreshes lockfile for upgraded crate versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| tokio::spawn(async move { | ||
| if let Err(e) = accept_result.listener_task.await { | ||
| tracing::error!(%peer_id, "Iroh listener error: {e:?}"); | ||
| tracing::error!("Iroh listener error: {e:?}"); | ||
| } | ||
| }); | ||
| tokio::spawn(async move { | ||
| if let Err(e) = accept_result.sender_task.await { | ||
| tracing::error!(%peer_id, "Iroh sender error: {e:?}"); | ||
| tracing::error!("Iroh sender error: {e:?}"); | ||
| } |
No description provided.