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
Draft
chore: migrate nervous_system/common from dfn_core to ic-cdk#9131jasonz-dfinity wants to merge 3 commits intojasonz/dfn-core-reexport-cleanupfrom
jasonz-dfinity wants to merge 3 commits intojasonz/dfn-core-reexport-cleanupfrom
Conversation
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>
4 tasks
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>
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
dfn_coreusage innervous_system/commonwithic-cdkequivalentsdfn_core::api::time_nanos→ic_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 thedfn_core::stablelogic intoStableMemoryImplementationusingic_cdk::stable, preserving the 4-byte length-prefix stable memory format exactlydfn_coredependency entirely from the crateStacked on #9129.
Test plan
rustfmt— no changes neededcargo clippy— passed cleanbazel build //rs/nervous_system/common:common— passedbazel test //rs/nervous_system/common:common_test— passed🤖 Generated with Claude Code