From 7c9b9e36574b4c9391a15ef7f129f3580b6c6857 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 22 Jan 2021 18:04:07 -0800 Subject: [PATCH] explicitly check miner address protocol This is implicitly checked when verifying the miner signature, but explicitly checking it here makes it clear that this is a protocol requirement, and reduces the chances that it will be accidentally "refactored out". --- chain/sync.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chain/sync.go b/chain/sync.go index e4a8bfb6b..906841f52 100644 --- a/chain/sync.go +++ b/chain/sync.go @@ -676,6 +676,10 @@ func blockSanityChecks(h *types.BlockHeader) error { return xerrors.Errorf("block had nil bls aggregate signature") } + if h.Miner.Protocol() != address.ID { + return xerrors.Errorf("block had non-ID miner address") + } + return nil }