1
1
from typing import List
2
- from eth2spec .phase0 .mainnet import (
2
+ from eth2spec .altair .mainnet import (
3
3
Attestation ,
4
4
AttestationData ,
5
5
BeaconBlock ,
8
8
9
9
from .networking import (
10
10
broadcast_threshold_signed_attestation ,
11
- broadcast_threshold_signed_block
11
+ broadcast_threshold_signed_block ,
12
+ broadcast_threshold_signed_sync_committee_signature ,
12
13
)
13
14
from .utils .types import (
14
15
AttestationDuty ,
17
18
CommitteeIndex ,
18
19
Epoch ,
19
20
ProposerDuty ,
21
+ Root ,
20
22
Slot ,
23
+ SyncCommitteeContribution ,
24
+ SyncCommitteeDuty ,
25
+ SyncCommitteeSignature ,
21
26
ValidatorIndex ,
22
27
)
23
28
@@ -68,11 +73,34 @@ def bn_submit_block(block: SignedBeaconBlock) -> None:
68
73
pass
69
74
70
75
76
+ def bn_get_sync_committee_duties_for_epoch (validator_indices : List [ValidatorIndex ],
77
+ epoch : Epoch ) -> List [SyncCommitteeDuty ]:
78
+ """Fetch sync committee duties for all validator indices in the epoch.
79
+ Uses https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/submitPoolSyncCommitteeSignatures
80
+ """
81
+ pass
82
+
83
+
84
+ def bn_produce_sync_committee_contribution (slot : Slot ,
85
+ subcommittee_index : ValidatorIndex ,
86
+ beacon_block_root : Root ) -> SyncCommitteeContribution :
87
+ """Produces the sync committee contribution for the given params from the BN.
88
+ Uses https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/produceSyncCommitteeContribution
89
+ """
90
+ pass
91
+
92
+
93
+ def bn_submit_sync_committee_signature (sync_committee_signature : SyncCommitteeSignature ) -> None :
94
+ """Submit sync committee signatures to the BN for Ethereum p2p gossip.
95
+ Uses https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/submitPoolSyncCommitteeSignatures
96
+ """
97
+ pass
98
+
99
+
71
100
# Validator Client Interface
72
101
73
102
"""
74
- The VC is connected to the BN through the DVC. The DVC pretends to be a proxy for the BN, except
75
- when:
103
+ The VC is connected to the BN through the DVC. The DVC pretends to be a proxy for the BN, except when:
76
104
- VC asks for its attestation, block proposal, or sync duties using the following methods:
77
105
- https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/getAttesterDuties
78
106
- https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/getProposerDuties
@@ -102,6 +130,14 @@ def cache_block_for_vc(block: BeaconBlock, proposer_duty: ProposerDuty) -> None:
102
130
pass
103
131
104
132
133
+ def cache_sync_committee_contribution_for_vc (sync_committee_contribution : SyncCommitteeContribution ,
134
+ sync_committee_duty : SyncCommitteeDuty ) -> None :
135
+ """Cache sync committee contribution to provide to VC when it seeks new data using the following method:
136
+ https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/produceSyncCommitteeContribution
137
+ """
138
+ pass
139
+
140
+
105
141
def capture_threshold_signed_attestation (threshold_signed_attestation : Attestation ) -> None :
106
142
"""Captures a threshold signed attestation provided by the VC and starts the recombination process to
107
143
construct a complete signed attestation to submit to the BN. The VC submits the attestation using the
@@ -110,9 +146,18 @@ def capture_threshold_signed_attestation(threshold_signed_attestation: Attestati
110
146
broadcast_threshold_signed_attestation (threshold_signed_attestation )
111
147
112
148
113
- def capture_threhold_signed_block (threshold_signed_block : SignedBeaconBlock ) -> None :
149
+ def capture_threshold_signed_block (threshold_signed_block : SignedBeaconBlock ) -> None :
114
150
"""Captures a threshold signed block provided by the VC and starts the recombination process to
115
151
construct a complete signed block to submit to the BN. The VC submits the block using the following method:
116
152
https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/publishBlock
117
153
"""
118
154
broadcast_threshold_signed_block (threshold_signed_block )
155
+
156
+
157
+ def capture_threshold_signed_sync_committee_signature (
158
+ threshold_signed_sync_committee_signature : SyncCommitteeSignature ) -> None :
159
+ """Captures a threshold signed block provided by the VC and starts the recombination process to
160
+ construct a complete signed block to submit to the BN. The VC submits the block using the following method:
161
+ https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/publishBlock
162
+ """
163
+ broadcast_threshold_signed_sync_committee_signature (threshold_signed_sync_committee_signature )
0 commit comments