chore(chain): migrate to sentrix-proto crate (drop local proto/build.rs)#29
Conversation
The chain crate previously vendored proto/sentrix.proto + a local build.rs that ran tonic-prost-build. With sentrix-proto v0.1.1 published on crates.io as the single source of truth for the sentrix.v1 schema, indexer-rs joins sdk-rs + grpc-wasm in importing it directly. - Cargo.toml: drop tonic-prost, prost, build-deps; add sentrix-proto = 0.1.1 - src/lib.rs: pub use sentrix_proto as pb (existing crate::pb::Foo call sites unchanged) - delete crates/chain/proto/, build.rs Schema bumps now flow via cargo update -p sentrix-proto.
|
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 (5)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthroughThe changes migrate the gRPC/protobuf schema infrastructure from local code generation to an external dependency. The Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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 |
What
Drops the vendored
crates/chain/proto/sentrix.proto+ localbuild.rscodegen. Imports the canonical schema from thesentrix-protocrate (v0.1.1) instead — same crate that sdk-rs + grpc-wasm already use.Why
Single source of truth. Schema bumps now flow via
cargo update -p sentrix-protoinstead of a manual sync from sentrix-labs/sentrix per consumer repo.Diff shape
Cargo.toml: droptonic-prost,prost, all 3 build-deps; addsentrix-proto = "0.1.1"src/lib.rs: replacetonic::include_proto!("sentrix.v1")withpub use sentrix_proto as pbcrates/chain/proto/sentrix.protoandbuild.rs.gitignore: skip localcompose.env+docker-compose.override.ymlExisting
crate::pb::Foocall sites (ingrpc.rs,sync/tail.rs) keep working —pub usere-export preserves the samepb::sentrix_client::SentrixClient,pb::GetBlockRequest, etc.Verify
Follow-up
sentrix-protoon crates.io, thencargo update -p sentrix-protohere.Summary by CodeRabbit