As a complement to
https://github.com/ethereum/consensus-specs/pull/3787, this PR
introduces a `SingleAttestation` type used for network propagation only.
In Electra, the on-chain attestation format introduced in
[EIP-7549](https://github.com/ethereum/consensus-specs/pull/3559)
presents several difficulties - not only are the new fields to be
interpreted differently during network processing and onchain which adds
complexity in clients, they also introduce inefficiency both in hash
computation and bandwidth.
The new type puts the validator and committee indices directly in the
attestation type, this simplifying processing and increasing security.
* placing the validator index directly in the attestation allows
verifying the signature without computing a shuffling - this closes a
loophole where clients either must drop attestations or risk being
overwhelmed by shuffling computations during attestation verification
* the simpler "structure" of the attestation saves several hash calls
during processing (a single-item List has significant hashing overhead
compared to a field)
* we save a few bytes here and there - we can also put stricter bounds
on message size on the attestation topic because `SingleAttestation` is
now fixed-size
* the ambiguity of interpreting the `attestation_bits` list indices
which became contextual under EIP-7549 is removed
Because this change only affects the network encoding (and not block
contents), the implementation impact on clients should be minimal.
This also removes references to the "extended matrix" in favor of just "matrix"
which I think is better. It's not an extended matrix, it's a matrix of extended
blobs. Technically it's just a matrix of cells/proofs.
* chore: remove recover_data
* make it look closer to final code
* Improve comments
* Fix lint issue
* Fix tests & clean things up a bit
* Replace a couple uses of "monomial" with "coefficient"
* Revert "Replace a couple uses of "monomial" with "coefficient""
This reverts commit c9a1a757d1a09190eee78767b3d36b2a84066e42.
* Only replace "monomial" with "coefficient"
---------
Co-authored-by: Justin Traglia <95511699+jtraglia@users.noreply.github.com>
Co-authored-by: Justin Traglia <jtraglia@pm.me>
* Rename column_index to cell_index in KZG spec
* Fix table of contents
* Replace list(set()) with set()
* Change coset_evals to cell_indices in some places
* Remove punctuation in table description
* Remove "row" from comments & improve docstring
* Replace unique with deduplicated