Skip to content

Conversation

@Thorian1te
Copy link
Collaborator

@Thorian1te Thorian1te commented Dec 1, 2025

…t parent function

Summary by CodeRabbit

  • Bug Fixes

    • Switched Arbitrum gas price source to Routescan; gas prices are now returned in wei per Routescan API.
  • Chores

    • Updated default provider configuration for Arbitrum mainnet/testnet to use Routescan providers.
  • Documentation

    • Added a changelog entry noting the provider and unit changes.

✏️ Tip: You can customize this high-level summary in your review settings.

@Thorian1te Thorian1te linked an issue Dec 1, 2025 that may be closed by this pull request
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 1, 2025

📝 Walkthrough

Walkthrough

Replaces Etherscan-based Arbitrum providers with RoutescanProvider instances, exposes EtherscanProvider.apiKey to subclasses, and adds a RoutescanProvider.getFeeRates implementation that returns gas prices in wei.

Changes

Cohort / File(s) Change Summary
Changelog entry
\.changeset/angry-drinks-boil.md
Adds a changeset documenting patch bumps and notes that Routescan returns gas prices in wei (not gwei)
Arbitrum provider configuration
packages/xchain-arbitrum/src/const.ts
Removes Etherscan-based online providers and arbProviders; adds ROUTESCAN_PROVIDER_MAINNET, ROUTESCAN_PROVIDER_TESTNET, and routescanProviders mapping; updates defaultArbParams.dataProviders to use routescanProviders
Etherscan provider visibility
packages/xchain-evm-providers/src/providers/etherscan/etherscan-data-provider.ts
Changes apiKey field visibility from privateprotected to allow subclass access
Routescan provider implementation
packages/xchain-evm-providers/src/providers/routescan/routescan-data-provider.ts
Adds getFeeRates() override that calls Routescan API, maps SafeGasPrice/ProposeGasPrice/FastGasPrice to Average/Fast/Fastest, and returns values in wei (no unit conversion)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Review the getFeeRates mapping and unit handling in routescan-data-provider.ts.
  • Confirm apiKey visibility change is safe and doesn't expose sensitive access patterns.
  • Verify Arbitrum provider replacements in const.ts are consistent across environments.

Suggested reviewers

  • hippocampus-web3
  • Naq302

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: implementing a RoutescanProvider that handles gas prices in wei and overrides the parent function's behavior, which is the core focus of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 1588-fix-get-fee-rate-error-for-routescan

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 476381e and e3e4945.

📒 Files selected for processing (1)
  • packages/xchain-arbitrum/src/const.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/xchain-arbitrum/src/const.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

@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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0177414 and 476381e.

📒 Files selected for processing (4)
  • .changeset/angry-drinks-boil.md (1 hunks)
  • packages/xchain-arbitrum/src/const.ts (3 hunks)
  • packages/xchain-evm-providers/src/providers/etherscan/etherscan-data-provider.ts (1 hunks)
  • packages/xchain-evm-providers/src/providers/routescan/routescan-data-provider.ts (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (5)
packages/xchain-evm-providers/src/providers/etherscan/etherscan-data-provider.ts (1)

24-24: LGTM!

The visibility change from private to protected correctly enables subclass access to apiKey while maintaining encapsulation. This aligns with the RoutescanProvider's need to access apiKey in its overridden getFeeRates method.

.changeset/angry-drinks-boil.md (1)

1-6: LGTM!

The changeset correctly documents patch version bumps for both affected packages with a clear description of the fix.

packages/xchain-arbitrum/src/const.ts (2)

39-45: LGTM!

The mainnet Routescan provider configuration is correct with chain ID 42161 for Arbitrum One.


56-60: LGTM!

The provider mapping and integration with defaultArbParams are correctly structured.

Also applies to: 119-119

packages/xchain-evm-providers/src/providers/routescan/routescan-data-provider.ts (1)

82-97: Implementation correctly handles Routescan's wei-based gas price response.

The override properly removes the 10^9 multiplication applied in the parent Etherscan class. Routescan's gas oracle API returns values in wei (verified: SafeGasPrice: 10000000 = 0.01 gwei on Arbitrum, which is reasonable). The documentation accurately explains this difference.

Note: this.apiKey is an empty string (set in the constructor), but this is harmless since Routescan doesn't require authentication.

@Thorian1te Thorian1te merged commit cb963d7 into master Dec 1, 2025
3 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.

Fix get fee rate error for routescan.

3 participants