Ignore PreGenesis Messages Instead Of Rejecting Them (#7550)

* ignorePreGenesisMessages

* fix test + handelaar's review

* fix issues

* change back

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Nishant Das 2020-10-22 23:43:35 +08:00 committed by GitHub
parent 17a08a75ea
commit 7131cd991c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -169,10 +169,10 @@ func (s *Service) wrapAndReportValidation(topic string, v pubsub.ValidatorEx) (s
messageFailedValidationCounter.WithLabelValues(topic).Inc()
return pubsub.ValidationReject
}
// Reject any messages received before chainstart.
// Ignore any messages received before chainstart.
if !s.chainStarted {
messageFailedValidationCounter.WithLabelValues(topic).Inc()
return pubsub.ValidationReject
return pubsub.ValidationIgnore
}
b := v(ctx, pid, msg)
if b == pubsub.ValidationReject {

View File

@ -280,7 +280,7 @@ func Test_wrapAndReportValidation(t *testing.T) {
},
chainstarted: false,
},
want: pubsub.ValidationReject,
want: pubsub.ValidationIgnore,
},
{
name: "validator panicked",