diff --git a/build/params_2k.go b/build/params_2k.go index 103dc7802..1a63af5fa 100644 --- a/build/params_2k.go +++ b/build/params_2k.go @@ -6,6 +6,8 @@ import ( "os" "strconv" + "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/lotus/chain/actors/policy" ) @@ -91,3 +93,5 @@ const SlashablePowerDelay = 20 const InteractivePoRepConfidence = 6 const BootstrapPeerThreshold = 1 + +var WhitelistedBlock = cid.Undef diff --git a/build/params_butterfly.go b/build/params_butterfly.go index 579e019b1..3e9dbbbb8 100644 --- a/build/params_butterfly.go +++ b/build/params_butterfly.go @@ -7,6 +7,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/lotus/chain/actors/policy" builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" + "github.com/ipfs/go-cid" ) var DrandSchedule = map[abi.ChainEpoch]DrandEnum{ @@ -51,3 +52,5 @@ const PropagationDelaySecs = uint64(6) // BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start const BootstrapPeerThreshold = 2 + +var WhitelistedBlock = cid.Undef diff --git a/build/params_calibnet.go b/build/params_calibnet.go index 83cf10856..10d29e564 100644 --- a/build/params_calibnet.go +++ b/build/params_calibnet.go @@ -7,6 +7,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/lotus/chain/actors/policy" builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" + "github.com/ipfs/go-cid" ) var DrandSchedule = map[abi.ChainEpoch]DrandEnum{ @@ -62,3 +63,5 @@ const PropagationDelaySecs = uint64(6) // BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start const BootstrapPeerThreshold = 4 + +var WhitelistedBlock = cid.Undef diff --git a/build/params_mainnet.go b/build/params_mainnet.go index 635bbc679..d14b97e0f 100644 --- a/build/params_mainnet.go +++ b/build/params_mainnet.go @@ -81,3 +81,6 @@ const PropagationDelaySecs = uint64(6) // BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start const BootstrapPeerThreshold = 4 + +// we skip checks on message validity in this block to sidestep the zero-bls signature +var WhitelistedBlock = MustParseCid("bafy2bzaceapyg2uyzk7vueh3xccxkuwbz3nxewjyguoxvhx77malc2lzn2ybi") diff --git a/build/params_nerpanet.go b/build/params_nerpanet.go index 1d051a908..385000992 100644 --- a/build/params_nerpanet.go +++ b/build/params_nerpanet.go @@ -5,6 +5,7 @@ package build import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/lotus/chain/actors/policy" + "github.com/ipfs/go-cid" builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" ) @@ -71,3 +72,5 @@ const PropagationDelaySecs = uint64(6) // BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start const BootstrapPeerThreshold = 4 + +var WhitelistedBlock = cid.Undef diff --git a/build/params_shared_funcs.go b/build/params_shared_funcs.go index bcd82bb48..f59fee653 100644 --- a/build/params_shared_funcs.go +++ b/build/params_shared_funcs.go @@ -2,6 +2,7 @@ package build import ( "github.com/filecoin-project/go-address" + "github.com/ipfs/go-cid" "github.com/libp2p/go-libp2p-core/protocol" @@ -28,3 +29,12 @@ func MustParseAddress(addr string) address.Address { return ret } + +func MustParseCid(c string) cid.Cid { + ret, err := cid.Decode(c) + if err != nil { + panic(err) + } + + return ret +} diff --git a/build/params_testground.go b/build/params_testground.go index e7c428368..11a823fcf 100644 --- a/build/params_testground.go +++ b/build/params_testground.go @@ -12,6 +12,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/network" + "github.com/ipfs/go-cid" builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" @@ -105,6 +106,7 @@ var ( Devnet = true ZeroAddress = MustParseAddress("f3yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaby2smx7a") + WhitelistedBlock = cid.Undef BootstrappersFile = "" GenesisFile = "" ) diff --git a/chain/sync.go b/chain/sync.go index 88237eb5a..66c9c18bd 100644 --- a/chain/sync.go +++ b/chain/sync.go @@ -751,6 +751,10 @@ func (syncer *Syncer) ValidateBlock(ctx context.Context, b *types.FullBlock, use } msgsCheck := async.Err(func() error { + if b.Cid() == build.WhitelistedBlock { + return nil + } + if err := syncer.checkBlockMessages(ctx, b, baseTs); err != nil { return xerrors.Errorf("block had invalid messages: %w", err) } diff --git a/cmd/lotus-shed/signatures.go b/cmd/lotus-shed/signatures.go index fa6698cf8..d287e0c3f 100644 --- a/cmd/lotus-shed/signatures.go +++ b/cmd/lotus-shed/signatures.go @@ -90,6 +90,7 @@ var sigsVerifyBlsMsgsCmd = &cli.Command{ return xerrors.New("bls aggregate signature failed to verify") } + fmt.Println("BLS siggys valid!") return nil }, }