Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

approval-distribution: batch assignment and approval vote sendΒ #6400

Closed
@sandreim

Description

Metrics revealed that it is possible to send messages larger than max_notification_size of the Validation protocol.

Screenshot 2022-11-30 at 14 38 11

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:

pub enum ApprovalDistributionMessage {
		/// Assignments for candidates in recent, unfinalized blocks.
		///
		/// Actually checking the assignment may yield a different result.
		#[codec(index = 0)]
		Assignments(Vec<(IndirectAssignmentCert, CandidateIndex)>),
		/// Approvals for candidates in some recent, unfinalized block.
		#[codec(index = 1)]
		Approvals(Vec<IndirectSignedApprovalVote>),
	}

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 size
Adding 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.

Metadata

Assignees

No one assigned

    Labels

    I3-bugFails to follow expected behavior.U1-asapNo need to stop dead in your tracks, however issue should be addressed as soon as possible.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions