Skip to content

eth/handler, broadcast: optimize tx broadcast mechanism#22176

Merged
holiman merged 3 commits intoethereum:masterfrom
holiman:txverbose
Feb 17, 2021
Merged

eth/handler, broadcast: optimize tx broadcast mechanism#22176
holiman merged 3 commits intoethereum:masterfrom
holiman:txverbose

Conversation

@holiman
Copy link
Copy Markdown
Contributor

@holiman holiman commented Jan 15, 2021

This PR optimizes the broadcast loop. Instead of iterating twice through a given set of transactions to weed out which peers have and which do not have a tx, to send/announce transactions, we do it only once.

Comment thread eth/protocols/eth/broadcast.go Outdated
// Pile transaction hashes until we reach our allowed network limit
var (
hashes []common.Hash
i int
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

since i is no longer only used as a loop index, could you give it a more explicit name?

Copy link
Copy Markdown
Member

@gballet gballet left a comment

Choose a reason for hiding this comment

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

one code readability nitpick, otherwise LGTM

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.

2 participants