mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
Check seed before shuffle (#5841)
This commit is contained in:
parent
ffa08f5a85
commit
8ce01acbcf
@ -298,13 +298,6 @@ func ShuffledIndices(state *stateTrie.BeaconState, epoch uint64) ([]uint64, erro
|
|||||||
// list with committee index and epoch number. It caches the shuffled indices for current epoch and next epoch.
|
// list with committee index and epoch number. It caches the shuffled indices for current epoch and next epoch.
|
||||||
func UpdateCommitteeCache(state *stateTrie.BeaconState, epoch uint64) error {
|
func UpdateCommitteeCache(state *stateTrie.BeaconState, epoch uint64) error {
|
||||||
for _, e := range []uint64{epoch, epoch + 1} {
|
for _, e := range []uint64{epoch, epoch + 1} {
|
||||||
shuffledIndices, err := ShuffledIndices(state, e)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
count := SlotCommitteeCount(uint64(len(shuffledIndices)))
|
|
||||||
|
|
||||||
seed, err := Seed(state, e, params.BeaconConfig().DomainBeaconAttester)
|
seed, err := Seed(state, e, params.BeaconConfig().DomainBeaconAttester)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -313,6 +306,13 @@ func UpdateCommitteeCache(state *stateTrie.BeaconState, epoch uint64) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shuffledIndices, err := ShuffledIndices(state, e)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
count := SlotCommitteeCount(uint64(len(shuffledIndices)))
|
||||||
|
|
||||||
// Store the sorted indices as well as shuffled indices. In current spec,
|
// Store the sorted indices as well as shuffled indices. In current spec,
|
||||||
// sorted indices is required to retrieve proposer index. This is also
|
// sorted indices is required to retrieve proposer index. This is also
|
||||||
// used for failing verify signature fallback.
|
// used for failing verify signature fallback.
|
||||||
|
Loading…
Reference in New Issue
Block a user