mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-24 20:37:17 +00:00
Do Not Propose if Assigned to Genesis Slot (#1989)
* do not propose if assigned to genesis * fix bitset * revert bitset * regress test * rem commented blocks
This commit is contained in:
parent
d5c05f083b
commit
ef8232ae2e
@ -23,6 +23,10 @@ import (
|
||||
// the state root computation, and finally signed by the validator before being
|
||||
// sent back to the beacon node for broadcasting.
|
||||
func (v *validator) ProposeBlock(ctx context.Context, slot uint64) {
|
||||
if slot == params.BeaconConfig().GenesisSlot {
|
||||
log.Info("Assigned to genesis slot, skipping proposal")
|
||||
return
|
||||
}
|
||||
ctx, span := trace.StartSpan(ctx, "validator.ProposeBlock")
|
||||
defer span.End()
|
||||
log.Info("Proposing...")
|
||||
|
@ -43,6 +43,15 @@ func setup(t *testing.T) (*validator, *mocks, func()) {
|
||||
return validator, m, ctrl.Finish
|
||||
}
|
||||
|
||||
func TestProposeBlock_DoesNotProposeGenesisBlock(t *testing.T) {
|
||||
hook := logTest.NewGlobal()
|
||||
validator, _, finish := setup(t)
|
||||
defer finish()
|
||||
validator.ProposeBlock(context.Background(), params.BeaconConfig().GenesisSlot)
|
||||
|
||||
testutil.AssertLogsContain(t, hook, "Assigned to genesis slot, skipping proposal")
|
||||
}
|
||||
|
||||
func TestProposeBlock_LogsCanonicalHeadFailure(t *testing.T) {
|
||||
hook := logTest.NewGlobal()
|
||||
validator, m, finish := setup(t)
|
||||
|
Loading…
Reference in New Issue
Block a user