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

[1.26 hotfix] limit fetch commit response size and increase request & response limit #18038

Closed
wants to merge 1 commit into from

Conversation

mwtian
Copy link
Member

@mwtian mwtian commented Jun 3, 2024

Description

Describe the changes or additions included in this PR.

Test plan

How did you test the new or updated feature?


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 Jun 3, 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 Jun 3, 2024 5:48pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Jun 3, 2024 5:48pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Jun 3, 2024 5:48pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Jun 3, 2024 5:48pm

@mwtian mwtian requested a review from ebmifa June 3, 2024 16:35
.into_iter()
.take_while(|c| {
accumulated_size += c.serialized().len();
accumulated_count += 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels like this accumulated_count is not necessary and we should limit the size of commits that are allowed to be written in store so that we are guaranteed to atleast have one commit in store that is < TARGET_RESPONSE_DATA_SIZE

Copy link
Contributor

@arun-koshy arun-koshy Jun 3, 2024

Choose a reason for hiding this comment

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

Actually not sure how you can cleanly limit this from the commit side, ignore the comment

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think we can choose to not write some commits in store or sent them via commit sync.

@@ -199,7 +199,7 @@ impl TonicParameters {
}

fn default_message_size_limit() -> usize {
8 << 20
32 << 20
Copy link
Contributor

Choose a reason for hiding this comment

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

We have already seen 30MB in error responses from validators. Shall we go slightly over ex 35MB?

@@ -29,6 +29,8 @@ use crate::{
CommitIndex, Round,
};

const TARGET_RESPONSE_DATA_SIZE: usize = 3 * 1024 * 1024;
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't that too low? Especially with having on the other side a limit 30MB . I would recommend something around 10MB

Copy link
Member Author

Choose a reason for hiding this comment

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

This is not a hard limit. It is a soft limit to make sure responses can be transmitted in time.

Copy link
Contributor

Choose a reason for hiding this comment

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

hhm what do you mean by not a hard limit? It eventually can reduce the returned batch size, isn't it?

@@ -321,7 +321,7 @@ impl<C: NetworkClient> CommitSyncer<C> {
start: CommitIndex,
end: CommitIndex,
) -> ConsensusResult<(Vec<TrustedCommit>, Vec<VerifiedBlock>)> {
const FETCH_COMMITS_TIMEOUT: Duration = Duration::from_secs(10);
const FETCH_COMMITS_TIMEOUT: Duration = Duration::from_secs(30);
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we take a smaller step here and go to 20s?

@@ -199,7 +199,7 @@ impl TonicParameters {
}

fn default_message_size_limit() -> usize {
8 << 20
2 << 30
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's also address the comment on line 187

@mwtian
Copy link
Member Author

mwtian commented Jun 3, 2024

Picked directly by @ebmifa.

@mwtian mwtian closed this Jun 3, 2024
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