Skip to content

feat: bump tonic 0.12→0.14 + prost 0.13→0.14#15

Merged
satyakwok merged 1 commit into
mainfrom
chore/bump-tonic-prost
May 12, 2026
Merged

feat: bump tonic 0.12→0.14 + prost 0.13→0.14#15
satyakwok merged 1 commit into
mainfrom
chore/bump-tonic-prost

Conversation

@satyakwok

@satyakwok satyakwok commented May 12, 2026

Copy link
Copy Markdown
Member

Cluster A1 of the major-bump audit (sdk-rs side).

Changes

  • tonic 0.12 → 0.14
  • prost 0.13 → 0.14
  • new dep: tonic-prost 0.14 (was a feature inside tonic, now split out)
  • TLS features: tls + tls-rootstls-ring + tls-native-roots

Regenerated

src/grpc/pb.rs rebuilt via tonic-prost-build 0.14. New codegen uses tonic_prost::ProstCodec instead of tonic::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-wasm and sentrix-explorer-v2 PRs in this cluster.

Summary by CodeRabbit

  • Chores
    • Upgraded gRPC dependencies including tonic and prost libraries to newer versions with updated TLS feature support.
    • Enhanced core protocol buffer message types with improved equality and hash comparison capabilities for better reliability.

Review Change Stack

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).
@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This 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)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description provides a comprehensive summary with changes, regenerated files, and verification results, but does not follow the required template structure with Scope, Checks, Deploy impact, and Linked issue sections. Add missing required template sections: Scope (contract/test/tooling checkboxes), Checks (build/test/format/linter status), Deploy impact (on-chain change/versioning impact), and Linked issue (if applicable).
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: bumping tonic from 0.12 to 0.14 and prost from 0.13 to 0.14, which is the primary focus of this PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/bump-tonic-prost

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 win

Fix rustfmt drift in the generated client block (CI blocker).

cargo fmt --check is failing across this section (including Line 348, Line 395, and the RPC method blocks from Line 438 onward). Please run cargo fmt --all and 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

📥 Commits

Reviewing files that changed from the base of the PR and between f80847a and df3b2b9.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock, !**/*.lock
📒 Files selected for processing (2)
  • Cargo.toml
  • src/grpc/pb.rs

Comment thread Cargo.toml
Comment on lines +48 to +50
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 }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 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.toml

Repository: 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.

@satyakwok satyakwok merged commit 6ece349 into main May 12, 2026
3 of 4 checks passed
@satyakwok satyakwok deleted the chore/bump-tonic-prost branch May 12, 2026 04:39
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.

1 participant