Skip to content

feat: bump alloy 0.8→2.0#16

Merged
satyakwok merged 1 commit into
mainfrom
chore/bump-alloy
May 12, 2026
Merged

feat: bump alloy 0.8→2.0#16
satyakwok merged 1 commit into
mainfrom
chore/bump-alloy

Conversation

@satyakwok

@satyakwok satyakwok commented May 12, 2026

Copy link
Copy Markdown
Member

Cluster D part 1 of the major-bump audit (sdk-rs side).

Changes

  • alloy 0.8 → 2.0
  • src/evm.rs adapted to the new provider type stack

API migrations

Old New
RootProvider<Http<Client>> RootProvider (generic over Network, default Ethereum)
use alloy::transports::http::{Client, Http} dropped — no longer publicly re-exported
ProviderBuilder::new().on_http(url) ProviderBuilder::new().disable_recommended_fillers().connect_http(url)

disable_recommended_fillers() keeps the bare-RootProvider contract — alloy 2.0 ProviderBuilder defaults to wrapping in a FillProvider stack (gas / nonce / chain-id / blob-gas), which is a behavioural change from 0.8. Consumers who want fillers can opt in explicitly.

Verification

cargo test --all-features — 10/10 pass + 1 doctest. Covers wallet + provider construction.

Coordinates with the rest of Cluster D (indexer-rs alloy bumps in #9, #10, #11, #12 — coming as a separate PR after this lands).

Summary by CodeRabbit

  • Chores
    • Updated optional Alloy dependency to v2.0 and migrated EVM HTTP provider to use the newer Alloy HTTP API.
  • Style / Refactor
    • Reformatted generated gRPC client code for consistency (no behavioral changes).

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c2d0d2a1-737c-4e16-9ab8-216b4e4deb5d

📥 Commits

Reviewing files that changed from the base of the PR and between 0d906aa and 3a566e4.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock, !**/*.lock
📒 Files selected for processing (3)
  • Cargo.toml
  • src/evm.rs
  • src/grpc/pb.rs

📝 Walkthrough

Walkthrough

This PR upgrades the Alloy dependency from 0.8 to 2.0 and adapts the EVM module to use the new HTTP provider API. The dependency version bump in Cargo.toml is accompanied by changes to src/evm.rs that update module imports and refactor both http_provider and http_provider_with_url functions. Both functions now return a simplified RootProvider type instead of the transport-generic RootProvider<Http<Client>> and construct providers using the new ProviderBuilder::new().disable_recommended_fillers().connect_http(url) pattern. URL parsing and error propagation remain unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Sentriscloud/sdk-rs#16: Both PRs bump the alloy dependency 0.8→2.0 and update src/evm.rs to use the new Alloy Provider API (RootProvider return type and ProviderBuilder::connect_http).
  • Sentriscloud/sdk-rs#15: Both PRs modify generated gRPC bindings in src/grpc/pb.rs, adjusting client method formatting and readiness/error handling.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description provides a clear summary of changes and API migrations, but does not follow the required template structure with sections like Scope, Checks, Linked issue, and Deploy impact. Restructure the description to match the required template, including Scope checkboxes, Checks verification items, Linked issue section, and Deploy impact assessment.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: bump alloy 0.8→2.0' directly and clearly summarizes the main change—a dependency version upgrade of the alloy library from 0.8 to 2.0.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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/bump-alloy

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@src/evm.rs`:
- Line 44: The chained builder call
ProviderBuilder::new().disable_recommended_fillers().connect_http(url) (and the
similar chain on the other occurrence around the reported line) must be
reformatted to rustfmt-friendly multiline chaining: break the call so each
method in the chain is on its own indented line with the leading dot (e.g.,
start with ProviderBuilder::new() on one line, then put
.disable_recommended_fillers() on the next line, then .connect_http(url) on the
following line) so cargo fmt --check passes.
🪄 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: cd60e432-4695-42cb-ac58-f1efe5ba59b2

📥 Commits

Reviewing files that changed from the base of the PR and between f80847a and 0d906aa.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock, !**/*.lock
📒 Files selected for processing (2)
  • Cargo.toml
  • src/evm.rs

Comment thread src/evm.rs Outdated
@satyakwok satyakwok enabled auto-merge (squash) May 12, 2026 04:39
alloy 2.0 reorganized the provider type stack:
  - RootProvider is now generic over Network (default Ethereum), not
    over a Transport — drop the Http<Client> parameterization
  - alloy::transports::http::{Client, Http} no longer publicly re-exported
  - ProviderBuilder::on_http renamed to connect_http
  - ProviderBuilder::new() now installs recommended fillers (gas, nonce,
    chain-id, blob-gas) by default, returning FillProvider<...>. Added
    .disable_recommended_fillers() to keep the bare RootProvider
    contract that http_provider() always returned

Public API surface unchanged — http_provider/http_provider_with_url
still return RootProvider; users picking up extra alloy fillers can
do so explicitly downstream.

Tests: 10/10 pass + doctest. Wallet round-trip + provider construction
both green.
@satyakwok satyakwok merged commit 5d382ad into main May 12, 2026
3 of 4 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