mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 07:31:02 +00:00
implement bitfield signing subsystem (#1364)
* update guide to reduce confusion and TODOs * work from previous bitfield signing effort There were large merge issues with the old bitfield signing PR, so we're just copying all the work from that onto this and restarting. Much of the existing work will be discarded because we now have better tools available, but that's fine. * start rewriting bitfield signing in terms of the util module * implement construct_availability_bitvec It's not an ideal implementation--we can make it much more concurrent-- but at least it compiles. * implement the unimplemented portions of bitfield signing * get core availability concurrently, not sequentially * use sp-std instead of std for a parachain item * resolve type inference failure caused by multiple From impls * handle bitfield signing subsystem & Allmessages variant in overseer * fix more multi-From inference issues * more concisely handle overflow Co-authored-by: Andronik Ordian <write@reusable.software> * Revert "resolve type inference failure caused by multiple From impls" This reverts commit 7fc77805de5e5074a1b01037f8d4e3919e03e0e1. * Revert "fix more multi-From inference issues" This reverts commit f14ffe589e20d664d8a900ed62f68b6fb844a514. * impl From<i32> for ParaId * handle another instance of AllSubsystems * improve consistency when returning existing options Co-authored-by: Andronik Ordian <write@reusable.software>
This commit is contained in:
committed by
GitHub
parent
a1c704d446
commit
ba4bfa4dd0
@@ -4,6 +4,10 @@ Validators vote on the availability of a backed candidate by issuing signed bitf
|
||||
|
||||
## Protocol
|
||||
|
||||
Input:
|
||||
|
||||
There is no dedicated input mechanism for bitfield signing. Instead, Bitfield Signing produces a bitfield representing the current state of availability on `StartWork`.
|
||||
|
||||
Output:
|
||||
|
||||
- BitfieldDistribution::DistributeBitfield: distribute a locally signed bitfield
|
||||
@@ -18,8 +22,8 @@ Upon receipt of an `ActiveLeavesUpdate`, launch bitfield signing job for each `a
|
||||
Localized to a specific relay-parent `r`
|
||||
If not running as a validator, do nothing.
|
||||
|
||||
- Begin by waiting a fixed period of time so availability distribution has the chance to make candidates available.
|
||||
- Determine our validator index `i`, the set of backed candidates pending availability in `r`, and which bit of the bitfield each corresponds to.
|
||||
- > TODO: wait T time for availability distribution?
|
||||
- Start with an empty bitfield. For each bit in the bitfield, if there is a candidate pending availability, query the [Availability Store](../utility/availability-store.md) for whether we have the availability chunk for our validator index.
|
||||
- For all chunks we have, set the corresponding bit in the bitfield.
|
||||
- Sign the bitfield and dispatch a `BitfieldDistribution::DistributeBitfield` message.
|
||||
|
||||
Reference in New Issue
Block a user