chore: depend on sentrix-proto crate, drop vendored proto#17
Conversation
Replace the vendored proto/sentrix.proto + the build.rs tonic-build
invocation 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 across the four consumers.
The `pb` module stays as a thin re-export of `sentrix_proto`, so
existing consumers that path-into `sentrix_grpc_wasm::pb::*` don't
churn:
pub mod pb { pub use sentrix_proto::*; }
Drops `tonic-prost` + `prost` + `tonic-prost-build` from explicit deps
— they're transitive through `sentrix-proto` now. `tonic` stays for
the codegen macros + transport.
Tested locally with a path-dep against the chain repo's sentrix-proto
crate: `cargo build / test --doc / clippy --all-targets -- -D warnings`
all clean.
NOTE: CI will fail on this PR until `cargo publish -p sentrix-proto`
runs from the chain repo.
📝 WalkthroughWalkthroughThe PR removes local protobuf generation: deletes proto/sentrix.proto and the build.rs script, replaces in-repo prost/tonic type generation with a dependency on the published sentrix-proto crate (added to Cargo.toml with default-features = false), removes direct prost/tonic-prost and build-dependencies, and updates src/lib.rs to re-export sentrix_proto::* instead of using tonic::include_proto!. 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 docstrings
🧪 Generate unit tests (beta)
Comment |
v0.1.0 of sentrix-proto pulled `tonic/transport` unconditionally, which propagates a tokio-net / mio dep that doesn't compile for the wasm32-unknown-unknown target. v0.1.1 (sentrix-labs/sentrix#670) makes `transport` an opt-in feature. This crate's browser-only consumer drops it via `default-features = false` and uses `tonic-web-wasm-client` for the actual HTTP transport instead of tonic's hyper-based Channel. Tested locally: - `cargo build --target wasm32-unknown-unknown` clean - `cargo build` (native) clean
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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`:
- Line 24: The dependency entry for sentrix-proto in Cargo.toml currently uses
version = "0.1" which permits 0.1.0; update the sentrix-proto dependency to
require version = "0.1.1" (keeping default-features = false) so the Cargo
manifest enforces the safe minimum release that includes the wasm-compatible
transport change.
🪄 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: b0f38b6b-f26a-42e5-ab47-6cac95f2bb5c
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock,!**/*.lock
📒 Files selected for processing (1)
Cargo.toml
sentrix-proto 0.1.0 pulled tonic/transport unconditionally and broke wasm32 builds. 0.1.1 added the `transport` feature flag — that's the version we ACTUALLY rely on. Bare `version = "0.1"` would let cargo resolve to 0.1.0 on a fresh lock-file regen and reintroduce the breakage. Followup to CodeRabbit comment on PR #17.
Why
The proto schema lives in four places (chain server, sdk-rs, this crate, sentrix-explorer-v2). Drift had already started — the chain server's proto was 8979 bytes while this crate's was 8897 bytes as of 2026-05-13.
Cosmos solved this with `ibc-proto` on crates.io. The sentrix-labs/sentrix repo now ships a sibling `sentrix-proto` crate (PR sentrix-labs/sentrix#667 merged) as the single source of truth.
What
Net: -279 / +9 lines.
Test plan
After publish
Summary by CodeRabbit