Merge pull request #7379 from filecoin-project/asr/msg-header

Sync: Sanity check msg siggy type
This commit is contained in:
Łukasz Magiera 2021-09-22 23:32:25 +01:00 committed by GitHub
commit 381638abea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -530,6 +530,12 @@ func (filec *FilecoinEC) checkBlockMessages(ctx context.Context, b *types.FullBl
smArr := blockadt.MakeEmptyArray(tmpstore)
for i, m := range b.SecpkMessages {
if filec.sm.GetNtwkVersion(ctx, b.Header.Height) >= network.Version14 {
if m.Signature.Type != crypto.SigTypeSecp256k1 {
return xerrors.Errorf("block had invalid secpk message at index %d: %w", i, err)
}
}
if err := checkMsg(m); err != nil {
return xerrors.Errorf("block had invalid secpk message at index %d: %w", i, err)
}