Skip to content

chore(deps): move the in-repo proc macros to syn 3 and darling 0.24, drop educe and secp256k1 - #12222

Merged
basvandijk merged 5 commits into
masterfrom
bas/syn-3-proc-macros
Nov 23, 2026
Merged

basvandijk merged 5 commits into
masterfrom
bas/syn-3-proc-macros

Conversation

@basvandijk

@basvandijk basvandijk commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Moves the IC's own proc-macro crates to syn 3 and darling 0.24, which #12177 allowed. It also drops the direct educe and secp256k1 dependencies, and updates Bazel's libfuzzer-sys to Cargo's 0.4.13.

Changes

  1. syn 3.0.10 and darling 0.24.1. The workspace requirements move, which affects the 12 in-repo proc-macro crates that use syn. Third-party crates already used both versions, so this moves no locked version. syn 3 adds a modifiers field to ItemFn, so the four let ItemFn { attrs, vis, sig, block } = ... patterns in the privileges and TLA macros now end in ...
  2. Drop the direct educe dependency. Its only use derived Debug for the remote CSP vault's Bincode codec, which nothing formats (codec is a private module), so that impl goes too. educe 0.5.11 stays locked through tokio-serde.
  3. Drop the direct secp256k1 0.29 dependency of ic-secp256k1 (a dev-dependency) and of the canister threshold-sig test utilities (canister_threshold_sig/test_utils). Both only use the bitcoin::secp256k1 re-export. secp256k1 0.29.100 stays locked through the bitcoin fork, and Bazel now builds it without the unused default and global-context features.
  4. libfuzzer-sys 0.4.7 → 0.4.13 in Bazel. Since 0.4.8, test_input_wrap is an unsafe fn, so //rs/execution_environment/fuzz:fuzzer_sandbox now declares its LLVMFuzzerRunDriver callback as unsafe fn(...). Both manifests raise the floor to 0.4.13.

Behaviour changes

  • Remote CSP vault codec: its four debug! calls now record source line numbers 5 lower, because codec.rs lost five educe lines above them. The client's two calls are in the binaries that create a CryptoComponent, for example replica and orchestrator. The server's two are in ic-crypto-csp. In replica and ic-crypto-csp, nothing else in the machine code differs.
  • ic-btc-adapter and pocket-ic-server: 40 fewer bytes of exception-handling tables, because secp256k1 loses those features. All functions are otherwise the same.
  • Unchanged: the ckBTC and ckDOGE minters, the BTC checker, NNS governance and ic-admin are byte-identical.

The in-repo source of the published canlog_derive now builds with syn 3 and darling 0.24 and generates the same code. Nothing has to be released now. A release needs a new canlog_derive version and a canlog release that raises its =0.1.0 pin.

FYI @dfinity/defi (ic-btc-adapter, canlog) and @dfinity/core-protocol (replica, orchestrator, ic-crypto-csp, pocket-ic-server).

🤖 Generated with Claude Code

@basvandijk basvandijk added the CI_ALL_BAZEL_TARGETS Runs all bazel targets label Nov 21, 2026
@github-actions github-actions Bot added the chore label Nov 21, 2026
@basvandijk
basvandijk requested review from a team and a balanced review from Copilot November 21, 2026 19:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The libfuzzer-sys initialization change needs confirmation that Bazel’s Run Fuzzers CI job passes, as the 11 AFL targets lack successful local linking and reported CI build/run results.

No open issues 🎉

What changed in this PR

Updates the IC’s in-repository procedural macros to syn 3 and darling 0.24, following the dependency refresh in #12177. It also removes unused direct dependencies and aligns Bazel’s libfuzzer-sys version with Cargo.

Changes:

  • Upgrade macro dependencies and adapt function destructuring to syn 3.
  • Replace educe with an equivalent manual Debug implementation and remove unused direct secp256k1 dependencies.
  • Update Bazel to libfuzzer-sys 0.4.13 and adjust the sandbox callback’s safety signature.
File Description
rs/​tla_instrumentation/​tla_instrumentation_proc_macros/​src/​lib.rs Adapt three function patterns to syn 3.
rs/​test_utilities/​privileges/​macros/​src/​lib.rs Adapt function destructuring to syn 3.
rs/​execution_environment/​fuzz/​src/​lib.rs Accept the updated unsafe libfuzzer callback.
rs/​crypto/​internal/​crypto_service_provider/​src/​vault/​remote_csp_vault/​codec.rs Replace educe with a bound-free manual Debug implementation.
rs/​crypto/​internal/​crypto_service_provider/​Cargo.toml Remove the direct educe dependency.
rs/​crypto/​internal/​crypto_service_provider/​BUILD.bazel Remove educe from library and test dependencies.
rs/​crypto/​internal/​crypto_lib/​threshold_sig/​canister_threshold_sig/​test_utils/​Cargo.toml Remove the unused direct secp256k1 dependency.
rs/​crypto/​internal/​crypto_lib/​threshold_sig/​canister_threshold_sig/​test_utils/​BUILD.bazel Remove the corresponding Bazel dependency.
packages/​ic-secp256k1/​Cargo.toml Remove the unused secp256k1 dev-dependency.
Cargo.toml Update workspace requirements and remove direct secp256k1.
Cargo.lock Update macro dependency edges and remove unused direct edges.
Cargo.Bazel.toml.lock Update dependency edges and lock libfuzzer-sys 0.4.13.
Cargo.Bazel.json.lock Regenerate Bazel dependency metadata and feature selections.
bazel/​rust.MODULE.bazel Align dependency specifications and remove unused direct entries.

Review effort: Balanced

