-
Notifications
You must be signed in to change notification settings - Fork 40
aggregate all block signatures as naive list [devnet-1] #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 45 commits
18cfdcc
adecd99
8739640
4ffbfb1
af89e1c
505e7ce
e94357e
84a7f7a
0636cde
603cf87
92967fc
715653c
3d2de22
855a00b
8579814
8fdefec
e712087
4cd664f
e702e4e
ae40ef3
5a3051e
40d005d
4209e52
fc73c2f
968dd55
a97b671
6388aad
ae7e2d2
6307180
97c9e96
e75d0cc
f0c47f8
53ca3fa
102e03b
fc371c5
32f6bf8
76d6220
b29a454
2f50980
3d7f527
84cd64f
8dd4319
dde60f7
c8cba25
50ef62c
07a4776
e1f882a
341b2f8
190a1ff
79513a9
febaaa6
ebdf203
022e02e
c30e1af
cab98d9
06aab37
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,37 @@ | ||
| """The container types for the Lean consensus specification.""" | ||
|
|
||
| from .block import Block, BlockBody, BlockHeader, SignedBlock | ||
| from .block import ( | ||
| Block, | ||
| BlockBody, | ||
| BlockHeader, | ||
| BlockWithAttestation, | ||
| SignedBlockWithAttestation, | ||
| ) | ||
| from .checkpoint import Checkpoint | ||
| from .config import Config | ||
| from .state import State | ||
| from .vote import SignedVote, Vote | ||
| from .validator import Validator | ||
| from .vote import ( | ||
| AggreagtedAttestations, | ||
| Attestation, | ||
| AttestationData, | ||
| SignedAggreagtedAttestations, | ||
| SignedAttestation, | ||
| ) | ||
|
|
||
| __all__ = [ | ||
| "Block", | ||
| "BlockWithAttestation", | ||
| "BlockBody", | ||
| "BlockHeader", | ||
| "Checkpoint", | ||
| "Config", | ||
| "SignedBlock", | ||
| "SignedVote", | ||
| "SignedBlockWithAttestation", | ||
| "Validator", | ||
| "AttestationData", | ||
| "Attestation", | ||
| "SignedAttestation", | ||
| "SignedAggreagtedAttestations", | ||
| "AggreagtedAttestations", | ||
| "State", | ||
| "Vote", | ||
| ] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,20 @@ | ||
| """Block containers and related types for the Lean Ethereum consensus specification.""" | ||
|
|
||
| from .block import Block, BlockBody, BlockHeader, SignedBlock | ||
| from .types import Attestations | ||
| from .block import ( | ||
| Block, | ||
| BlockBody, | ||
| BlockHeader, | ||
| BlockWithAttestation, | ||
| SignedBlockWithAttestation, | ||
| ) | ||
| from .types import Attestations, BlockSignatures | ||
|
|
||
| __all__ = [ | ||
| "Block", | ||
| "BlockBody", | ||
| "BlockHeader", | ||
| "SignedBlock", | ||
| "BlockWithAttestation", | ||
| "SignedBlockWithAttestation", | ||
| "Attestations", | ||
| "BlockSignatures", | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,17 +4,18 @@ | |
| from lean_spec.types import Bytes32, Uint64 | ||
| from lean_spec.types.container import Container | ||
|
|
||
| from .types import Attestations | ||
| from ..vote import Attestation | ||
| from .types import Attestations, BlockSignatures | ||
|
|
||
|
|
||
| class BlockBody(Container): | ||
| """The body of a block, containing payload data.""" | ||
|
|
||
| attestations: Attestations | ||
g11tech marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| """ | ||
| A list of votes included in the block. | ||
| """Plain validator attestations carried in the block body. | ||
|
|
||
| Note: This will eventually be replaced by aggregated attestations. | ||
| Individual signatures live in the aggregated block signature list, so | ||
| these entries contain only vote data without per-attestation signatures. | ||
| """ | ||
|
|
||
|
|
||
|
|
@@ -56,14 +57,29 @@ class Block(Container): | |
| """The block's payload.""" | ||
|
|
||
|
|
||
| class SignedBlock(Container): | ||
| """A container for a block and the proposer's signature.""" | ||
| class BlockWithAttestation(Container): | ||
| """Bundle containing a block and the proposer's attestation.""" | ||
|
|
||
| message: Block | ||
| """The block being signed.""" | ||
| block: Block | ||
| """The proposed block message.""" | ||
|
|
||
| signature: Bytes32 | ||
| """ | ||
| The proposer's signature of the block message. | ||
| Note: Bytes32 is a placeholder; the actual signature is much larger. | ||
| proposer_attestation: Attestation | ||
| """The proposer's vote corresponding to this block.""" | ||
|
|
||
|
|
||
| class SignedBlockWithAttestation(Container): | ||
| """Envelope carrying a block, proposer vote, and aggregated signatures.""" | ||
|
|
||
| message: BlockWithAttestation | ||
| """The block plus proposer vote being signed.""" | ||
|
|
||
| signature: BlockSignatures | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| """Aggregated signature payload for the block. | ||
|
|
||
| Signatures remain in attestation order followed by the proposer signature | ||
| over entire message. For devnet 1, however the proposer signature is just | ||
| over message.proposer_attestation since lean VM is not yet there to establish | ||
| validity/mergability of the signature for its packaging into the future blocks. | ||
|
|
||
| Eventually this field will be replaced by a single zk-aggregated signature. | ||
| """ | ||
GrapeBaBa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,20 @@ | ||
| """Block-specific SSZ types for the Lean Ethereum consensus specification.""" | ||
|
|
||
| from lean_spec.types import SSZList | ||
| from lean_spec.types import Bytes4000, SSZList | ||
|
|
||
| from ...chain.config import VALIDATOR_REGISTRY_LIMIT | ||
| from ..vote import SignedVote | ||
| from ..vote import Attestation | ||
|
|
||
|
|
||
| class Attestations(SSZList): | ||
| """List of signed votes (attestations) included in a block.""" | ||
| """List of validator attestations included in a block.""" | ||
|
|
||
| ELEMENT_TYPE = SignedVote | ||
| ELEMENT_TYPE = Attestation | ||
| LIMIT = int(VALIDATOR_REGISTRY_LIMIT) | ||
|
|
||
|
|
||
| class BlockSignatures(SSZList): | ||
| """Aggregated signature list included alongside the block.""" | ||
|
|
||
| ELEMENT_TYPE = Bytes4000 | ||
| LIMIT = int(VALIDATOR_REGISTRY_LIMIT) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| """Validator container for the Lean Ethereum consensus specification.""" | ||
|
|
||
| from lean_spec.types import Bytes52, Container | ||
|
|
||
|
|
||
| class Validator(Container): | ||
| """Represents a validator's static metadata.""" | ||
|
|
||
| pubkey: Bytes52 | ||
| """XMSS one-time signature public key.""" |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| """Vote container and related types for the Lean consensus specification.""" | ||
|
|
||
| from .types import AggregatedSignatures, AggregationBits | ||
| from .vote import ( | ||
| AggreagtedAttestations, | ||
| Attestation, | ||
| AttestationData, | ||
| SignedAggreagtedAttestations, | ||
| SignedAttestation, | ||
| ) | ||
|
|
||
| __all__ = [ | ||
| "AttestationData", | ||
| "Attestation", | ||
| "SignedAttestation", | ||
| "SignedAggreagtedAttestations", | ||
| "AggreagtedAttestations", | ||
| "AggregatedSignatures", | ||
| "AggregationBits", | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| """Vote-specific SSZ types for the Lean Ethereum consensus specification.""" | ||
|
|
||
| from lean_spec.types import Bytes4000, SSZList | ||
| from lean_spec.types.bitfields import BaseBitlist | ||
|
|
||
| from ...chain.config import VALIDATOR_REGISTRY_LIMIT | ||
|
|
||
|
|
||
| class AggregationBits(BaseBitlist): | ||
| """Bitlist representing validator participation in an attestation.""" | ||
|
|
||
| LIMIT = int(VALIDATOR_REGISTRY_LIMIT) | ||
|
|
||
|
|
||
| class AggregatedSignatures(SSZList): | ||
| """Naive list of validator signatures used for aggregation placeholders.""" | ||
|
|
||
| ELEMENT_TYPE = Bytes4000 | ||
| LIMIT = int(VALIDATOR_REGISTRY_LIMIT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also applies to other places