Skip to content

Chore/sdk alpha1 hardening#26

Merged
satyakwok merged 3 commits into
mainfrom
chore/sdk-alpha1-hardening
May 18, 2026
Merged

Chore/sdk alpha1 hardening#26
satyakwok merged 3 commits into
mainfrom
chore/sdk-alpha1-hardening

Conversation

@satyakwok
Copy link
Copy Markdown
Member

@satyakwok satyakwok commented May 17, 2026

Summary

What changed and why. 1-3 sentences.

Scope

  • Contract change (new file or logic edit) — needs slither pass + audit consideration
  • Test-only change
  • Deploy script / CI / docs only
  • Repo tooling (Makefile, lefthook, etc.)

Checks

  • forge build clean
  • forge test green (including fuzz + invariant)
  • forge fmt --check clean
  • slither --no-fail-pedantic reviewed (no new high-severity findings)
  • Storage layout diff reviewed if any contract field added/removed (run make storage and inspect docs/storage/*.json)

Linked issue

Closes #

Deploy impact

  • No on-chain change (test/CI/docs only)
  • Requires v-bump + redeploy when shipped
  • Backwards-compatible (extends, doesn't reorder storage)
  • Breaking — needs migration plan in RELEASES.md

Summary by CodeRabbit

  • New Features

    • Added five runnable examples: chain info, EVM block number, gRPC latest block, native transfer signing, and websocket subscription.
  • Documentation

    • Updated README and crate docs for v0.1.0-alpha.1 with clarified feature descriptions, usage examples, and unit conventions.
  • Chores

    • Added a CI workflow for formatting, linting, multi-feature checks, tests, and documentation builds.
  • Bug Fixes

    • Normalized a short-hash display to use a plain hyphen for invalid input.

Review Change Stack

satyakwok added 2 commits May 13, 2026 20:12
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.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

📝 Walkthrough

Walkthrough

This PR prepares the sentrix-chain Rust SDK for v0.1.0-alpha.1 release. It increments the package version, adds CI automation for format, lint, and test validation across feature configurations, implements five runnable examples demonstrating native chain queries, EVM block queries, gRPC interactions, wallet signing, and websocket subscriptions. README content is refreshed to reflect alpha.1 status and updated surface descriptions, while inline documentation clarifies unit semantics (sentri for native amounts, display-SRX for supply values) and receiver patterns.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • Sentriscloud/sdk-rs#25: Overlaps with README documentation updates around gRPC surface proto-generation guidance and Status/Roadmap sections for alpha readiness.
🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 76.92% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning PR description is a mostly empty template with checkboxes but no actual summary of changes, scope details, or explanation of what was modified and why. Add a concrete summary (1-3 sentences) explaining the changes, mark relevant scope checkboxes accurately based on actual changes, and verify all checks completed. The PR contains workflow additions, version bumping, documentation updates, and new examples—describe these clearly.
Title check ❓ Inconclusive The title 'Chore/sdk alpha1 hardening' is vague and generic, using non-descriptive terms that do not clearly convey the specific changes made in the changeset (CI workflow addition, version bump, README updates, new examples, documentation improvements). Revise the title to be more specific about the main changes, e.g., 'Add Rust CI workflow and prepare alpha.1 release' or 'Release v0.1.0-alpha.1 with examples and docs updates'.
✅ Passed checks (2 passed)
Check name Status Explanation
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/sdk-alpha1-hardening

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 @.github/workflows/rust.yml:
- Around line 39-58: Add CI steps to exercise common feature combinations and
per-feature tests: extend the existing cargo check/test matrix by adding runs
like cargo check --no-default-features --features "native,wallet" and cargo
check --no-default-features --features "evm,grpc" (and any other common pairs),
and add cargo test --no-default-features --features <feature> for features that
include tests (mirror the existing single-feature check steps but using cargo
test). Also add an optional job that runs the test matrix against the project's
MSRV (use the same cargo check/test commands under that Rust toolchain) so
combinations and feature-specific tests are validated against the supported
compiler version; update job names to reflect combination coverage (e.g., "cargo
check native,wallet", "cargo test evm,grpc") so the new steps are easy to locate
by name.
- Around line 19-22: Add a caching step after the "Install Rust" step (the step
using dtolnay/rust-toolchain@stable) that runs the Swatinem/rust-cache action to
cache the Cargo registry and build artifacts (e.g., ~/.cargo and target/) so
dependencies and compiled outputs are reused across CI runs; reference the
existing "Install Rust" step to place the new cache action immediately after it
and configure it to restore before builds and save after successful build steps.
- Around line 39-61: Add a new CI step immediately after the existing "cargo
check all features" step to verify the example programs compile by running cargo
check --examples --all-features (so the examples with required-features like
native/evm/grpc/bft/wallet are built); update the workflow to include this
"cargo check examples all features" step (mirroring the naming pattern used for
other steps) so examples are validated in CI.
🪄 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: b325708a-4ff7-453f-a528-6a7e65be7c9d

📥 Commits

Reviewing files that changed from the base of the PR and between 9b12d98 and 44c1a4d.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock, !**/*.lock
📒 Files selected for processing (12)
  • .github/workflows/rust.yml
  • Cargo.toml
  • README.md
  • examples/chain_info.rs
  • examples/evm_block_number.rs
  • examples/grpc_latest_block.rs
  • examples/sign_native_transfer.rs
  • examples/websocket_subscribe.rs
  • src/bft.rs
  • src/grpc/mod.rs
  • src/lib.rs
  • src/native.rs

Comment thread .github/workflows/rust.yml
Comment thread .github/workflows/rust.yml
Comment thread .github/workflows/rust.yml
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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 @.github/workflows/rust.yml:
- Around line 78-79: The CI step running the cargo doc command should treat
documentation warnings as errors; update the step that runs "cargo doc
--all-features --no-deps" to include "-D warnings" (i.e. "cargo doc -D warnings
--all-features --no-deps") so doc warnings fail the build, matching the clippy
enforcement used elsewhere.
🪄 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: 590722e3-f50c-4f8f-a2fd-308537bf0e4b

📥 Commits

Reviewing files that changed from the base of the PR and between 44c1a4d and d1a63e9.

📒 Files selected for processing (1)
  • .github/workflows/rust.yml

Comment on lines +78 to +79
- name: cargo doc all features
run: cargo doc --all-features --no-deps
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Consider enforcing documentation warnings.

The cargo doc command doesn't include -D warnings, so documentation issues (broken links, invalid syntax, missing docs on public items) will not fail the CI build. For consistency with the clippy step (line 34) and to maintain doc quality, consider treating doc warnings as errors.

📚 Suggested enhancement
       - name: cargo doc all features
-        run: cargo doc --all-features --no-deps
+        run: cargo doc --all-features --no-deps -- -D warnings
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: cargo doc all features
run: cargo doc --all-features --no-deps
- name: cargo doc all features
run: cargo doc --all-features --no-deps -- -D warnings
🤖 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 @.github/workflows/rust.yml around lines 78 - 79, The CI step running the
cargo doc command should treat documentation warnings as errors; update the step
that runs "cargo doc --all-features --no-deps" to include "-D warnings" (i.e.
"cargo doc -D warnings --all-features --no-deps") so doc warnings fail the
build, matching the clippy enforcement used elsewhere.

@satyakwok satyakwok merged commit 4a65eb5 into main May 18, 2026
9 checks passed
@satyakwok satyakwok deleted the chore/sdk-alpha1-hardening branch May 18, 2026 00:32
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