@basvandijk
basvandijk marked this pull request as ready for review November 21, 2026 20:07
@zeropath-ai

zeropath-ai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

✅ No security or compliance issues detected. Reviewed 1 of 6 changed files (5 skipped) up to 8f190fd.

Security Overview
Detected Code Changes
Change Type Relevant files
Bug Fix ► Cargo.toml
    - darling dependency version updated from ^0.20.11 to ^0.24.1
► Cargo.lock
    - Update of several dependencies including darling, syn, libfuzzer-sys, and syn to newer versions; other related crates removed/adjusted accordingly
► Cargo.Bazel.toml.lock
    - Update references for darling to 0.24.1; libfuzzer-sys to 0.4.13; syn to 3.0.10; removal of educe and secp256k1 from certain entries
► Cargo.Bazel.json.lock
    - Update checksums and versions for multiple crates (darling, libfuzzer-sys, syn, etc.) and adjust IDs accordingly
► Cargo.Bazel.toml.lock
    - Align package versions (darling 0.24.1; libfuzzer-sys 0.4.13; syn 3.0.10) across lock files
► Bazel module file (rust.MODULE.bazel)
    - Update crate specs for darling to 0.24.1; remove educe; update libfuzzer-sys to 0.4.13; adjust secp256k1 entry removal; syn to 3.0.10
Refactor ► rs/crypto/internal/crypto_service_provider/src/vault/remote_csp_vault/codec.rs
    - Remove educe import and derive attributes from Bincode struct; reduce compile-time debug aids
► rs/execution_environment/fuzz/src/lib.rs
    - Change function signature to mark UserCb as unsafe external function type
► rs/test_utilities/privileges/macros/src/lib.rs
    - Minor formatting/structuring change to TokenStream deconstruction (added placeholder for field pattern)
Enhancement ► Bazel build and module specs (several) updated to reflect new crate versions (darling, syn) and removal of some crates; corresponding test/build configurations adjusted to use updated dependencies

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the dependency refresh.

No open issues 🎉

Review effort: Balanced

@pierugo-dfinity pierugo-dfinity left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not easy to parse the PR description, but looks good I guess

basvandijk and others added 5 commits November 23, 2026 14:34
…0.24

The workspace syn requirement moves from 2.0.110 to 3.0.10 and darling
from 0.20.11 to 0.24.1, in Cargo.toml and in the Bazel crate specs. Both
versions were already locked for third-party proc macros, so no package
version changes; only the in-repo crates' dependency edges move.

syn 3 adds a non-exhaustive `modifiers` field to `ItemFn`, so the four
`let ItemFn { .. }` patterns in the privileges and TLA macros end in `..`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…duce

`educe` was used once, to derive `Debug` for the remote CSP vault's
`Bincode` codec with both fields ignored. The hand-written impl prints
the same `Bincode` and, like educe's, puts no `Debug` bounds on the type
parameters. It sits at the end of the module, after the other impls, as
educe's macro-generated impl did, so the other impls keep their symbol
names.

The crate-local `educe = "0.5"` dependency, its Bazel crate spec and the
two `proc_macro_deps` entries go. educe 0.5.11 stays locked as a
dependency of tokio-serde.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ic-secp256k1's dev-dependencies and the tSchnorr test utilities declared
secp256k1 0.29 directly, but their code only uses the bitcoin crate's
re-export, `bitcoin::secp256k1`. The direct dependency, its workspace
entry and its Bazel crate spec go.

secp256k1 0.29.100 stays locked as a dependency of the bitcoin-dogecoin
fork. Bazel unifies features across the workspace, so its build of
secp256k1 0.29.100 loses the `default` and `global-context` features that
came from the dropped spec. `default` only enables `std`, which the fork
still enables, and nothing uses the global context.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cargo already locks libfuzzer-sys 0.4.13, while Bazel was held at 0.4.7.
Since 0.4.8, `libfuzzer_sys::test_input_wrap` is an `unsafe fn`, so the
execution-environment fuzzer sandbox now declares `LLVMFuzzerRunDriver`'s
callback as `unsafe fn`. The call already sits inside an `unsafe` block.

The requirement floor moves to 0.4.13 in both manifests, so a plain
repin releases the hold without moving unrelated dependency edges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`codec` is a private module and nothing formats a `Bincode` codec, so the
`Debug` impl that replaced educe's derive is not needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@basvandijk
basvandijk force-pushed the bas/syn-3-proc-macros branch from 3f01afb to 8f190fd Compare November 23, 2026 14:59
Copilot AI balanced review requested due to automatic review settings November 23, 2026 14:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The syn/darling migration spans 12 proc-macro crates, including production code generation, and needs owner confirmation of generated-code and binary parity plus Cargo/Bazel validation that could not be independently reproduced here.

No open issues 🎉

Review effort: Balanced

@basvandijk
basvandijk enabled stacked auto-merge November 23, 2026 15:24
@basvandijk basvandijk removed the CI_ALL_BAZEL_TARGETS Runs all bazel targets label Nov 23, 2026
@basvandijk
basvandijk disabled stacked auto-merge November 23, 2026 17:45
@basvandijk
basvandijk added this pull request to stack #12257 November 23, 2026 17:45
@basvandijk basvandijk closed this Nov 23, 2026
@basvandijk basvandijk reopened this Nov 23, 2026
@basvandijk
basvandijk added this pull request to the merge queue Nov 23, 2026
Merged via the queue into master with commit ab5e033 Nov 23, 2026
116 of 120 checks passed
@basvandijk
basvandijk deleted the bas/syn-3-proc-macros branch November 23, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants