Skip to content

P2P signature sync skips requests with no local signatures #475

Description

@Trynax

@oxsteins

I also noticed a small p2p sync recovery gap around signature requests that have no local signatures yet.
From what I can tell, BuildWantSignaturesRequest() currently scans requests via GetSignatureRequestsWithoutAggregationProof(), which is based on the aggregation-proof-pending index.

That works once the node has at least one local signature, because saving a signature creates the pending proof marker.
But if the node has the signature request and missed all signatures for it, there is no signature map yet and no proof-pending marker yet, so the request does not get included in the want-signatures request at all.

I was able to repro this locally with both badger and bbolt:

  • save a validator set with 3 active validators
  • save a signature request for that epoch
  • save no signatures for the request
  • call BuildWantSignaturesRequest()
  • it comes back empty instead of asking for validator indices 0, 1, 2

I think the fix would be to make signature sync scan signature requests by epoch directly, then:

  • if a signature map exists, ask for the missing indices like it does today
  • if no signature map exists, load the validator set and ask for all active validator indices
  • still skip aggregation-key requests if the aggregation proof already exists

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions