Leios keyless seats: verify PoP and require present keys in certs - #693
Leios keyless seats: verify PoP and require present keys in certs#693ch1bo wants to merge 4 commits into
Conversation
A committee seat may now be keyless: `seatVKey` is a `StrictMaybe LeiosVerificationKey`. This lets a committee always mirror the full stake distribution, with a seat per pool whether or not it has registered a Leios key. This also includes a shift to a smart contstructor that checks the proof of possession and marks the data constructor as unsafe. See the BLS crypto primitives for why this is necessary. Also update haddocks to be more succinct.
* Not derive the BLS keys anymore, but instead take them from the cardano-node CLI * Add BLS keys to the `PraosCanBeLeader` * Use the BLS keys from the ledger `PoolDistr` IntersectMBO/cardano-ledger#5988 * Switch to a stake-based committee selection that supports key-less seats IntersectMBO/cardano-base#693 * Generate and use new BLS keys in the `ThreadNet` tests * Seed the `set` and `go` stake snapshots when hard-forking at epoch 0 or 1, also PR onto `main` in #2191
* Not derive the BLS keys anymore, but instead take them from the cardano-node CLI * Add BLS keys to the `PraosCanBeLeader` * Use the BLS keys from the ledger `PoolDistr` IntersectMBO/cardano-ledger#5988 * Switch to a stake-based committee selection that supports key-less seats IntersectMBO/cardano-base#693 * Generate and use new BLS keys in the `ThreadNet` tests * Seed the `set` and `go` stake snapshots when hard-forking at epoch 0 or 1, also PR onto `main` in #2191
nfrisby
left a comment
There was a problem hiding this comment.
- I'm not at all prepared to review the last commit, the one that changes
cryptondeps - I suggest collapsing the internal commits into a single "test" commit. Or maybe two. But I'd rather review one set of refactors than multiple.
|
|
||
| -- | Build a 'LeiosCommittee' from an ordered vector of seats. A seat with no | ||
| -- key — or one whose proof of possession fails to verify — is admitted keyless, | ||
| -- so one bad proof can't take down the committee. Seat order is the voter |
There was a problem hiding this comment.
so one bad proof can't take down the committee
It took me a while to realize that "take down the committee" is the rogue public key attack that the proof-of-possession prevents... right?
If so, it's confusing for the "take down the committee" to end the sentence despite the mention of Proof of Possession to be isolated within the emdash parenthetical
| -- so one bad proof can't take down the committee. Seat order is the voter | ||
| -- indexing, so derive it deterministically. | ||
| -- | ||
| -- NOTE: Seat weights are assumed to be in range [0,1] with sum ≤ 1. |
There was a problem hiding this comment.
More of a PREREQ or ASSUMPTION than a NOTE
| -- | ||
| -- NOTE: Seat weights are assumed to be in range [0,1] with sum ≤ 1. | ||
| -- | ||
| -- XXX: the positional @(key, pop)@ input is awkward; a @Map k (Weight, StrictMaybe (key, pop))@ |
There was a problem hiding this comment.
I don't know what this XXX is getting at. I'm guessing that's because I don't know what the k type variable is supposed to be
There was a problem hiding this comment.
Uniqueness is not enforced right now. I could have been more clear here.
| -- | The 'LeiosSeatId' for a verification key (smallest matching index if the | ||
| -- committee has duplicates), or 'Nothing' if absent. Errors on a committee with | ||
| -- more than @2^16@ seats — already malformed for the 16-bit bitfield. | ||
| getLeiosSeatId :: HasCallStack => LeiosVerificationKey -> LeiosCommittee -> Maybe LeiosSeatId |
There was a problem hiding this comment.
Linear scan over 2^16 array vector is moderately expensive... should we maintain an index to avoid this? How often is it called? Is that call latency critical?
There was a problem hiding this comment.
Once per epoch eventually input-output-hk/ouroboros-leios#1020
I did not change this here and in the prototype this function is called for every vote validation 😬
9c6078d to
de1a692
Compare
|
Removed the dependency change commit from this branch and PR, to keep it instead on a |
A committee seat may now be keyless:
seatVKeyis aStrictMaybe LeiosVerificationKey. This lets a committee always mirror the full stake distribution, with a seat per pool whether or not it has registered a Leios key.This also includes a shift to a smart contstructor that checks the proof of possession and marks the data constructor as unsafe. See the BLS crypto primitives for why this is necessary.
Also update haddocks to be more succinct.