-
Notifications
You must be signed in to change notification settings - Fork 45
feat(dapi): allow setting max grpc response size #2997
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
base: v3.0-dev
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughA new optional Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
✅ gRPC Query Coverage Report |
…dling' into feat/sdk-max-request-size
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/wasm-sdk/src/settings.rs (1)
65-73: ExposemaxDecodingMessageSizein WASM bindings.
Right now this field is alwaysNonebecause the TS interface andRequestSettingsInputdon’t accept it, so JS callers can’t configure the limit.💡 Suggested update
@@ export interface RequestSettings { @@ /** * Whether to ban failed addresses. * `@default` true */ banFailedAddress?: boolean; + + /** + * Maximum gRPC response size in bytes (decoding limit). + */ + maxDecodingMessageSize?: number; } @@ struct RequestSettingsInput { retries: Option<u32>, timeout_ms: Option<u64>, connect_timeout_ms: Option<u64>, ban_failed_address: Option<bool>, + max_decoding_message_size: Option<u64>, } @@ RequestSettings { retries: input.retries.map(|r| r as usize), timeout: input.timeout_ms.map(Duration::from_millis), connect_timeout: input.connect_timeout_ms.map(Duration::from_millis), ban_failed_address: input.ban_failed_address, - max_decoding_message_size: None, + max_decoding_message_size: input.max_decoding_message_size.map(|v| v as usize), }
Issue being fixed or feature implemented
GetRecentCompactedAddressBalanceChangesResponsecan have 100 values * 2048 addresses * ~44 bytes each = ~9MB.Right now, we have a default limit of gRPC response in rs-sdk and rs-dapi set to default 4MB.
This causes errors like:
What was done?
Added mechanism to
rs-dapi-clientthat allows setting max response size.Set max response size for
GetRecentCompactedAddressBalanceChangesResponseto 16MB to be safe.How Has This Been Tested?
To be tested during testnet testing.
Breaking Changes
None
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.