diff --git a/venus-devtool/state-type-gen/main.go b/venus-devtool/state-type-gen/main.go index d12482faaa..b8b57abdaf 100644 --- a/venus-devtool/state-type-gen/main.go +++ b/venus-devtool/state-type-gen/main.go @@ -55,8 +55,8 @@ var pendingPkgs = func() map[string]*pendingPkg { for _, pkgName := range list { pkgs[pkgName] = &pendingPkg{ name: pkgName, - ver: actors.Version(actors.LatestVersion), - path: fmt.Sprintf("%s/v%v/%s", prePath, actors.LatestVersion, pkgName), + ver: actors.Version(actors.Version9), + path: fmt.Sprintf("%s/v%v/%s", prePath, actors.Version9, pkgName), } } diff --git a/venus-shared/api/chain/v0/method.md b/venus-shared/api/chain/v0/method.md index 6a7410562c..1f069735d2 100644 --- a/venus-shared/api/chain/v0/method.md +++ b/venus-shared/api/chain/v0/method.md @@ -265,7 +265,8 @@ Response: "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Nonce": 42, - "Balance": "0" + "Balance": "0", + "Address": "\u003cempty\u003e" } ``` @@ -995,7 +996,8 @@ Response: "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Nonce": 42, - "Balance": "0" + "Balance": "0", + "Address": "\u003cempty\u003e" } ``` @@ -1159,7 +1161,8 @@ Response: "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Nonce": 42, - "Balance": "0" + "Balance": "0", + "Address": "\u003cempty\u003e" } ``` @@ -1308,7 +1311,7 @@ Perms: read Inputs: ```json [ - 17 + 18 ] ``` @@ -1323,7 +1326,7 @@ Perms: read Inputs: ```json [ - 17 + 18 ] ``` @@ -1605,7 +1608,7 @@ Inputs: ] ``` -Response: `17` +Response: `18` ### StateSearchMsg diff --git a/venus-shared/api/chain/v0/mock/mock_fullnode.go b/venus-shared/api/chain/v0/mock/mock_fullnode.go index 6ccc45e475..3c1d3b5047 100644 --- a/venus-shared/api/chain/v0/mock/mock_fullnode.go +++ b/venus-shared/api/chain/v0/mock/mock_fullnode.go @@ -544,10 +544,10 @@ func (mr *MockFullNodeMockRecorder) GasEstimateMessageGas(arg0, arg1, arg2, arg3 } // GetActor mocks base method. -func (m *MockFullNode) GetActor(arg0 context.Context, arg1 address.Address) (*internal.Actor, error) { +func (m *MockFullNode) GetActor(arg0 context.Context, arg1 address.Address) (*internal.ActorV5, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetActor", arg0, arg1) - ret0, _ := ret[0].(*internal.Actor) + ret0, _ := ret[0].(*internal.ActorV5) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -589,10 +589,10 @@ func (mr *MockFullNodeMockRecorder) GetFullBlock(arg0, arg1 interface{}) *gomock } // GetParentStateRootActor mocks base method. -func (m *MockFullNode) GetParentStateRootActor(arg0 context.Context, arg1 *types.TipSet, arg2 address.Address) (*internal.Actor, error) { +func (m *MockFullNode) GetParentStateRootActor(arg0 context.Context, arg1 *types.TipSet, arg2 address.Address) (*internal.ActorV5, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetParentStateRootActor", arg0, arg1, arg2) - ret0, _ := ret[0].(*internal.Actor) + ret0, _ := ret[0].(*internal.ActorV5) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -633,10 +633,10 @@ func (mr *MockFullNodeMockRecorder) ID(arg0 interface{}) *gomock.Call { } // ListActor mocks base method. -func (m *MockFullNode) ListActor(arg0 context.Context) (map[address.Address]*internal.Actor, error) { +func (m *MockFullNode) ListActor(arg0 context.Context) (map[address.Address]*internal.ActorV5, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListActor", arg0) - ret0, _ := ret[0].(map[address.Address]*internal.Actor) + ret0, _ := ret[0].(map[address.Address]*internal.ActorV5) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -1849,10 +1849,10 @@ func (mr *MockFullNodeMockRecorder) StateDealProviderCollateralBounds(arg0, arg1 } // StateGetActor mocks base method. -func (m *MockFullNode) StateGetActor(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*internal.Actor, error) { +func (m *MockFullNode) StateGetActor(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*internal.ActorV5, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateGetActor", arg0, arg1, arg2) - ret0, _ := ret[0].(*internal.Actor) + ret0, _ := ret[0].(*internal.ActorV5) ret1, _ := ret[1].(error) return ret0, ret1 } diff --git a/venus-shared/api/chain/v1/method.md b/venus-shared/api/chain/v1/method.md index 0e5453c848..8eee9594ec 100644 --- a/venus-shared/api/chain/v1/method.md +++ b/venus-shared/api/chain/v1/method.md @@ -276,7 +276,8 @@ Response: "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Nonce": 42, - "Balance": "0" + "Balance": "0", + "Address": "\u003cempty\u003e" } ``` @@ -965,7 +966,8 @@ Response: "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Nonce": 42, - "Balance": "0" + "Balance": "0", + "Address": "\u003cempty\u003e" } ``` @@ -1129,7 +1131,8 @@ Response: "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Nonce": 42, - "Balance": "0" + "Balance": "0", + "Address": "\u003cempty\u003e" } ``` @@ -1278,7 +1281,7 @@ Perms: read Inputs: ```json [ - 17 + 18 ] ``` @@ -1293,7 +1296,7 @@ Perms: read Inputs: ```json [ - 17 + 18 ] ``` @@ -1615,7 +1618,7 @@ Inputs: ] ``` -Response: `17` +Response: `18` ### StateSearchMsg StateSearchMsg looks back up to limit epochs in the chain for a message, and returns its receipt and the tipset where it was executed @@ -2936,7 +2939,8 @@ Response: "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Nonce": 42, - "Balance": "0" + "Balance": "0", + "Address": "\u003cempty\u003e" } } ``` diff --git a/venus-shared/api/chain/v1/mock/mock_fullnode.go b/venus-shared/api/chain/v1/mock/mock_fullnode.go index a772cd0a02..9e73c0e7ff 100644 --- a/venus-shared/api/chain/v1/mock/mock_fullnode.go +++ b/venus-shared/api/chain/v1/mock/mock_fullnode.go @@ -515,10 +515,10 @@ func (mr *MockFullNodeMockRecorder) GasEstimateMessageGas(arg0, arg1, arg2, arg3 } // GetActor mocks base method. -func (m *MockFullNode) GetActor(arg0 context.Context, arg1 address.Address) (*internal.Actor, error) { +func (m *MockFullNode) GetActor(arg0 context.Context, arg1 address.Address) (*internal.ActorV5, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetActor", arg0, arg1) - ret0, _ := ret[0].(*internal.Actor) + ret0, _ := ret[0].(*internal.ActorV5) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -560,10 +560,10 @@ func (mr *MockFullNodeMockRecorder) GetFullBlock(arg0, arg1 interface{}) *gomock } // GetParentStateRootActor mocks base method. -func (m *MockFullNode) GetParentStateRootActor(arg0 context.Context, arg1 *types.TipSet, arg2 address.Address) (*internal.Actor, error) { +func (m *MockFullNode) GetParentStateRootActor(arg0 context.Context, arg1 *types.TipSet, arg2 address.Address) (*internal.ActorV5, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetParentStateRootActor", arg0, arg1, arg2) - ret0, _ := ret[0].(*internal.Actor) + ret0, _ := ret[0].(*internal.ActorV5) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -604,10 +604,10 @@ func (mr *MockFullNodeMockRecorder) ID(arg0 interface{}) *gomock.Call { } // ListActor mocks base method. -func (m *MockFullNode) ListActor(arg0 context.Context) (map[address.Address]*internal.Actor, error) { +func (m *MockFullNode) ListActor(arg0 context.Context) (map[address.Address]*internal.ActorV5, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListActor", arg0) - ret0, _ := ret[0].(map[address.Address]*internal.Actor) + ret0, _ := ret[0].(map[address.Address]*internal.ActorV5) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -1880,10 +1880,10 @@ func (mr *MockFullNodeMockRecorder) StateCall(arg0, arg1, arg2 interface{}) *gom } // StateChangedActors mocks base method. -func (m *MockFullNode) StateChangedActors(arg0 context.Context, arg1, arg2 cid.Cid) (map[string]internal.Actor, error) { +func (m *MockFullNode) StateChangedActors(arg0 context.Context, arg1, arg2 cid.Cid) (map[string]internal.ActorV5, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateChangedActors", arg0, arg1, arg2) - ret0, _ := ret[0].(map[string]internal.Actor) + ret0, _ := ret[0].(map[string]internal.ActorV5) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -1970,10 +1970,10 @@ func (mr *MockFullNodeMockRecorder) StateEncodeParams(arg0, arg1, arg2, arg3 int } // StateGetActor mocks base method. -func (m *MockFullNode) StateGetActor(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*internal.Actor, error) { +func (m *MockFullNode) StateGetActor(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (*internal.ActorV5, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateGetActor", arg0, arg1, arg2) - ret0, _ := ret[0].(*internal.Actor) + ret0, _ := ret[0].(*internal.ActorV5) ret1, _ := ret[1].(error) return ret0, ret1 } diff --git a/venus-shared/api/gateway/v1/method.md b/venus-shared/api/gateway/v1/method.md index c65366faad..b98755eaf2 100644 --- a/venus-shared/api/gateway/v1/method.md +++ b/venus-shared/api/gateway/v1/method.md @@ -197,7 +197,7 @@ Inputs: ], "Bw==", 10101, - 17 + 18 ] ``` diff --git a/venus-shared/api/gateway/v2/method.md b/venus-shared/api/gateway/v2/method.md index c65366faad..b98755eaf2 100644 --- a/venus-shared/api/gateway/v2/method.md +++ b/venus-shared/api/gateway/v2/method.md @@ -197,7 +197,7 @@ Inputs: ], "Bw==", 10101, - 17 + 18 ] ``` diff --git a/venus-shared/compatible-checks/api-diff.txt b/venus-shared/compatible-checks/api-diff.txt index 92de4ff872..4096fc76fe 100644 --- a/venus-shared/compatible-checks/api-diff.txt +++ b/venus-shared/compatible-checks/api-diff.txt @@ -84,7 +84,6 @@ github.com/filecoin-project/venus/venus-shared/api/chain/v0.FullNode <> github.c - StateChangedActors - StateCompute - StateDecodeParams - > StateGetActor {[func(context.Context, address.Address, types.TipSetKey) (*internal.Actor, error) <> func(context.Context, address.Address, types.TipSetKey) (*types.ActorV5, error)] base=func out type: #0 input; nested={[*internal.Actor <> *types.ActorV5] base=pointed type; nested={[internal.Actor <> types.ActorV5] base=struct field; nested={[internal.Actor <> types.ActorV5] base=exported fields count: 4 != 5; nested=nil}}}} > StateGetNetworkParams {[func(context.Context) (*types.NetworkParams, error) <> func(context.Context) (*api.NetworkParams, error)] base=func out type: #0 input; nested={[*types.NetworkParams <> *api.NetworkParams] base=pointed type; nested={[types.NetworkParams <> api.NetworkParams] base=struct field; nested={[types.NetworkParams <> api.NetworkParams] base=exported field type: #5 field named ForkUpgradeParams; nested={[types.ForkUpgradeParams <> api.ForkUpgradeParams] base=struct field; nested={[types.ForkUpgradeParams <> api.ForkUpgradeParams] base=exported fields count: 21 != 22; nested=nil}}}}}} - StateGetRandomnessFromBeacon - StateGetRandomnessFromTickets @@ -200,9 +199,7 @@ github.com/filecoin-project/venus/venus-shared/api/chain/v1.FullNode <> github.c + SetConcurrent + SetPassword - Shutdown - > StateChangedActors {[func(context.Context, cid.Cid, cid.Cid) (map[string]internal.Actor, error) <> func(context.Context, cid.Cid, cid.Cid) (map[string]types.ActorV5, error)] base=func out type: #0 input; nested={[map[string]internal.Actor <> map[string]types.ActorV5] base=map value; nested={[internal.Actor <> types.ActorV5] base=struct field; nested={[internal.Actor <> types.ActorV5] base=exported fields count: 4 != 5; nested=nil}}}} - StateCompute - > StateGetActor {[func(context.Context, address.Address, types.TipSetKey) (*internal.Actor, error) <> func(context.Context, address.Address, types.TipSetKey) (*types.ActorV5, error)] base=func out type: #0 input; nested={[*internal.Actor <> *types.ActorV5] base=pointed type; nested={[internal.Actor <> types.ActorV5] base=struct field; nested={[internal.Actor <> types.ActorV5] base=exported fields count: 4 != 5; nested=nil}}}} > StateGetNetworkParams {[func(context.Context) (*types.NetworkParams, error) <> func(context.Context) (*api.NetworkParams, error)] base=func out type: #0 input; nested={[*types.NetworkParams <> *api.NetworkParams] base=pointed type; nested={[types.NetworkParams <> api.NetworkParams] base=struct field; nested={[types.NetworkParams <> api.NetworkParams] base=exported field type: #5 field named ForkUpgradeParams; nested={[types.ForkUpgradeParams <> api.ForkUpgradeParams] base=struct field; nested={[types.ForkUpgradeParams <> api.ForkUpgradeParams] base=exported fields count: 21 != 22; nested=nil}}}}}} + StateMinerSectorSize + StateMinerWorkerAddress diff --git a/venus-shared/types/state_types_gen.go b/venus-shared/types/state_types_gen.go index 955f388f4f..6292af3732 100755 --- a/venus-shared/types/state_types_gen.go +++ b/venus-shared/types/state_types_gen.go @@ -8,7 +8,7 @@ import ( "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" ) -////////// market ////////// +// //////// market ////////// const ( DealMaxLabelSize = market.DealMaxLabelSize EpochUndefined = market.EpochUndefined @@ -55,7 +55,7 @@ var ( ValidateDealsForActivation = market.ValidateDealsForActivation ) -////////// miner ////////// +// //////// miner ////////// const ( AddressedPartitionsMax = miner.AddressedPartitionsMax AddressedSectorsMax = miner.AddressedSectorsMax @@ -169,7 +169,7 @@ var ( SectorKey = miner.SectorKey ) -////////// paych ////////// +// //////// paych ////////// const ( LaneStatesAmtBitwidth = paych.LaneStatesAmtBitwidth SettleDelay = paych.SettleDelay @@ -184,7 +184,7 @@ type ( UpdateChannelStateParams = paych.UpdateChannelStateParams ) -////////// verifreg ////////// +// //////// verifreg ////////// const ( EndOfLifeClaimDropPeriod = verifreg.EndOfLifeClaimDropPeriod MaximumVerifiedAllocationExpiration = verifreg.MaximumVerifiedAllocationExpiration diff --git a/venus-shared/utils/method_map_test.go b/venus-shared/utils/method_map_test.go index 68f2c602de..8b8839d406 100644 --- a/venus-shared/utils/method_map_test.go +++ b/venus-shared/utils/method_map_test.go @@ -12,18 +12,30 @@ import ( func TestMethodMap(t *testing.T) { tf.UnitTest(t) - t.Run("Default to load mainnet v8 actors", func(t *testing.T) { + // 没有把actor注入,等注入后移除 + skipEvmActor := func(name string) bool { + if name == actors.EamKey || name == actors.EvmKey || name == actors.EmbryoKey { + return true + } + return false + } + + t.Run("Default to load mainnet actors", func(t *testing.T) { for _, actorsMetadata := range actors.EmbeddedBuiltinActorsMetadata { if actorsMetadata.Network == string(types.NetworkNameMain) { - for _, actor := range actorsMetadata.Actors { + for name, actor := range actorsMetadata.Actors { _, ok := MethodsMap[actor] - assert.True(t, ok) + if skipEvmActor(name) { + assert.False(t, ok) + } else { + assert.True(t, ok) + } } } } }) - t.Run("ReLoad butterflynet v8 actors", func(t *testing.T) { + t.Run("ReLoad butterflynet actors", func(t *testing.T) { for _, actorsMetadata := range actors.EmbeddedBuiltinActorsMetadata { if actorsMetadata.Network == string(types.NetworkNameButterfly) { for _, actor := range actorsMetadata.Actors { @@ -37,9 +49,13 @@ func TestMethodMap(t *testing.T) { ReloadMethodsMap() for _, actorsMetadata := range actors.EmbeddedBuiltinActorsMetadata { if actorsMetadata.Network == string(types.NetworkNameButterfly) { - for _, actor := range actorsMetadata.Actors { + for name, actor := range actorsMetadata.Actors { _, ok := MethodsMap[actor] - assert.True(t, ok) + if skipEvmActor(name) { + assert.False(t, ok) + } else { + assert.True(t, ok) + } } } }