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

Add pubsub Maxmessagesize config #40

Merged
merged 2 commits into from
Jan 26, 2024
Merged

Add pubsub Maxmessagesize config #40

merged 2 commits into from
Jan 26, 2024

Conversation

millken
Copy link

@millken millken commented Jan 25, 2024

The default in the original libp2p is 1M, but the default is 12M here.

cfg.MaxMessageSize = size
return nil
}
}
Copy link
Author

Choose a reason for hiding this comment

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

that's an option.

@@ -381,7 +391,7 @@ func NewHost(ctx context.Context, options ...Option) (*Host, error) {
if err != nil {
return nil, err
}
ps, err := newPubSub(ctx, host, pubsub.WithBlacklist(blacklist))
ps, err := newPubSub(ctx, host, pubsub.WithBlacklist(blacklist), pubsub.WithMaxMessageSize(cfg.MaxMessageSize))
Copy link
Member

Choose a reason for hiding this comment

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

this is the change that fix the issue (> 1M byte block) last night?

Copy link
Author

Choose a reason for hiding this comment

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

yes,after updating config, the 1000tps test passed

@CoderZhi CoderZhi merged commit 02723bd into master Jan 26, 2024
1 check passed
@CoderZhi CoderZhi deleted the maxmessagesize branch January 26, 2024 00:17
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