Skip to content

chore: migrate nervous_system/common from dfn_core to ic-cdk#9131

Draft
jasonz-dfinity wants to merge 3 commits intojasonz/dfn-core-reexport-cleanupfrom
jasonz/dfn-core-common-migration
Draft

chore: migrate nervous_system/common from dfn_core to ic-cdk#9131
jasonz-dfinity wants to merge 3 commits intojasonz/dfn-core-reexport-cleanupfrom
jasonz/dfn-core-common-migration

Conversation

@jasonz-dfinity
Copy link
Copy Markdown
Contributor

Summary

  • Replace all dfn_core usage in nervous_system/common with ic-cdk equivalents
  • dfn_core::api::time_nanosic_cdk::api::time() (same return type: u64 nanoseconds)
  • dfn_core::stable::stable64_size()ic_cdk::stable::stable_size() (same semantics: u64 page count)
  • dfn_core_stable_mem_utils: inline the dfn_core::stable logic into StableMemoryImplementation using ic_cdk::stable, preserving the 4-byte length-prefix stable memory format exactly
  • Remove dfn_core dependency entirely from the crate

Stacked on #9129.

Test plan

  • rustfmt — no changes needed
  • cargo clippy — passed clean
  • bazel build //rs/nervous_system/common:common — passed
  • bazel test //rs/nervous_system/common:common_test — passed
  • Downstream tests (clients, root, canisters) — all passed

🤖 Generated with Claude Code

Replace all dfn_core usage in the nervous_system/common crate:
- `dfn_core::api::time_nanos` → `ic_cdk::api::time()` in serve_metrics
- `dfn_core::stable::stable64_size()` → `ic_cdk::stable::stable_size()`
  in stable_memory_num_pages and stable_memory_size_bytes
- `dfn_core::stable::{write,read,length,set_length}` → inline
  implementations using `ic_cdk::stable` in dfn_core_stable_mem_utils,
  preserving the 4-byte length-prefix stable memory format

The dfn_core dependency is removed entirely from this crate.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added the chore label Mar 2, 2026
This module will be removed entirely when GTC is migrated,
so there's no need to rewrite its internals now. Keep dfn_core
as a dependency of nervous_system/common for this module.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant