|
1 | | -"""Block Containers for the Lean Ethereum consensus specification.""" |
| 1 | +"""Block containers for the Lean Ethereum consensus specification.""" |
2 | 2 |
|
3 | 3 | from lean_spec.subspecs.containers.slot import Slot |
4 | 4 | from lean_spec.types import Bytes32, Uint64 |
5 | 5 | from lean_spec.types.container import Container |
6 | 6 |
|
7 | | -from .types import Attestations |
| 7 | +from ..checkpoint import Checkpoint |
| 8 | +from ..vote.vote import ProposerAttestationData |
| 9 | +from .types import Attestations, BlockSignatures |
| 10 | + |
| 11 | +_DEFAULT_PROPOSER_ATTESTATION = ProposerAttestationData( |
| 12 | + target=Checkpoint(root=Bytes32.zero(), slot=Slot(0)), |
| 13 | + source=Checkpoint(root=Bytes32.zero(), slot=Slot(0)), |
| 14 | +) |
8 | 15 |
|
9 | 16 |
|
10 | 17 | class BlockBody(Container): |
11 | 18 | """The body of a block, containing payload data.""" |
12 | 19 |
|
13 | 20 | attestations: Attestations |
14 | | - """ |
15 | | - A list of votes included in the block. |
| 21 | + """Validator attestations included in the block.""" |
16 | 22 |
|
17 | | - Note: This will eventually be replaced by aggregated attestations. |
18 | | - """ |
| 23 | + proposer_attestation: ProposerAttestationData = ( |
| 24 | + _DEFAULT_PROPOSER_ATTESTATION |
| 25 | + ) |
| 26 | + """The proposer sourced attestation kept separate from the list.""" |
19 | 27 |
|
20 | 28 |
|
21 | 29 | class BlockHeader(Container): |
@@ -57,13 +65,10 @@ class Block(Container): |
57 | 65 |
|
58 | 66 |
|
59 | 67 | class SignedBlock(Container): |
60 | | - """A container for a block and the proposer's signature.""" |
| 68 | + """A container for a block and its aggregated signatures.""" |
61 | 69 |
|
62 | 70 | message: Block |
63 | 71 | """The block being signed.""" |
64 | 72 |
|
65 | | - signature: Bytes32 |
66 | | - """ |
67 | | - The proposer's signature of the block message. |
68 | | - Note: Bytes32 is a placeholder; the actual signature is much larger. |
69 | | - """ |
| 73 | + signature: BlockSignatures |
| 74 | + """Naive list of signatures aggregated for the block.""" |
0 commit comments