diff --git a/api/eth_transactions.go b/api/eth_transactions.go index 8514af9d8..b7c22968c 100644 --- a/api/eth_transactions.go +++ b/api/eth_transactions.go @@ -14,7 +14,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" builtintypes "github.com/filecoin-project/go-state-types/builtin" - "github.com/filecoin-project/go-state-types/builtin/v8/eam" + "github.com/filecoin-project/go-state-types/builtin/v10/eam" typescrypto "github.com/filecoin-project/go-state-types/crypto" "github.com/filecoin-project/lotus/build" diff --git a/api/eth_transactions_test.go b/api/eth_transactions_test.go index 100656414..23ff1f82b 100644 --- a/api/eth_transactions_test.go +++ b/api/eth_transactions_test.go @@ -12,8 +12,9 @@ import ( "github.com/filecoin-project/go-address" gocrypto "github.com/filecoin-project/go-crypto" - "github.com/filecoin-project/go-state-types/builtin/v8/evm" - init8 "github.com/filecoin-project/go-state-types/builtin/v8/init" + actorstypes "github.com/filecoin-project/go-state-types/actors" + "github.com/filecoin-project/go-state-types/builtin/v10/evm" + init10 "github.com/filecoin-project/go-state-types/builtin/v10/init" crypto1 "github.com/filecoin-project/go-state-types/crypto" "github.com/filecoin-project/lotus/chain/actors" @@ -67,16 +68,16 @@ func TestTransformParams(t *testing.T) { }) require.Nil(t, err) - evmActorCid, ok := actors.GetActorCodeID(actors.Version8, "reward") + evmActorCid, ok := actors.GetActorCodeID(actorstypes.Version10, "reward") require.True(t, ok) - params, err := actors.SerializeParams(&init8.ExecParams{ + params, err := actors.SerializeParams(&init10.ExecParams{ CodeCID: evmActorCid, ConstructorParams: constructorParams, }) require.Nil(t, err) - var exec init8.ExecParams + var exec init10.ExecParams reader := bytes.NewReader(params) err1 := exec.UnmarshalCBOR(reader) require.Nil(t, err1) diff --git a/api/eth_types.go b/api/eth_types.go index c809d777f..fc4d0ad76 100644 --- a/api/eth_types.go +++ b/api/eth_types.go @@ -10,7 +10,6 @@ import ( "strconv" "strings" - "github.com/filecoin-project/go-state-types/builtin" "github.com/ipfs/go-cid" "github.com/multiformats/go-multihash" "github.com/multiformats/go-varint" @@ -20,8 +19,7 @@ import ( "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/builtin" - "github.com/filecoin-project/go-state-types/builtin/v8/eam" - init8 "github.com/filecoin-project/go-state-types/builtin/v8/init" + "github.com/filecoin-project/go-state-types/builtin/v10/eam" "github.com/filecoin-project/lotus/build" ) diff --git a/chain/gen/genesis/genesis.go b/chain/gen/genesis/genesis.go index 32e0d2615..ba21843b3 100644 --- a/chain/gen/genesis/genesis.go +++ b/chain/gen/genesis/genesis.go @@ -676,7 +676,7 @@ func MakeGenesisBlock(ctx context.Context, j journal.Journal, bs bstore.Blocksto func SetupEAM(_ context.Context, nst *state.StateTree) error { // TODO Version10 - codecid, ok := actors.GetActorCodeID(actors.Version8, actors.EamKey) + codecid, ok := actors.GetActorCodeID(actorstypes.Version10, actors.EamKey) if !ok { return fmt.Errorf("failed to get CodeCID for EAM during genesis") } diff --git a/cli/chain.go b/cli/chain.go index 89276dcad..c3b80fd51 100644 --- a/cli/chain.go +++ b/cli/chain.go @@ -29,9 +29,7 @@ import ( "github.com/filecoin-project/go-state-types/big" builtintypes "github.com/filecoin-project/go-state-types/builtin" - evm "github.com/filecoin-project/go-state-types/builtin/v10/evm" - "github.com/filecoin-project/go-state-types/builtin/v8/eam" - init8 "github.com/filecoin-project/go-state-types/builtin/v8/init" + "github.com/filecoin-project/go-state-types/builtin/v10/eam" "github.com/filecoin-project/specs-actors/actors/builtin" "github.com/filecoin-project/specs-actors/actors/builtin/account" @@ -1488,106 +1486,6 @@ var ChainPruneCmd = &cli.Command{ Value: false, Usage: "use moving gc for garbage collecting the coldstore", }, - }, - Action: func(cctx *cli.Context) error { - afmt := NewAppFmt(cctx.App) - - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - if !cctx.Args().Present() { - return fmt.Errorf("must pass the filename containing actor code") - } - - filename := cctx.Args().First() - file, err := os.Open(filename) - if err != nil { - return err - } - defer file.Close() // nolint - - code, err := io.ReadAll(file) - if err != nil { - return err - } - - params, err := actors.SerializeParams(&init8.InstallParams{ - Code: code, - }) - if err != nil { - return xerrors.Errorf("failed to serialize params: %w", err) - } - - var fromAddr address.Address - if from := cctx.String("from"); from == "" { - defaddr, err := api.WalletDefaultAddress(ctx) - if err != nil { - return err - } - - fromAddr = defaddr - } else { - addr, err := address.NewFromString(from) - if err != nil { - return err - } - - fromAddr = addr - } - - msg := &types.Message{ - To: builtin.InitActorAddr, - From: fromAddr, - Value: big.Zero(), - Method: 4, - Params: params, - } - - afmt.Println("sending message...") - smsg, err := api.MpoolPushMessage(ctx, msg, nil) - if err != nil { - return xerrors.Errorf("failed to push message: %w", err) - } - - afmt.Printf("gas limit: %d\n", smsg.Message.GasLimit) - - afmt.Println("waiting for message to execute...") - wait, err := api.StateWaitMsg(ctx, smsg.Cid(), 0) - if err != nil { - return xerrors.Errorf("error waiting for message: %w", err) - } - - // check it executed successfully - if wait.Receipt.ExitCode != 0 { - return xerrors.Errorf("actor installation failed") - } - - var result init8.InstallReturn - r := bytes.NewReader(wait.Receipt.Return) - if err := result.UnmarshalCBOR(r); err != nil { - return xerrors.Errorf("error unmarshaling return value: %w", err) - } - - afmt.Printf("Actor Code CID: %s\n", result.CodeCid) - afmt.Printf("Installed: %t\n", result.Installed) - - return nil - }, -} - -var ChainExecCmd = &cli.Command{ - Name: "create-actor", - Usage: "Create an new actor via the init actor and return its address", - ArgsUsage: "code-cid [params]", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "from", - Usage: "optionally specify the account to use for sending the exec message", - }, &cli.StringFlag{ Name: "move-to", Value: "", diff --git a/node/impl/full/eth.go b/node/impl/full/eth.go index 2c1c6e14a..9b5472e37 100644 --- a/node/impl/full/eth.go +++ b/node/impl/full/eth.go @@ -15,8 +15,8 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" builtintypes "github.com/filecoin-project/go-state-types/builtin" - "github.com/filecoin-project/go-state-types/builtin/v8/eam" - "github.com/filecoin-project/go-state-types/builtin/v8/evm" + "github.com/filecoin-project/go-state-types/builtin/v10/eam" + "github.com/filecoin-project/go-state-types/builtin/v10/evm" "github.com/filecoin-project/specs-actors/actors/builtin" "github.com/filecoin-project/lotus/api"