|
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,42 @@ 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 new attestation data or blocks using the following methods: |
| 77 | + - https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/produceAttestationData |
| 78 | + - https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/produceBlockV2 |
| 79 | +- VC submits new threshold signed attestations or blocks using the following methods: |
| 80 | + - https://ethereum.github.io/beacon-APIs/#/Beacon/submitPoolAttestations |
| 81 | + - https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/publishBlock |
| 82 | +""" |
| 83 | + |
| 84 | +def cache_attestation_data_for_vc(attestation_data: AttestationData, attestation_duty: AttestationDuty) -> None: |
| 85 | + """Cache attestation data to provide to VC when it seeks new attestation data using the following method: |
| 86 | + https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/produceAttestationData |
73 | 87 | """ |
74 | | - # See note about attestation construction here: |
75 | | - # https://github.com/ethereum/beacon-APIs/blame/05c1bc142e1a3fb2a63c79098743776241341d08/validator-flow.md#L35-L37 |
76 | 88 | pass |
77 | 89 |
|
78 | 90 |
|
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. |
| 91 | +def cache_block_for_vc(block: BeaconBlock, proposer_duty: ProposerDuty) -> None: |
| 92 | + """Cache block to provide to VC when it seeks a new block using the following method: |
| 93 | + https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/produceAttestationData |
82 | 94 | """ |
83 | 95 | pass |
| 96 | + |
| 97 | + |
| 98 | +def capture_threshold_signed_attestation(threshold_signed_attestation: Attestation) -> None: |
| 99 | + """Captures a threshold signed attestation provided by the VC and starts the recombination process to |
| 100 | + construct a complete signed attestation to submit to the BN. The VC submits the attestation using the following method: |
| 101 | + https://ethereum.github.io/beacon-APIs/#/Beacon/submitPoolAttestations |
| 102 | + """ |
| 103 | + broadcast_threshold_signed_attestation(threshold_signed_attestation) |
| 104 | + |
| 105 | + |
| 106 | +def capture_threhold_signed_block(threshold_signed_block: SignedBeaconBlock) -> None: |
| 107 | + """Captures a threshold signed block provided by the VC and starts the recombination process to |
| 108 | + construct a complete signed block to submit to the BN. The VC submits the block using the following method: |
| 109 | + https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/publishBlock |
| 110 | + """ |
| 111 | + broadcast_threshold_signed_block(threshold_signed_block) |
0 commit comments