From 2ca70e600d6c94d732909109b26d9a5de9628c5a Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Thu, 18 Feb 2021 15:36:16 -0500 Subject: [PATCH] Move the zero bls actor creation check into the VM --- chain/vm/mkactor.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chain/vm/mkactor.go b/chain/vm/mkactor.go index 072711db6..0e72b0c4b 100644 --- a/chain/vm/mkactor.go +++ b/chain/vm/mkactor.go @@ -3,6 +3,10 @@ package vm import ( "context" + "github.com/filecoin-project/go-state-types/network" + + "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/exitcode" "github.com/filecoin-project/lotus/chain/actors" @@ -39,6 +43,10 @@ func TryCreateAccountActor(rt *Runtime, addr address.Address) (*types.Actor, add return nil, address.Undef, err } + if addr == build.ZeroAddress && rt.NetworkVersion() >= network.Version10 { + return nil, address.Undef, aerrors.New(exitcode.ErrIllegalArgument, "cannot create the zero bls actor") + } + addrID, err := rt.state.RegisterNewAddress(addr) if err != nil { return nil, address.Undef, aerrors.Escalate(err, "registering actor address")