Skip to content

Refactor signature sets to use indices #8801

@wemeetagain

Description

@wemeetagain

Currently, our bls worker pool works by:

  • on the main thread, pubkeys are pulled from signature sets and aggregated then serialized and sent to workers along with message and signature
  • on the worker threads, the aggregated pubkey is deserialized before work is done

Once we have a native validator index to pubkey map, we do better, by instead, passing validator indices across the worker boundary, and giving the worker a reference to the index->pubkey map to get pubkeys and do the aggregation on the worker.

To that end, we can refactor signature sets, now. AggregatedSignatureSet can be changed to:

export type AggregatedSignatureSet = {
  type: SignatureSetType.aggregate;
  indices: number[];
  signingRoot: Root;
  signature: Uint8Array;
};

And add another type of SignatureSet:

export type SingleSignatureSet = {
  type: SignatureSetType.indexed;
  index: number;
  signingRoot: Root;
  signature: Uint8Array;
};

For now, the bls main thread controller can perform the same/similar operations as done today, the only difference is that indices will be converted to pubkeys later in the process, when creating the SerializedSet, rather than at signature set construction time.

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