Skip to content
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

Quorum driver take server requested retry interval into consideration #17520

Merged

Conversation

halfprice
Copy link
Contributor

@halfprice halfprice commented May 6, 2024

Description

ValidatorOverloadedRetryAfter error contains a server suggested retry after duration. So when the quorum driver retries under SystemOverloadRetryAfter error, it should take the suggested retry duration into consideration.

Test plan

Unit tests added.


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

Copy link

vercel bot commented May 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 12, 2024 1:11am
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview May 12, 2024 1:11am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview May 12, 2024 1:11am
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview May 12, 2024 1:11am

@@ -1119,7 +1128,8 @@ where
//
// TODO: currently retryable overload and above overload error look redundant. We want to have a unified
// code path to handle both overload scenarios.
state.retryable_overloaded_stake += weight;
state.retryable_overload_info.stake += weight;
state.retryable_overload_info.requested_retry_after = state.retryable_overload_info.requested_retry_after.max(Duration::from_secs(err.retry_after_secs()));
Copy link
Contributor

Choose a reason for hiding this comment

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

just thinking out loud, should we use 67 percentile of all suggested values instead of the highest one? cuz it could be MAX by a byzantine validator.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Very good point! For a second, I was thinking the malicious can go both ways: by sending a duration that is too big or too small. But I guess the too big case is more damaging since we already perform exponential backoff in the client.

I changed the code to make the retry_after corresponding to a good quorum threshold of validators with the smallest retry after duration.

Copy link
Contributor

@mystenmark mystenmark left a comment

Choose a reason for hiding this comment

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

Looks good!

@halfprice halfprice force-pushed the zhewu/quorum-driver-respect-retry-delay branch from 182f901 to 03d600e Compare May 12, 2024 01:10
Copy link

vercel bot commented May 12, 2024

@halfprice is attempting to deploy a commit to the Mysten Labs Team on Vercel.

A member of the Team first needs to authorize it.

@halfprice halfprice merged commit 93fdf03 into MystenLabs:main May 12, 2024
42 of 45 checks passed
@halfprice halfprice deleted the zhewu/quorum-driver-respect-retry-delay branch May 12, 2024 14:39
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.

3 participants