eth: don't enforce minimum broadcast, fix broadcast test #20678
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently we always propagate a block/transaction to at least 4 peers, even if the square root is less (e.g. if I have 5 peers, I will propagate to 4, not just to 2). As far as I know this was added when there was no announcement mechanism at all (i.e. eth/60).
I think this is misguided:
sqrt(whatever_gt_1) >= 1
) and the announces will cover any gaps for super degenerate topologies.PeersWithoutBlock
andPeersWithoutTx
will return a small subset of peers. With the enforced 4 peer propagation, the node will send the block/tx forward to 4 further peers, even if 46 out of 50 peers already know of it, which is pointless.sqrt(whatever)
(sincesqrt(whatever_gt_1) >= 1
, so we will always send the block in its entirety to at least one peer).The PR also reduces the test time of the BroadcastTest from 18 seconds to 1.