Skip to content

chore(chain): migrate to sentrix-proto crate (drop local proto/build.rs)#29

Merged
satyakwok merged 1 commit into
mainfrom
chore/migrate-to-sentrix-proto-crate
May 14, 2026
Merged

chore(chain): migrate to sentrix-proto crate (drop local proto/build.rs)#29
satyakwok merged 1 commit into
mainfrom
chore/migrate-to-sentrix-proto-crate

Conversation

@satyakwok
Copy link
Copy Markdown
Member

@satyakwok satyakwok commented May 14, 2026

What

Drops the vendored crates/chain/proto/sentrix.proto + local build.rs codegen. Imports the canonical schema from the sentrix-proto crate (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-proto instead of a manual sync from sentrix-labs/sentrix per consumer repo.

Diff shape

  • Cargo.toml: drop tonic-prost, prost, all 3 build-deps; add sentrix-proto = "0.1.1"
  • src/lib.rs: replace tonic::include_proto!("sentrix.v1") with pub use sentrix_proto as pb
  • delete crates/chain/proto/sentrix.proto and build.rs
  • .gitignore: skip local compose.env + docker-compose.override.yml

Existing crate::pb::Foo call sites (in grpc.rs, sync/tail.rs) keep working — pub use re-export preserves the same pb::sentrix_client::SentrixClient, pb::GetBlockRequest, etc.

Verify

cargo build -p indexer-chain --release  # 5m 06s, exit 0

Follow-up

  • None for this PR. Future schema additions: bump sentrix-proto on crates.io, then cargo update -p sentrix-proto here.

Summary by CodeRabbit

  • Chores
    • Consolidated gRPC/Protobuf schema dependencies to use a single external source for improved consistency and maintainability.
    • Updated gitignore to exclude local environment configuration files.

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.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 13941964-88b3-46f7-b1df-e1ed30039e1a

📥 Commits

Reviewing files that changed from the base of the PR and between 528fc94 and 9ded98e.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock, !**/*.lock
📒 Files selected for processing (5)
  • .gitignore
  • crates/chain/Cargo.toml
  • crates/chain/build.rs
  • crates/chain/proto/sentrix.proto
  • crates/chain/src/lib.rs
💤 Files with no reviewable changes (2)
  • crates/chain/proto/sentrix.proto
  • crates/chain/build.rs

📝 Walkthrough

Walkthrough

The changes migrate the gRPC/protobuf schema infrastructure from local code generation to an external dependency. The crates/chain/build.rs build script and crates/chain/proto/sentrix.proto proto definition file are removed. The Cargo.toml is updated to depend on sentrix-proto = "0.1.1" instead of invoking local codegen. The library's public API re-exports protobuf types directly from sentrix-proto rather than including them locally via tonic::include_proto!. Environment files are added to .gitignore.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description provides clear context (What/Why/Diff shape/Verify), but does not follow the repository's required template structure with Scope and Checks sections. Add missing template sections: Scope (contract/test/deploy/tooling), Checks (build/test/fmt/slither), Linked issue, and Deploy impact checkboxes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: migrating from local protobuf files to the sentrix-proto crate while removing build.rs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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/migrate-to-sentrix-proto-crate

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

@satyakwok satyakwok merged commit c5d2122 into main May 14, 2026
8 checks passed
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