|
6 | 6 | SignedBeaconBlock, |
7 | 7 | ) |
8 | 8 |
|
| 9 | +from .networking import ( |
| 10 | + broadcast_threshold_signed_attestation, |
| 11 | + broadcast_threshold_signed_block |
| 12 | +) |
9 | 13 | from .utils.types import ( |
10 | 14 | AttestationDuty, |
11 | 15 | BLSSignature, |
@@ -66,18 +70,49 @@ def bn_submit_block(block: SignedBeaconBlock) -> None: |
66 | 70 |
|
67 | 71 | # Validator Client Interface |
68 | 72 |
|
69 | | - |
70 | | -def vc_sign_attestation(attestation_data: AttestationData, attestation_duty: AttestationDuty) -> Attestation: |
71 | | - """Returns a signed attestations that is constructed using the given attestation data & attestation duty. |
72 | | - This endpoint does not exist in beacon-APIs. |
| 73 | +""" |
| 74 | +The VC is connected to the BN through the DVC. The DVC pretends to be a proxy for the BN, except |
| 75 | +when: |
| 76 | +- VC asks for its attestation, block proposal, or sync duties using the following methods: |
| 77 | + - https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/getAttesterDuties |
| 78 | + - https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/getProposerDuties |
| 79 | + - mhttps://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/getSyncCommitteeDuties |
| 80 | +- VC asks for new attestation data, block, or sync duty using the following methods: |
| 81 | + - https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/produceAttestationData |
| 82 | + - https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/produceBlockV2 |
| 83 | + - https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/produceSyncCommitteeContribution |
| 84 | +- VC submits new threshold signed attestation, block proposal, or sync duty using the following methods: |
| 85 | + - https://ethereum.github.io/beacon-APIs/#/Beacon/submitPoolAttestations |
| 86 | + - https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/publishBlock |
| 87 | + - https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/produceSyncCommitteeContribution |
| 88 | +""" |
| 89 | + |
| 90 | + |
| 91 | +def cache_attestation_data_for_vc(attestation_data: AttestationData, attestation_duty: AttestationDuty) -> None: |
| 92 | + """Cache attestation data to provide to VC when it seeks new attestation data using the following method: |
| 93 | + https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/produceAttestationData |
73 | 94 | """ |
74 | | - # See note about attestation construction here: |
75 | | - # https://github.com/ethereum/beacon-APIs/blame/05c1bc142e1a3fb2a63c79098743776241341d08/validator-flow.md#L35-L37 |
76 | 95 | pass |
77 | 96 |
|
78 | 97 |
|
79 | | -def vc_sign_block(block: BeaconBlock, proposer_duty: ProposerDuty) -> SignedBeaconBlock: |
80 | | - """Returns a signed beacon block using the validator index given in the proposer duty. |
81 | | - This endpoint does not exist in beacon-APIs. |
| 98 | +def cache_block_for_vc(block: BeaconBlock, proposer_duty: ProposerDuty) -> None: |
| 99 | + """Cache block to provide to VC when it seeks a new block using the following method: |
| 100 | + https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/produceAttestationData |
82 | 101 | """ |
83 | 102 | pass |
| 103 | + |
| 104 | + |
| 105 | +def capture_threshold_signed_attestation(threshold_signed_attestation: Attestation) -> None: |
| 106 | + """Captures a threshold signed attestation provided by the VC and starts the recombination process to |
| 107 | + construct a complete signed attestation to submit to the BN. The VC submits the attestation using the |
| 108 | + following method: https://ethereum.github.io/beacon-APIs/#/Beacon/submitPoolAttestations |
| 109 | + """ |
| 110 | + broadcast_threshold_signed_attestation(threshold_signed_attestation) |
| 111 | + |
| 112 | + |
| 113 | +def capture_threhold_signed_block(threshold_signed_block: SignedBeaconBlock) -> None: |
| 114 | + """Captures a threshold signed block provided by the VC and starts the recombination process to |
| 115 | + construct a complete signed block to submit to the BN. The VC submits the block using the following method: |
| 116 | + https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/publishBlock |
| 117 | + """ |
| 118 | + broadcast_threshold_signed_block(threshold_signed_block) |
0 commit comments