-
-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(everstake): added everstake solana user agent #17372
Conversation
WalkthroughThe pull request updates dependency versions and modifies the instantiation of the Solana client across multiple modules. Both the 📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (4)
⏰ Context from checks skipped due to timeout of 90000ms (15)
🔇 Additional comments (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/blockchain-link/src/workers/solana/stakingAccounts.ts (1)
19-22
: User agent implementation looks good.The Solana client initialization has been properly updated to include a user agent string with the Trezor Suite version. This follows best practices for API clients by identifying the source of requests, which can help with debugging, tracking, and proper rate limiting on the Solana RPC servers.
Consider extracting the user agent prefix string "Trezor Suite" into a shared constant to ensure consistent naming across the codebase.
- userAgent: `Trezor Suite ${getSuiteVersion()}`, + userAgent: `${USER_AGENT_PREFIX} ${getSuiteVersion()}`,suite-common/wallet-utils/src/solanaStakingUtils.ts (1)
51-54
:❓ Verification inconclusive
User agent implementation looks good.
The Solana client initialization has been properly updated to include a user agent string with the Trezor Suite version. This implementation is consistent with the changes in
stakingAccounts.ts
, which is good for maintaining code uniformity.Consider extracting the user agent string format into a shared utility or constant to ensure consistency across different files.
- userAgent: `Trezor Suite ${getSuiteVersion()}`, + userAgent: `${USER_AGENT_PREFIX} ${getSuiteVersion()}`,You might also want to verify whether the Solana RPC servers receive the user agent correctly with this implementation:
🏁 Script executed:
#!/bin/bash # Check if the updated SDK properly forwards the user agent to the Solana RPC servers # Looking for any configuration or middleware in the updated SDK version that handles user agent rg -A 5 "userAgent" --glob "node_modules/@everstake/wallet-sdk-solana/**/*.js" # Check for any HTTP request implementation in the SDK that might use the user agent rg -A 5 "fetch\(" --glob "node_modules/@everstake/wallet-sdk-solana/**/*.js" rg -A 5 "axios" --glob "node_modules/@everstake/wallet-sdk-solana/**/*.js"Length of output: 679
User Agent Implementation Looks Good; Manual Verification for SDK Forwarding Recommended
The updated Solana client initialization correctly injects the Trezor Suite version into the user agent, in line with the changes in
stakingAccounts.ts
. Great work on maintaining consistency!Key points:
- The code in
suite-common/wallet-utils/src/solanaStakingUtils.ts
(lines 51–54) sets the user agent as:return new Solana(network, { rpc: url, userAgent: `Trezor Suite ${getSuiteVersion()}`, });- As a good-to-have improvement, consider extracting the user agent format into a shared constant:
- userAgent: `Trezor Suite ${getSuiteVersion()}`, + userAgent: `${USER_AGENT_PREFIX} ${getSuiteVersion()}`,- Note: The automated check intended to verify if the SDK forwards the user agent string didn’t yield any output—likely because default filters (e.g., ignoring
node_modules
) prevented a meaningful search. Please perform a manual verification (or update the script to disable ignore rules) to confirm that RPC calls from the Solana SDK properly include the user agent.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (4)
packages/blockchain-link/package.json
(1 hunks)packages/blockchain-link/src/workers/solana/stakingAccounts.ts
(2 hunks)suite-common/wallet-utils/package.json
(2 hunks)suite-common/wallet-utils/src/solanaStakingUtils.ts
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (20)
- GitHub Check: PR-check / node-authorizeCoinjoin cancelCoinjoinAuthorization passphrase unlockPath setBusy checkFirmwareAuthenticity keepSession cancel.test info.test resetDevice-api
- GitHub Check: PR-check / node-override init-api-flaky
- GitHub Check: PR-check / web-override init-api-flaky
- GitHub Check: PR-check / web-authorizeCoinjoin cancelCoinjoinAuthorization passphrase unlockPath setBusy checkFirmwareAuthenticity keepSession cancel.test info.test resetDevice-api
- GitHub Check: build-deploy
- GitHub Check: build-deploy
- GitHub Check: run-desktop-tests (@group=wallet, trezor-user-env-unix bitcoin-regtest)
- GitHub Check: run-desktop-tests (@group=other, trezor-user-env-unix)
- GitHub Check: run-desktop-tests (@group=passphrase, trezor-user-env-unix)
- GitHub Check: EAS Update
- GitHub Check: run-desktop-tests (@group=settings, trezor-user-env-unix bitcoin-regtest)
- GitHub Check: transport-e2e-test
- GitHub Check: run-desktop-tests (@group=device-management, trezor-user-env-unix)
- GitHub Check: run-desktop-tests (@group=suite, trezor-user-env-unix)
- GitHub Check: Setup and Cache Dependencies
- GitHub Check: build-web
- GitHub Check: test
- GitHub Check: prepare_android_test_app
- GitHub Check: Analyze with CodeQL (javascript)
- GitHub Check: Socket Security: Pull Request Alerts
🔇 Additional comments (5)
packages/blockchain-link/package.json (1)
75-75
: SDK version upgrade correctly implemented.The dependency on
@everstake/wallet-sdk-solana
has been updated from v2.0.5 to v2.0.8, which is consistent with the SDK update requirements for the Everstake Solana integration.packages/blockchain-link/src/workers/solana/stakingAccounts.ts (1)
4-4
: Well-structured import for the user agent functionality.Good addition of the
getSuiteVersion
utility to provide version information for the user agent.suite-common/wallet-utils/package.json (2)
15-15
: SDK version upgrade correctly implemented.The dependency on
@everstake/wallet-sdk-solana
has been updated from v2.0.5 to v2.0.8, matching the version update in the blockchain-link package.
29-29
: Necessary dependency added correctly.The
@trezor/env-utils
dependency has been properly added to access thegetSuiteVersion
function used for the user agent implementation.suite-common/wallet-utils/src/solanaStakingUtils.ts (1)
11-11
: Well-structured import for the user agent functionality.Good addition of the
getSuiteVersion
utility for providing version information in the user agent.
🚀 Expo preview is ready!
|
c5ed22e
to
09a2278
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, impossible to test this I think
Description
Updated Everstake Solana SDK and added user agent.
Related Issue
Resolve #17315