mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
validator/client: process Sync Committee roles separately (#13995)
* validator/client: process Sync Committee roles separately In a DV context, to be compatible with the proposed selection endpoint, the VC must push all partial selections to it instead of just one. Process sync committee role separately within the RolesAt method, so that partial selections can be pushed to the DV client appropriately, if configured. * testing/util: re-add erroneously deleted state_test.go * validator/client: fix tests * validator/client: always process sync committee validator Process sync committee duty at slot boundary as well. * don't fail if validator is marked as sync committee but it is not in the list ignore the duty and continue * address code review comments * fix build --------- Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
@@ -1263,9 +1263,11 @@ func TestIsSyncCommitteeAggregator_OK(t *testing.T) {
|
||||
},
|
||||
).Return(ðpb.SyncSubcommitteeIndexResponse{}, nil /*err*/)
|
||||
|
||||
aggregator, err := v.isSyncCommitteeAggregator(context.Background(), slot, bytesutil.ToBytes48(pubKey), 0)
|
||||
aggregator, err := v.isSyncCommitteeAggregator(context.Background(), slot, map[primitives.ValidatorIndex][fieldparams.BLSPubkeyLength]byte{
|
||||
0: bytesutil.ToBytes48(pubKey),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, false, aggregator)
|
||||
require.Equal(t, false, aggregator[0])
|
||||
|
||||
c := params.BeaconConfig().Copy()
|
||||
c.TargetAggregatorsPerSyncSubcommittee = math.MaxUint64
|
||||
@@ -1284,9 +1286,11 @@ func TestIsSyncCommitteeAggregator_OK(t *testing.T) {
|
||||
},
|
||||
).Return(ðpb.SyncSubcommitteeIndexResponse{Indices: []primitives.CommitteeIndex{0}}, nil /*err*/)
|
||||
|
||||
aggregator, err = v.isSyncCommitteeAggregator(context.Background(), slot, bytesutil.ToBytes48(pubKey), 0)
|
||||
aggregator, err = v.isSyncCommitteeAggregator(context.Background(), slot, map[primitives.ValidatorIndex][fieldparams.BLSPubkeyLength]byte{
|
||||
0: bytesutil.ToBytes48(pubKey),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, true, aggregator)
|
||||
require.Equal(t, true, aggregator[0])
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1310,9 +1314,11 @@ func TestIsSyncCommitteeAggregator_Distributed_OK(t *testing.T) {
|
||||
},
|
||||
).Return(ðpb.SyncSubcommitteeIndexResponse{}, nil /*err*/)
|
||||
|
||||
aggregator, err := v.isSyncCommitteeAggregator(context.Background(), slot, bytesutil.ToBytes48(pubKey), 0)
|
||||
aggregator, err := v.isSyncCommitteeAggregator(context.Background(), slot, map[primitives.ValidatorIndex][fieldparams.BLSPubkeyLength]byte{
|
||||
0: bytesutil.ToBytes48(pubKey),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, false, aggregator)
|
||||
require.Equal(t, false, aggregator[0])
|
||||
|
||||
c := params.BeaconConfig().Copy()
|
||||
c.TargetAggregatorsPerSyncSubcommittee = math.MaxUint64
|
||||
@@ -1345,9 +1351,11 @@ func TestIsSyncCommitteeAggregator_Distributed_OK(t *testing.T) {
|
||||
[]iface.SyncCommitteeSelection{selection},
|
||||
).Return([]iface.SyncCommitteeSelection{selection}, nil)
|
||||
|
||||
aggregator, err = v.isSyncCommitteeAggregator(context.Background(), slot, bytesutil.ToBytes48(pubKey), 123)
|
||||
aggregator, err = v.isSyncCommitteeAggregator(context.Background(), slot, map[primitives.ValidatorIndex][fieldparams.BLSPubkeyLength]byte{
|
||||
123: bytesutil.ToBytes48(pubKey),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, true, aggregator)
|
||||
require.Equal(t, true, aggregator[123])
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user