Skip to content

chore: refactor rust#61

Merged
lightsing merged 11 commits intodev/m2from
chore/refactor
Mar 17, 2026
Merged

chore: refactor rust#61
lightsing merged 11 commits intodev/m2from
chore/refactor

Conversation

@lightsing
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors the Rust portion of the codebase to move off nightly-only features, introduces a new uts-sdk Rust SDK crate (stamp/upgrade/verify), and updates other language SDKs + CLI defaults to include additional public calendars.

Changes:

  • Switch Rust toolchain from pinned nightly to a stable channel and remove several nightly feature gates across crates.
  • Add a new packages/sdk-rs crate implementing stamping, upgrading pending attestations, and verification (EAS/Bitcoin verifiers behind features).
  • Update default calendar lists across TS/Python/Go (and Rust builder) and refactor CLI commands to use the new Rust SDK.

Reviewed changes

Copilot reviewed 52 out of 53 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
rust-toolchain.toml Pins the workspace toolchain to a stable Rust version.
packages/sdk-ts/src/sdk.ts Expands default calendar endpoints and annotates operators.
packages/sdk-py/src/uts_sdk/sdk.py Expands default calendar endpoints and annotates operators.
packages/sdk-go/sdk.go Expands default calendar endpoints and annotates operators.
packages/sdk-rs/Cargo.toml Introduces the new Rust SDK crate and feature flags.
packages/sdk-rs/src/lib.rs Adds SDK core + shared HTTP-with-retry helper.
packages/sdk-rs/src/builder.rs Adds SDK builder with default calendars/quorum/retry configuration.
packages/sdk-rs/src/stamp.rs Adds stamping implementation (digest, Merkle aggregation, calendar requests).
packages/sdk-rs/src/upgrade.rs Adds pending-attestation upgrade flow via calendar retrieval.
packages/sdk-rs/src/verify.rs Adds file digest verification + attestation verification aggregation.
packages/sdk-rs/src/error.rs Adds SDK error type and conversions.
crates/stamper/src/lib.rs Removes bytemuck usage; adjusts Merkle tree/root and raw-bytes storage call sites.
crates/stamper/src/kv.rs Removes bytemuck bounds in DB extension trait.
crates/stamper/Cargo.toml Drops bytemuck dependency.
crates/relayer/src/relayer.rs Adjusts Merkle root conversion and fixes U256 gas fee multiplication casting.
crates/core/src/verifier/eas.rs Makes EAS verifier methods public and re-exports error type.
crates/core/src/verifier/bitcoin.rs Adds Bitcoin verifier implementation and tests (ignored network test).
crates/core/src/verifier.rs Wires Bitcoin verifier module + error plumbing and re-exports.
crates/core/src/lib.rs Introduces allocator-api2-backed alloc re-export module; removes nightly/no_std scaffolding.
crates/core/src/utils.rs Removes custom OnceLock wrapper re-export.
crates/core/src/utils/sync/std.rs Removes custom std OnceLock wrapper.
crates/core/src/utils/sync/race.rs Removes once_cell race OnceLock wrapper.
crates/core/src/tracing.rs Removes custom tracing shim in favor of always-on tracing dependency.
crates/core/src/error.rs Removes std feature gating around I/O errors.
crates/core/src/codec/v1/timestamp/fmt.rs Updates allocator-aware vector conversions.
crates/core/src/codec/v1/timestamp/builder.rs Switches to allocator-api2 SliceExt patterns and std OnceLock.
crates/core/src/codec/v1/timestamp.rs Switches to allocator-api2 SliceExt patterns and std OnceLock.
crates/core/src/codec/v1/opcode.rs Refactors allocator usage to new crate::alloc and SliceExt conversions.
crates/core/src/codec/v1/digest.rs Refactors allocator import and tracing instrumentation.
crates/core/src/codec/v1/detached_timestamp.rs Fixes Deref/DerefMut to be generic over allocator.
crates/core/src/codec/v1/attestation.rs Refactors imports and OnceLock usage.
crates/core/src/codec/v1.rs Removes std feature gating around Error impl.
crates/core/src/codec/proof.rs Adds Deref/DerefMut for VersionedProof.
crates/core/src/codec/imp/primitives.rs Refactors allocator bounds and changes LEB128 decoding logic.
crates/core/src/codec/imp.rs Refactors imports; adds Encoder impl for std::vec::Vec<u8>.
crates/core/src/codec.rs Refactors allocator imports and removes std feature gating for Reader/Writer exports.
crates/core/Cargo.toml Adds allocator-api2 and reorganizes features (bitcoin verifier, tls options, etc.).
crates/cli/src/main.rs Switches from stderr print to tracing subscriber initialization + warn log.
crates/cli/src/commands/stamp.rs Refactors stamping to use uts-sdk.
crates/cli/src/commands/upgrade.rs Refactors upgrade to use uts-sdk and adds keep_pending/optional timeout.
crates/cli/src/commands/verify.rs Refactors verification to use uts-sdk.
crates/cli/src/commands/inspect.rs Switches CLI output from stderr to tracing logs.
crates/cli/src/client.rs Removes global reqwest client singleton (now handled by SDK).
crates/cli/Cargo.toml Drops direct deps on old verification/stamp plumbing; depends on uts-sdk.
crates/calendar/src/time.rs Removes sleep_until usage; uses checked sleep duration instead.
crates/calendar/src/routes/ots.rs Removes bytemuck usage and adjusts Merkle proof leaf typing.
crates/calendar/src/lib.rs Removes nightly feature gates.
crates/calendar/Cargo.toml Drops bytemuck and nightly hashbrown dependencies.
crates/bmt/src/lib.rs Removes bytemuck and replaces raw-bytes APIs with allocating conversions.
crates/bmt/benches/tree_construction.rs Removes benchmark file.
crates/bmt/Cargo.toml Drops bytemuck/hybrid-array and removes benchmark dev-deps/bench config.
Cargo.toml Adds packages/sdk-rs to workspace and introduces allocator-api2/backon/http deps.
Cargo.lock Updates dependency graph accordingly (removes bytemuck/commonware/old digest RCs, etc.).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lightsing lightsing merged commit f402a07 into dev/m2 Mar 17, 2026
@lightsing lightsing deleted the chore/refactor branch March 17, 2026 04:39
@lightsing lightsing added this to the L1 Anchoring milestone Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants