mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 10:11:44 +00:00
[Altair] Sync committee pools (#2321)
Add pools supporting sync committees: - naive sync aggregation pool - observed sync contributions pool - observed sync contributors pool - observed sync aggregators pool Add SSZ types and tests related to sync committee signatures. Co-authored-by: Michael Sproul <michael@sigmaprime.io> Co-authored-by: realbigsean <seananderson33@gmail.com>
This commit is contained in:
@@ -553,14 +553,14 @@ fn import_gossip_block_at_current_slot() {
|
||||
fn import_gossip_attestation() {
|
||||
let mut rig = TestRig::new(SMALL_CHAIN);
|
||||
|
||||
let initial_attns = rig.chain.naive_aggregation_pool.read().num_attestations();
|
||||
let initial_attns = rig.chain.naive_aggregation_pool.read().num_items();
|
||||
|
||||
rig.enqueue_unaggregated_attestation();
|
||||
|
||||
rig.assert_event_journal(&[GOSSIP_ATTESTATION, WORKER_FREED, NOTHING_TO_DO]);
|
||||
|
||||
assert_eq!(
|
||||
rig.chain.naive_aggregation_pool.read().num_attestations(),
|
||||
rig.chain.naive_aggregation_pool.read().num_items(),
|
||||
initial_attns + 1,
|
||||
"op pool should have one more attestation"
|
||||
);
|
||||
@@ -578,14 +578,14 @@ fn attestation_to_unknown_block_processed(import_method: BlockImportMethod) {
|
||||
|
||||
// Send the attestation but not the block, and check that it was not imported.
|
||||
|
||||
let initial_attns = rig.chain.naive_aggregation_pool.read().num_attestations();
|
||||
let initial_attns = rig.chain.naive_aggregation_pool.read().num_items();
|
||||
|
||||
rig.enqueue_next_block_unaggregated_attestation();
|
||||
|
||||
rig.assert_event_journal(&[GOSSIP_ATTESTATION, WORKER_FREED, NOTHING_TO_DO]);
|
||||
|
||||
assert_eq!(
|
||||
rig.chain.naive_aggregation_pool.read().num_attestations(),
|
||||
rig.chain.naive_aggregation_pool.read().num_items(),
|
||||
initial_attns,
|
||||
"Attestation should not have been included."
|
||||
);
|
||||
@@ -616,7 +616,7 @@ fn attestation_to_unknown_block_processed(import_method: BlockImportMethod) {
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
rig.chain.naive_aggregation_pool.read().num_attestations(),
|
||||
rig.chain.naive_aggregation_pool.read().num_items(),
|
||||
initial_attns + 1,
|
||||
"Attestation should have been included."
|
||||
);
|
||||
@@ -707,14 +707,14 @@ fn requeue_unknown_block_gossip_attestation_without_import() {
|
||||
|
||||
// Send the attestation but not the block, and check that it was not imported.
|
||||
|
||||
let initial_attns = rig.chain.naive_aggregation_pool.read().num_attestations();
|
||||
let initial_attns = rig.chain.naive_aggregation_pool.read().num_items();
|
||||
|
||||
rig.enqueue_next_block_unaggregated_attestation();
|
||||
|
||||
rig.assert_event_journal(&[GOSSIP_ATTESTATION, WORKER_FREED, NOTHING_TO_DO]);
|
||||
|
||||
assert_eq!(
|
||||
rig.chain.naive_aggregation_pool.read().num_attestations(),
|
||||
rig.chain.naive_aggregation_pool.read().num_items(),
|
||||
initial_attns,
|
||||
"Attestation should not have been included."
|
||||
);
|
||||
@@ -727,7 +727,7 @@ fn requeue_unknown_block_gossip_attestation_without_import() {
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
rig.chain.naive_aggregation_pool.read().num_attestations(),
|
||||
rig.chain.naive_aggregation_pool.read().num_items(),
|
||||
initial_attns,
|
||||
"Attestation should not have been included."
|
||||
);
|
||||
@@ -748,7 +748,7 @@ fn requeue_unknown_block_gossip_aggregated_attestation_without_import() {
|
||||
rig.assert_event_journal(&[GOSSIP_AGGREGATE, WORKER_FREED, NOTHING_TO_DO]);
|
||||
|
||||
assert_eq!(
|
||||
rig.chain.naive_aggregation_pool.read().num_attestations(),
|
||||
rig.chain.naive_aggregation_pool.read().num_items(),
|
||||
initial_attns,
|
||||
"Attestation should not have been included."
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user