feat: bump tonic 0.12→0.14 + prost 0.13→0.14#15
Conversation
tonic 0.14 split the prost codec into its own crate (tonic-prost). The generated client code now references `tonic_prost::ProstCodec` and uses the new body type. Regenerated src/grpc/pb.rs via tonic-prost-build 0.14. TLS feature names changed: `tls` + `tls-roots` → `tls-ring` + `tls-native-roots`. Picking ring + system roots to match how the public gRPC endpoints (grpc.sentrixchain.com / grpc-testnet.sentrixchain.com) present their certs. Supersedes #10 (prost-only bump).
📝 WalkthroughWalkthroughThis PR upgrades the gRPC dependencies to tonic 0.14 and prost 0.14, introducing tonic-prost 0.14 as a new codec library. The Cargo.toml is updated to reflect version bumps and TLS feature changes (tls/tls-roots → tls-ring/tls-native-roots). The src/grpc/pb.rs file is regenerated to add Eq and Hash derives across 19 protobuf message types, enabling these types to be used in hash-based collections and equality assertions. All seven RPC client methods are refactored to use tonic_prost::ProstCodec instead of tonic::codec::ProstCodec, with corresponding updates to generic bounds and request handling to align with tonic 0.14's body type abstractions. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/grpc/pb.rs (1)
348-604:⚠️ Potential issue | 🟠 Major | ⚡ Quick winFix rustfmt drift in the generated client block (CI blocker).
cargo fmt --checkis failing across this section (including Line 348, Line 395, and the RPC method blocks from Line 438 onward). Please runcargo fmt --alland commit the formatted output so CI can pass.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/grpc/pb.rs` around lines 348 - 604, The generated gRPC client block has rustfmt drift; run rustfmt and commit the changes to fix CI: run `cargo fmt --all` and stage the updated formatting for the generated SentrixClient impl (including SentrixClient::connect and methods broadcast_tx, get_block, get_balance, get_validator_set, get_supply, get_mempool, stream_events and surrounding functions like new/with_origin/with_interceptor) so the file src/grpc/pb.rs is formatted consistently and passes `cargo fmt --check`.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Cargo.toml`:
- Around line 48-50: Update the crate version and add a migration note for the
gRPC upgrade: bump the package version in Cargo.toml from 0.1.0-alpha.0 to
0.2.0-alpha.0 (or the next breaking pre-1.0 version), and add a MIGRATION
section to the PR body that documents the breaking changes in
src/grpc/pb.rs—specifically that SentrixClient<T> now has generic bounds tied to
tonic::client::GrpcService<tonic::body::Body> and that methods now reference
tonic_prost::ProstCodec, which may require downstream code updates; include
example guidance on adjusting generic bounds and codec imports.
---
Outside diff comments:
In `@src/grpc/pb.rs`:
- Around line 348-604: The generated gRPC client block has rustfmt drift; run
rustfmt and commit the changes to fix CI: run `cargo fmt --all` and stage the
updated formatting for the generated SentrixClient impl (including
SentrixClient::connect and methods broadcast_tx, get_block, get_balance,
get_validator_set, get_supply, get_mempool, stream_events and surrounding
functions like new/with_origin/with_interceptor) so the file src/grpc/pb.rs is
formatted consistently and passes `cargo fmt --check`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 2fea8acd-7104-4fca-9342-d7d4c9deb1f3
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock,!**/*.lock
📒 Files selected for processing (2)
Cargo.tomlsrc/grpc/pb.rs
| tonic = { version = "0.14", optional = true, features = ["tls-ring", "tls-native-roots"] } | ||
| tonic-prost = { version = "0.14", optional = true } | ||
| prost = { version = "0.14", optional = true } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify exposed public gRPC surface references tonic/tonic-prost types
rg -n 'pub mod sentrix_client|pub struct SentrixClient|GrpcService<tonic::body::Body>|tonic_prost::ProstCodec' src/grpc/pb.rs
# Verify crate version currently not bumped for this breaking upgrade
rg -n '^version\s*=' Cargo.tomlRepository: Sentriscloud/sdk-rs
Length of output: 760
Add a migration note and semver-breaking version bump for this gRPC upgrade.
The tonic/prost dependency bump changes the public SDK-facing gRPC surface in src/grpc/pb.rs. The SentrixClient<T> struct exposes generic bounds tied to tonic::client::GrpcService<tonic::body::Body>, and multiple methods reference tonic_prost::ProstCodec. This causes compile-time breaking changes for downstream integrations. Bump the crate version from 0.1.0-alpha.0 to 0.2.0-alpha.0 (or next breaking pre-1.0 line) and add a MIGRATION section to the PR body documenting the breaking changes.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Cargo.toml` around lines 48 - 50, Update the crate version and add a
migration note for the gRPC upgrade: bump the package version in Cargo.toml from
0.1.0-alpha.0 to 0.2.0-alpha.0 (or the next breaking pre-1.0 version), and add a
MIGRATION section to the PR body that documents the breaking changes in
src/grpc/pb.rs—specifically that SentrixClient<T> now has generic bounds tied to
tonic::client::GrpcService<tonic::body::Body> and that methods now reference
tonic_prost::ProstCodec, which may require downstream code updates; include
example guidance on adjusting generic bounds and codec imports.
Cluster A1 of the major-bump audit (sdk-rs side).
Changes
tonic-prost0.14 (was a feature inside tonic, now split out)tls+tls-roots→tls-ring+tls-native-rootsRegenerated
src/grpc/pb.rsrebuilt via tonic-prost-build 0.14. New codegen usestonic_prost::ProstCodecinstead oftonic::codec::ProstCodec.Verification
cargo test --all-features— 10/10 pass + 1 doctest. Covers wallet signing round-trip, EVM provider construction, network spec invariants.Supersedes #10 (prost-only bump). Coordinates with upcoming
sentrix-grpc-wasmandsentrix-explorer-v2PRs in this cluster.Summary by CodeRabbit