-
Notifications
You must be signed in to change notification settings - Fork 1.6k
approval-distribution: batch assignment and approval vote send #6400
Comments
|
corrected, that was what I was aiming at, poor choice of words |
This is forwarding batches from multiple authorities between nodes, right? |
The title is slightly misleading. What is does is opposite of batching, namely, it splits the assignment packets into chunks so they always fit into substrate/libp2p max_notification_size limit. |
Ahh okay, but an assignment packet should be like 200 bytes, no? public key (32) + VRF signature (96) + candidate (32) + a few bytes describing the sampling. Or you need to attach the candidate receipt to all of them? |
No, we do no attach the receipt, but
So a single message can contain multiple assignments. Actually, for peer view changes, maybe we shouldn't propagate all assignments if this is our grid neighbor, it seems quite wasteful. But this is getting off-topic. |
Metrics revealed that it is possible to send messages larger than
max_notification_size
of theValidation
protocol.In
unify_with_peer
, we send all the assignments we've seen for all candidates at a given block which just came into the view of a peer, and with aggresion mode active this is even a bigger problem.A wire message looks like this:
If a peer is behind with 1 block, we're gonna send all received assignments and approvals for all candidates up to 12th tranche.
In the case of assignments, which are larger, we can observe a wire size of 132 bytes plus encoding overhead:
32 bytes VRF output, 64 bytes VRF proof, 32 bytes block hash, 4 bytes validator index, 4 byte sample or core index
If we assume 50 paras and first tranches covering
needed_approvals
(30) , that is 198.000 bytes > 100KB max notification sizeAdding in more validators given tranche distribution staying the same, we would get even larger messages.
We need to break these huge messages down in batches to something lower that what the protocol allows.
The text was updated successfully, but these errors were encountered: