chore(grpc): depend on sentrix-proto crate, drop vendored proto#23
Conversation
Replace the vendored proto/sentrix.proto + the pre-generated src/grpc/pb.rs
(~560 lines) with a dependency on the standalone `sentrix-proto` crate
that the chain repo (sentrix-labs/sentrix) publishes to crates.io.
This is the Cosmos `ibc-proto` pattern: one repo owns the .proto, every
consumer pulls the same generated types from crates.io. Eliminates the
schema drift that had already started (sdk-rs proto was 8897B, the chain
server's was 8979B as of 2026-05-13).
The `sentrix_chain::grpc::pb` module stays as a thin re-export of
`sentrix_proto`, so existing consumers that path-into pb don't churn:
pub mod pb { pub use sentrix_proto::*; }
Drops `tonic-prost` and `prost` from this crate's deps — they're now
transitive through `sentrix-proto`. `tonic` stays for the transport
layer.
Tested locally with a path-dep against the chain repo's sentrix-proto
crate: `cargo build/test/clippy --features grpc` all clean.
NOTE: CI will fail on this PR until `cargo publish -p sentrix-proto`
runs from the chain repo. The version bump on this crate
(`0.1.0-alpha.0` → `0.2.0-alpha.0`) ships in a follow-up commit so
the publish + this PR's merge land together.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR migrates gRPC protobuf definitions from a locally-maintained proto file to an external published crate Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/grpc/mod.rs (1)
12-15:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winStale documentation references removed
pb.rsand defunct tooling.These lines describe the old vendored approach:
- "proto types are pre-generated + committed (
pb.rsis checked in)" —pb.rsis deleted in this PR- "Regenerate via
cargo run --bin gen-grpc" — this binary no longer applies since types come fromsentrix-protoUpdate to reflect the new sourcing model.
📝 Suggested doc update
-//! The proto types are pre-generated + committed (`pb.rs` is checked -//! in) so consumers don't need `protoc` installed. Regenerate via -//! `cargo run --bin gen-grpc` if the upstream chain bumps the proto -//! (planned tooling — not shipped in alpha.0). +//! The proto types are sourced from the [`sentrix-proto`] crate +//! (published from `sentrix-labs/sentrix`), so consumers don't need +//! `protoc` installed. Schema updates arrive via crate version bumps.🤖 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/mod.rs` around lines 12 - 15, Update the module documentation at the top of src/grpc/mod.rs to remove the stale references to a vendored pb.rs and the defunct gen-grpc binary; replace that paragraph to state that proto types are sourced from the sentrix-proto crate (or otherwise pulled from sentrix-proto) and provide brief guidance on how to regenerate or update proto types via that crate instead of mentioning `pb.rs` or `cargo run --bin gen-grpc`, ensuring the new doc lives in the existing module doc comment block.
🤖 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.
Outside diff comments:
In `@src/grpc/mod.rs`:
- Around line 12-15: Update the module documentation at the top of
src/grpc/mod.rs to remove the stale references to a vendored pb.rs and the
defunct gen-grpc binary; replace that paragraph to state that proto types are
sourced from the sentrix-proto crate (or otherwise pulled from sentrix-proto)
and provide brief guidance on how to regenerate or update proto types via that
crate instead of mentioning `pb.rs` or `cargo run --bin gen-grpc`, ensuring the
new doc lives in the existing module doc comment block.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: f7227253-480b-4394-987b-1073012b98e0
📒 Files selected for processing (4)
Cargo.tomlproto/sentrix.protosrc/grpc/mod.rssrc/grpc/pb.rs
💤 Files with no reviewable changes (2)
- proto/sentrix.proto
- src/grpc/pb.rs
sentrix-proto's build.rs invokes protoc to generate tonic types at consumer build time. The previous CI run failed with "Could not find `protoc`" because ubuntu-22.04 doesn't ship it by default. Add `apt-get install protobuf-compiler` step and refresh Cargo.lock to 0.1.1 (which adds the wasm-friendly `transport` feature gate, not needed by sdk-rs but already published upstream).
Three stale claims fixed after the sentrix-proto extraction landed (PR #23 merged): 1. **grpc surface row** said "Pre-generated proto types committed; no protoc needed by consumers". src/grpc/pb.rs is gone — the grpc feature now depends on sentrix-proto from crates.io. Updated to reflect the new dep + the protoc build-time requirement. 2. **Status section** claimed "EVM (alloy) and gRPC (tonic) modules are doors-only stubs". Both are functional — SentrixGrpcClient has connect / get_latest_block / get_balance / get_validator_set / get_supply / get_mempool / subscribe_events all live in src/grpc/mod.rs. Reframed to "all six doors compile + have working client paths". 3. **Roadmap "Published to crates.io once feature surface stabilises"** was already published — checkbox was lying. Replaced with a forward-looking "next: surface stabilisation toward 1.0" line. Co-authored-by: satyakwok <satyakwok@users.noreply.github.com>
Why
The proto schema currently lives in three places (sdk-rs vendored copy, chain server's vendored copy, sentrix-grpc-wasm's vendored copy). Drift had already started — sdk-rs's proto was 8897 bytes, the chain server's 8979 bytes as of 2026-05-13.
Cosmos solved this exact problem with `ibc-proto` on crates.io. The sentrix-labs/sentrix repo now ships a sibling `sentrix-proto` crate (PR sentrix-labs/sentrix#667 merged) that becomes the single source of truth.
What
Net diff: -821 / +13 lines.
Test plan
After publish
The `sentrix-grpc-wasm` and `sentrix-explorer-v2` repos get equivalent migration PRs in parallel.
Summary by CodeRabbit