mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 22:04:44 +00:00
Use all attestation subnets (#1257)
* Update `milagro_bls` to new release (#1183) * Update milagro_bls to new release Signed-off-by: Kirk Baird <baird.k@outlook.com> * Tidy up fake cryptos Signed-off-by: Kirk Baird <baird.k@outlook.com> * move SecretHash to bls and put plaintext back Signed-off-by: Kirk Baird <baird.k@outlook.com> * Update v0.12.0 to v0.12.1 * Add compute_subnet_for_attestation * Replace CommitteeIndex topic with Attestation * Fix warnings * Fix attestation service tests * fmt * Appease clippy * return error from validator_subscriptions * move state out of loop * Fix early break on error * Get state from slot clock * Fix beacon state in attestation tests * Add failing test for lookahead > 1 * Minor change * Address some review comments * Add subnet verification to beacon chain * Move subnet verification to processor * Pass committee_count_at_slot to ValidatorDuty and ValidatorSubscription * Pass subnet id for publishing attestations * Fix attestation service tests * Fix more tests * Fix fork choice test * Remove unused code * Remove more unused and expensive code Co-authored-by: Kirk Baird <baird.k@outlook.com> Co-authored-by: Michael Sproul <michael@sigmaprime.io> Co-authored-by: Age Manning <Age@AgeManning.com> Co-authored-by: Paul Hauner <paul@paulhauner.com>
This commit is contained in:
@@ -22,7 +22,7 @@ use types::{
|
||||
},
|
||||
BeaconBlock, BeaconState, ChainSpec, Domain, Epoch, EthSpec, MinimalEthSpec, PublicKey,
|
||||
RelativeEpoch, Signature, SignedAggregateAndProof, SignedBeaconBlock, SignedRoot, Slot,
|
||||
Validator,
|
||||
SubnetId, Validator,
|
||||
};
|
||||
use version;
|
||||
|
||||
@@ -144,7 +144,16 @@ fn validator_produce_attestation() {
|
||||
))
|
||||
.expect("should fetch duties from http api");
|
||||
let duties = &duties[0];
|
||||
|
||||
let committee_count = duties
|
||||
.committee_count_at_slot
|
||||
.expect("should have committee count");
|
||||
let subnet_id = SubnetId::compute_subnet::<E>(
|
||||
attestation.data.slot,
|
||||
attestation.data.index,
|
||||
committee_count,
|
||||
spec,
|
||||
)
|
||||
.unwrap();
|
||||
// Try publishing the attestation without a signature or a committee bit set, ensure it is
|
||||
// raises an error.
|
||||
let publish_status = env
|
||||
@@ -153,7 +162,7 @@ fn validator_produce_attestation() {
|
||||
remote_node
|
||||
.http
|
||||
.validator()
|
||||
.publish_attestations(vec![attestation.clone()]),
|
||||
.publish_attestations(vec![(attestation.clone(), subnet_id)]),
|
||||
)
|
||||
.expect("should publish unsigned attestation");
|
||||
assert!(
|
||||
@@ -179,7 +188,7 @@ fn validator_produce_attestation() {
|
||||
remote_node
|
||||
.http
|
||||
.validator()
|
||||
.publish_attestations(vec![attestation.clone()]),
|
||||
.publish_attestations(vec![(attestation.clone(), subnet_id)]),
|
||||
)
|
||||
.expect("should publish attestation with invalid signature");
|
||||
assert!(
|
||||
@@ -217,7 +226,7 @@ fn validator_produce_attestation() {
|
||||
remote_node
|
||||
.http
|
||||
.validator()
|
||||
.publish_attestations(vec![attestation.clone()]),
|
||||
.publish_attestations(vec![(attestation.clone(), subnet_id)]),
|
||||
)
|
||||
.expect("should publish attestation");
|
||||
assert!(
|
||||
|
||||
Reference in New Issue
Block a user