diff --git a/api/fullnode.go b/api/fullnode.go index 9da0f197..e5936681 100644 --- a/api/fullnode.go +++ b/api/fullnode.go @@ -2,7 +2,6 @@ package api import ( "context" - "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" "github.com/filecoin-project/go-jsonrpc/auth" @@ -10,7 +9,8 @@ import ( "github.com/filecoin-project/go-state-types/crypto" "github.com/filecoin-project/go-state-types/dline" stnetwork "github.com/filecoin-project/go-state-types/network" - + "github.com/filecoin-project/venus/venus-shared/actors/builtin/miner" + "github.com/filecoin-project/venus/venus-shared/types" "github.com/google/uuid" "github.com/ipfs/go-cid" metrics "github.com/libp2p/go-libp2p-core/metrics" @@ -18,10 +18,6 @@ import ( "github.com/libp2p/go-libp2p-core/peer" protocol "github.com/libp2p/go-libp2p-core/protocol" - "github.com/filecoin-project/venus/app/submodule/apitypes" - "github.com/filecoin-project/venus/venus-shared/actors/builtin/miner" - "github.com/filecoin-project/venus/venus-shared/types" - types2 "github.com/filecoin-project/venus-sealer/types" ) @@ -354,9 +350,6 @@ type FullNode interface { StateGetReceipt(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error) // StateMinerSectorCount returns the number of sectors in a miner's sector set and proving set StateMinerSectorCount(context.Context, address.Address, types.TipSetKey) (types.MinerSectors, error) - // StateCompute is a flexible command that applies the given messages on the given tipset. - // The messages are run as though the VM were at the provided height. - StateCompute(context.Context, abi.ChainEpoch, []*types.Message, types.TipSetKey) (*apitypes.ComputeStateOutput, error) // StateVerifierStatus returns the data cap for the given address. // Returns nil if there is no entry in the data cap table for the // address. @@ -619,7 +612,6 @@ type FullNodeStruct struct { StateMinerSectorCount func(context.Context, address.Address, types.TipSetKey) (types.MinerSectors, error) `perm:"read"` StateListMessages func(ctx context.Context, match *MessageMatch, tsk types.TipSetKey, toht abi.ChainEpoch) ([]cid.Cid, error) `perm:"read"` StateDecodeParams func(context.Context, address.Address, abi.MethodNum, []byte, types.TipSetKey) (interface{}, error) `perm:"read"` - StateCompute func(context.Context, abi.ChainEpoch, []*types.Message, types.TipSetKey) (*apitypes.ComputeStateOutput, error) `perm:"read"` StateVerifierStatus func(context.Context, address.Address, types.TipSetKey) (*abi.StoragePower, error) `perm:"read"` StateVerifiedClientStatus func(context.Context, address.Address, types.TipSetKey) (*abi.StoragePower, error) `perm:"read"` StateVerifiedRegistryRootKey func(ctx context.Context, tsk types.TipSetKey) (address.Address, error) `perm:"read"` @@ -1167,10 +1159,6 @@ func (c *FullNodeStruct) StateDecodeParams(ctx context.Context, toAddr address.A return c.Internal.StateDecodeParams(ctx, toAddr, method, params, tsk) } -func (c *FullNodeStruct) StateCompute(ctx context.Context, height abi.ChainEpoch, msgs []*types.Message, tsk types.TipSetKey) (*apitypes.ComputeStateOutput, error) { - return c.Internal.StateCompute(ctx, height, msgs, tsk) -} - func (c *FullNodeStruct) StateVerifierStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) { return c.Internal.StateVerifierStatus(ctx, addr, tsk) } diff --git a/api/impl/strageminer.go b/api/impl/strageminer.go index a5d6a6fc..6c0cf63b 100644 --- a/api/impl/strageminer.go +++ b/api/impl/strageminer.go @@ -3,6 +3,7 @@ package impl import ( "context" "encoding/json" + "github.com/filecoin-project/venus/venus-shared/types/messager" "net/http" "strconv" "time" @@ -27,11 +28,6 @@ import ( api4 "github.com/filecoin-project/venus-market/api" types4 "github.com/filecoin-project/venus-market/types" - "github.com/filecoin-project/venus/venus-shared/actors/builtin" - "github.com/filecoin-project/venus/venus-shared/types" - - types3 "github.com/filecoin-project/venus-messager/types" - "github.com/filecoin-project/venus-sealer/api" "github.com/filecoin-project/venus-sealer/config" sectorstorage "github.com/filecoin-project/venus-sealer/sector-storage" @@ -43,6 +39,8 @@ import ( "github.com/filecoin-project/venus-sealer/storage-sealing/sealiface" "github.com/filecoin-project/venus-sealer/storage/sectorblocks" types2 "github.com/filecoin-project/venus-sealer/types" + "github.com/filecoin-project/venus/venus-shared/actors/builtin" + "github.com/filecoin-project/venus/venus-shared/types" ) var log = logging.Logger("sealer") @@ -819,11 +817,11 @@ func (sm *StorageMinerAPI) MessagerWaitMessage(ctx context.Context, uuid string, }, nil } -func (sm *StorageMinerAPI) MessagerPushMessage(ctx context.Context, msg *types.Message, meta *types3.MsgMeta) (string, error) { - return sm.Messager.PushMessage(ctx, msg, meta) +func (sm *StorageMinerAPI) MessagerPushMessage(ctx context.Context, msg *types.Message, spec *messager.SendSpec) (string, error) { + return sm.Messager.PushMessage(ctx, msg, spec) } -func (sm *StorageMinerAPI) MessagerGetMessage(ctx context.Context, uuid string) (*types3.Message, error) { +func (sm *StorageMinerAPI) MessagerGetMessage(ctx context.Context, uuid string) (*messager.Message, error) { msg, err := sm.Messager.GetMessageByUid(ctx, uuid) if err != nil { return nil, err diff --git a/api/messager-client.go b/api/messager-client.go index 04101d7d..f25dfc28 100644 --- a/api/messager-client.go +++ b/api/messager-client.go @@ -2,29 +2,23 @@ package api import ( "context" - "time" - - "golang.org/x/xerrors" - "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-jsonrpc" - - "github.com/filecoin-project/venus-sealer/config" - - "github.com/ipfs-force-community/venus-common-utils/apiinfo" - "github.com/filecoin-project/venus-messager/api/client" - types2 "github.com/filecoin-project/venus-messager/types" - + "github.com/filecoin-project/venus-sealer/config" "github.com/filecoin-project/venus/venus-shared/types" + "github.com/filecoin-project/venus/venus-shared/types/messager" + "github.com/ipfs-force-community/venus-common-utils/apiinfo" + "golang.org/x/xerrors" + "time" ) type IMessager interface { WalletHas(ctx context.Context, addr address.Address) (bool, error) - WaitMessage(ctx context.Context, id string, confidence uint64) (*types2.Message, error) - PushMessage(ctx context.Context, msg *types.Message, meta *types2.MsgMeta) (string, error) - PushMessageWithId(ctx context.Context, id string, msg *types.Message, meta *types2.MsgMeta) (string, error) - GetMessageByUid(ctx context.Context, id string) (*types2.Message, error) + WaitMessage(ctx context.Context, id string, confidence uint64) (*messager.Message, error) + PushMessage(ctx context.Context, msg *types.Message, spec *messager.SendSpec) (string, error) + PushMessageWithId(ctx context.Context, id string, msg *types.Message, spec *messager.SendSpec) (string, error) + GetMessageByUid(ctx context.Context, id string) (*messager.Message, error) } var _ IMessager = (*Messager)(nil) @@ -37,7 +31,7 @@ func NewMessager(in client.IMessager) *Messager { return &Messager{in: in} } -func (message *Messager) WaitMessage(ctx context.Context, id string, confidence uint64) (*types2.Message, error) { +func (message *Messager) WaitMessage(ctx context.Context, id string, confidence uint64) (*messager.Message, error) { tm := time.NewTicker(time.Second * 30) defer tm.Stop() @@ -56,22 +50,22 @@ func (message *Messager) WaitMessage(ctx context.Context, id string, confidence switch msg.State { //OffChain - case types2.FillMsg: + case messager.FillMsg: fallthrough - case types2.UnFillMsg: + case messager.UnFillMsg: fallthrough - case types2.UnKnown: + case messager.UnKnown: continue //OnChain - case types2.ReplacedMsg: + case messager.ReplacedMsg: fallthrough - case types2.OnChainMsg: + case messager.OnChainMsg: if msg.Confidence > int64(confidence) { return msg, nil } continue //Error - case types2.FailedMsg: + case messager.FailedMsg: var reason string if msg.Receipt != nil { reason = string(msg.Receipt.Return) @@ -91,15 +85,15 @@ func (m *Messager) WalletHas(ctx context.Context, addr address.Address) (bool, e return m.in.WalletHas(ctx, addr) } -func (m *Messager) PushMessage(ctx context.Context, msg *types.Message, meta *types2.MsgMeta) (string, error) { - return m.in.PushMessage(ctx, msg, meta) +func (m *Messager) PushMessage(ctx context.Context, msg *types.Message, spec *messager.SendSpec) (string, error) { + return m.in.PushMessage(ctx, msg, spec) } -func (m *Messager) PushMessageWithId(ctx context.Context, id string, msg *types.Message, meta *types2.MsgMeta) (string, error) { - return m.in.PushMessageWithId(ctx, id, msg, meta) +func (m *Messager) PushMessageWithId(ctx context.Context, id string, msg *types.Message, spec *messager.SendSpec) (string, error) { + return m.in.PushMessageWithId(ctx, id, msg, spec) } -func (m *Messager) GetMessageByUid(ctx context.Context, id string) (*types2.Message, error) { +func (m *Messager) GetMessageByUid(ctx context.Context, id string) (*messager.Message, error) { return m.in.GetMessageByUid(ctx, id) } diff --git a/api/storage_struct.go b/api/storage_struct.go index 74cb1841..ede44644 100644 --- a/api/storage_struct.go +++ b/api/storage_struct.go @@ -2,6 +2,7 @@ package api import ( "context" + "github.com/filecoin-project/venus/venus-shared/types/messager" "golang.org/x/xerrors" "time" @@ -12,13 +13,8 @@ import ( "github.com/filecoin-project/go-fil-markets/piecestore" "github.com/filecoin-project/go-state-types/abi" abinetwork "github.com/filecoin-project/go-state-types/network" - "github.com/filecoin-project/specs-storage/storage" - types4 "github.com/filecoin-project/venus-market/types" - - types3 "github.com/filecoin-project/venus-messager/types" - "github.com/filecoin-project/venus/venus-shared/actors/builtin" types2 "github.com/filecoin-project/venus/venus-shared/types" @@ -174,8 +170,8 @@ type StorageMiner interface { //messager MessagerWaitMessage(ctx context.Context, uuid string, confidence uint64) (*types2.MsgLookup, error) - MessagerPushMessage(ctx context.Context, msg *types2.Message, meta *types3.MsgMeta) (string, error) - MessagerGetMessage(ctx context.Context, uuid string) (*types3.Message, error) + MessagerPushMessage(ctx context.Context, msg *types2.Message, spec *messager.SendSpec) (string, error) + MessagerGetMessage(ctx context.Context, uuid string) (*messager.Message, error) //for market GetDeals(ctx context.Context, pageIndex, pageSize int) ([]*types4.DealInfo, error) @@ -297,8 +293,8 @@ type StorageMinerStruct struct { CheckProvable func(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storage.SectorRef, expensive bool) (map[abi.SectorNumber]string, error) `perm:"admin"` MessagerWaitMessage func(ctx context.Context, uuid string, confidence uint64) (*types2.MsgLookup, error) `perm:"read"` - MessagerPushMessage func(ctx context.Context, msg *types2.Message, meta *types3.MsgMeta) (string, error) `perm:"sign"` - MessagerGetMessage func(ctx context.Context, uuid string) (*types3.Message, error) `perm:"write"` + MessagerPushMessage func(ctx context.Context, msg *types2.Message, spec *messager.SendSpec) (string, error) `perm:"sign"` + MessagerGetMessage func(ctx context.Context, uuid string) (*messager.Message, error) `perm:"write"` IsUnsealed func(ctx context.Context, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (bool, error) `perm:"read"` SectorsStatus func(ctx context.Context, sid abi.SectorNumber, showOnChainInfo bool) (SectorInfo, error) `perm:"read"` @@ -685,11 +681,11 @@ func (c *StorageMinerStruct) MessagerWaitMessage(ctx context.Context, uuid strin return c.Internal.MessagerWaitMessage(ctx, uuid, confidence) } -func (c *StorageMinerStruct) MessagerPushMessage(ctx context.Context, msg *types2.Message, meta *types3.MsgMeta) (string, error) { - return c.Internal.MessagerPushMessage(ctx, msg, meta) +func (c *StorageMinerStruct) MessagerPushMessage(ctx context.Context, msg *types2.Message, spec *messager.SendSpec) (string, error) { + return c.Internal.MessagerPushMessage(ctx, msg, spec) } -func (c *StorageMinerStruct) MessagerGetMessage(ctx context.Context, uuid string) (*types3.Message, error) { +func (c *StorageMinerStruct) MessagerGetMessage(ctx context.Context, uuid string) (*messager.Message, error) { return c.Internal.MessagerGetMessage(ctx, uuid) } diff --git a/app/venus-sealer/init.go b/app/venus-sealer/init.go index a2920d2f..6bfc14fe 100644 --- a/app/venus-sealer/init.go +++ b/app/venus-sealer/init.go @@ -36,7 +36,7 @@ import ( "github.com/filecoin-project/venus/venus-shared/actors/policy" "github.com/filecoin-project/venus/venus-shared/types" - types3 "github.com/filecoin-project/venus-messager/types" + types3 "github.com/filecoin-project/venus/venus-shared/types/messager" "github.com/filecoin-project/venus-sealer/api" "github.com/filecoin-project/venus-sealer/config" @@ -622,7 +622,7 @@ func createStorageMiner(ctx context.Context, nodeAPI api.FullNode, messagerClien GasPremium: gasPrice, } - msgUid, err := messagerClient.PushMessage(ctx, createStorageMinerMsg, &types3.MsgMeta{MaxFee: types.FromFil(1)}) + msgUid, err := messagerClient.PushMessage(ctx, createStorageMinerMsg, &types3.SendSpec{MaxFee: types.FromFil(1)}) if err != nil { return address.Undef, xerrors.Errorf("pushing createMiner message: %w", err) } diff --git a/go.mod b/go.mod index 41690755..e1220f10 100644 --- a/go.mod +++ b/go.mod @@ -36,9 +36,9 @@ require ( github.com/filecoin-project/specs-actors/v6 v6.0.1 github.com/filecoin-project/specs-actors/v7 v7.0.0-rc1 github.com/filecoin-project/specs-storage v0.1.1-0.20211228030229-6d460d25a0c9 - github.com/filecoin-project/venus v1.2.0-rc2 - github.com/filecoin-project/venus-market v1.0.2-0.20220209102104-2edeb8e8c5b0 - github.com/filecoin-project/venus-messager v1.4.0-rc1 + github.com/filecoin-project/venus v1.2.0-rc5.0.20220210073318-71c52bbba9c5 + github.com/filecoin-project/venus-market v1.0.2-0.20220210103815-5ea3e7f6c5ac + github.com/filecoin-project/venus-messager v1.4.0-rc2 github.com/gbrlsnchs/jwt/v3 v3.0.1 github.com/go-kit/kit v0.12.0 // indirect github.com/golang/mock v1.6.0 @@ -48,7 +48,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 github.com/icza/backscanner v0.0.0-20210726202459-ac2ffc679f94 github.com/ipfs-force-community/venus-common-utils v0.0.0-20211122032945-eb6cab79c62a - github.com/ipfs-force-community/venus-gateway v1.2.0-rc1 + github.com/ipfs-force-community/venus-gateway v1.2.0-rc2 github.com/ipfs/go-block-format v0.0.3 github.com/ipfs/go-cid v0.1.0 github.com/ipfs/go-datastore v0.5.1 diff --git a/go.sum b/go.sum index a69d0c99..2ed3dbd7 100644 --- a/go.sum +++ b/go.sum @@ -99,6 +99,7 @@ github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpH github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/ahmetb/go-linq/v3 v3.2.0/go.mod h1:haQ3JfOeWK8HpVxMtHHEMPVgBKiYyQ+f1/kLZh/cj9U= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -417,17 +418,16 @@ github.com/filecoin-project/specs-actors/v7 v7.0.0-rc1/go.mod h1:TA5FwCna+Yi36PO github.com/filecoin-project/specs-storage v0.1.1-0.20211228030229-6d460d25a0c9 h1:oUYOvF7EvdXS0Zmk9mNkaB6Bu0l+WXBYPzVodKMiLug= github.com/filecoin-project/specs-storage v0.1.1-0.20211228030229-6d460d25a0c9/go.mod h1:Tb88Zq+IBJbvAn3mS89GYj3jdRThBTE/771HCVZdRJU= github.com/filecoin-project/test-vectors/schema v0.0.5/go.mod h1:iQ9QXLpYWL3m7warwvK1JC/pTri8mnfEmKygNDqqY6E= -github.com/filecoin-project/venus v1.2.0-rc1/go.mod h1:bRzCXrdaYKaXbS01EiSbqivGOG51dEXG71vjgFfJqxA= -github.com/filecoin-project/venus v1.2.0-rc2 h1:jZMCK+UPx13M2H+ozTzq/YtdnyiZNLT8Eau9hpX8f5g= -github.com/filecoin-project/venus v1.2.0-rc2/go.mod h1:bRzCXrdaYKaXbS01EiSbqivGOG51dEXG71vjgFfJqxA= +github.com/filecoin-project/venus v1.2.0-rc5/go.mod h1:P2i2m4nheAeVXXWjkVLDyezY7l2Bi1sNBt5gno0/Sn0= +github.com/filecoin-project/venus v1.2.0-rc5.0.20220210073318-71c52bbba9c5 h1:RnwvdAb3HTktA57dX8UCY45qcPiFY/2J+aXhqOJ42wY= +github.com/filecoin-project/venus v1.2.0-rc5.0.20220210073318-71c52bbba9c5/go.mod h1:P2i2m4nheAeVXXWjkVLDyezY7l2Bi1sNBt5gno0/Sn0= github.com/filecoin-project/venus-auth v1.3.1-0.20210809053831-012d55d5f578/go.mod h1:/cbLZYvQhinVFUG4TP2Uy1o7LtF+guT21qZIMTmKk0g= github.com/filecoin-project/venus-auth v1.3.1 h1:3FGPK6zCxZIpQA+VTY01wNaCvcgyLWPa61zuFY+br9c= github.com/filecoin-project/venus-auth v1.3.1/go.mod h1:DZwxRN2SVvRjw4UOMw2PBO1+hwAusksaWJe6BoGkjec= -github.com/filecoin-project/venus-market v1.0.2-0.20220209102104-2edeb8e8c5b0 h1:xOiWnG/8yey/ISUQfYeOpcWGQi9eK1RJpv/bRFxNT9E= -github.com/filecoin-project/venus-market v1.0.2-0.20220209102104-2edeb8e8c5b0/go.mod h1:Q2MV33v1iC+oqr1m3HZl65wYvwCC7VxCv1nOp4Yso4c= -github.com/filecoin-project/venus-messager v1.2.2-rc1.0.20220113095437-36c9939fefe2/go.mod h1:rzAdkYzebT8xNxUCjUmvTcoKPitGaKbP22JvbW/sdzU= -github.com/filecoin-project/venus-messager v1.4.0-rc1 h1:2Qxk4tXpCxBBOWnH7uOCUsYLsSQF5wNpzXwr1Rxx2WI= -github.com/filecoin-project/venus-messager v1.4.0-rc1/go.mod h1:MzQRchVADxiADkm/iCSO4jIKAfmI7FmLuS3rowvnzvo= +github.com/filecoin-project/venus-market v1.0.2-0.20220210103815-5ea3e7f6c5ac h1:/T9RM++YWPjFsW7gKinKPVwUpKr4PXeeduk8pjWEW7w= +github.com/filecoin-project/venus-market v1.0.2-0.20220210103815-5ea3e7f6c5ac/go.mod h1:nQL1niFYwLmw+0c3R5Dd1Bz9pxAEfXBdUmrahuK+k3I= +github.com/filecoin-project/venus-messager v1.4.0-rc2 h1:tLf4gx4swXOca86fM0BU0LGuuk2kvmbyqNyAZIpnOjE= +github.com/filecoin-project/venus-messager v1.4.0-rc2/go.mod h1:G/J8z+J+6z2BRiqrrBcNIVCUDnUwNzX7XOWXnMG0oxw= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/flynn/noise v1.0.0 h1:DlTHqmzmvcEiKj+4RYo/imoswx/4r6iBlCMfVtrMXpQ= github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= @@ -445,6 +445,7 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/fullstorydev/grpcurl v1.6.0/go.mod h1:ZQ+ayqbKMJNhzLmbpCiurTVlaK2M/3nqZCxaQ2Ze/sM= +github.com/fxamacker/cbor/v2 v2.4.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= github.com/fzipp/gocyclo v0.3.1/go.mod h1:DJHO6AUmbdqj2ET4Z9iArSuwWgYDRryYt2wASxc7x3E= github.com/gbrlsnchs/jwt/v3 v3.0.0/go.mod h1:AncDcjXz18xetI3A6STfXq2w+LuTx8pQ8bGEwRN8zVM= github.com/gbrlsnchs/jwt/v3 v3.0.1 h1:lbUmgAKpxnClrKloyIwpxm4OuWeDl5wLk52G91ODPw4= @@ -801,9 +802,8 @@ github.com/ipfs-force-community/venus-common-utils v0.0.0-20210714054928-2042a90 github.com/ipfs-force-community/venus-common-utils v0.0.0-20210924063144-1d3a5b30de87/go.mod h1:RTVEOzM+hkpqmcEWpyLDkx1oGO5r9ZWCgYxG/CsXzJQ= github.com/ipfs-force-community/venus-common-utils v0.0.0-20211122032945-eb6cab79c62a h1:6EPVXUMUT2p25KsjGYFrqMp50YloHSLo1NaeMgsJjtA= github.com/ipfs-force-community/venus-common-utils v0.0.0-20211122032945-eb6cab79c62a/go.mod h1:sSTUXgIu95tPHvgcYhdLuELmgPJWCP/pNMFtsrVtOyA= -github.com/ipfs-force-community/venus-gateway v1.1.2-0.20220113034500-827d4971ea63/go.mod h1:dXTxpI7sXnmcDvOcN70zHkFUMBpFcdh4wBci3CppCHc= -github.com/ipfs-force-community/venus-gateway v1.2.0-rc1 h1:BzsePZO6p+o0QTLkDrHILcdcAbJrUvXVhhKAbHb/XnA= -github.com/ipfs-force-community/venus-gateway v1.2.0-rc1/go.mod h1:dXTxpI7sXnmcDvOcN70zHkFUMBpFcdh4wBci3CppCHc= +github.com/ipfs-force-community/venus-gateway v1.2.0-rc2 h1:As7MEDjY2jRnyX6bAWy/rjfhb48htdyov0r9SvjjTao= +github.com/ipfs-force-community/venus-gateway v1.2.0-rc2/go.mod h1:6Zmmtzua9gi5PA5HCU2ocbQ/pnQNVqa9loI7pchqn2o= github.com/ipfs/bbloom v0.0.1/go.mod h1:oqo8CVWsJFMOZqTglBG4wydCE4IQA/G2/SEofB0rjUI= github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= @@ -2076,6 +2076,7 @@ github.com/whyrusleeping/pubsub v0.0.0-20190708150250-92bcb0691325/go.mod h1:g7c github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee h1:lYbXeSvJi5zk5GLKVuid9TVjS9a0OmLIDKTfoZBL6Ow= github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee/go.mod h1:m2aV4LZI4Aez7dP5PMyVKEHhUyEJ/RjmPEDOpDvudHg= github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/c-for-go v0.0.0-20201112171043-ea6dce5809cb/go.mod h1:pbNsDSxn1ICiNn9Ct4ZGNrwzfkkwYbx/lw8VuyutFIg= github.com/xlab/c-for-go v0.0.0-20201223145653-3ba5db515dcb h1:Bj7qzsczc8NfHg44eeJA6TIZhevFovN7aUawz+bPCxI= diff --git a/storage-sealing/mocks/api.go b/storage-sealing/mocks/api.go index 38447fe1..d0fc0bb3 100644 --- a/storage-sealing/mocks/api.go +++ b/storage-sealing/mocks/api.go @@ -1,7 +1,7 @@ // Code generated by MockGen. DO NOT EDIT. // Source: github.com/filecoin-project/venus-sealer/storage-sealing (interfaces: SealingAPI) -// Package mocks is a generated GoMock package. +// Package mock is a generated GoMock package. package mocks import ( @@ -14,20 +14,17 @@ import ( crypto "github.com/filecoin-project/go-state-types/crypto" dline "github.com/filecoin-project/go-state-types/dline" network "github.com/filecoin-project/go-state-types/network" - miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner" + miner "github.com/filecoin-project/specs-actors/actors/builtin/miner" + types "github.com/filecoin-project/venus-market/types" + types0 "github.com/filecoin-project/venus-sealer/types" + market "github.com/filecoin-project/venus/venus-shared/actors/builtin/market" + miner0 "github.com/filecoin-project/venus/venus-shared/actors/builtin/miner" + messager "github.com/filecoin-project/venus/venus-shared/types/messager" + types1 "github.com/filecoin-project/venus/venus-shared/types" gomock "github.com/golang/mock/gomock" cid "github.com/ipfs/go-cid" - - api "github.com/filecoin-project/venus/app/submodule/apitypes" - market "github.com/filecoin-project/venus/venus-shared/actors/builtin/market" - miner "github.com/filecoin-project/venus/venus-shared/actors/builtin/miner" - types "github.com/filecoin-project/venus-messager/types" - - sealing "github.com/filecoin-project/venus-sealer/storage-sealing" ) -var _ sealing.SealingAPI = &MockSealingAPI{} - // MockSealingAPI is a mock of SealingAPI interface. type MockSealingAPI struct { ctrl *gomock.Controller @@ -52,7 +49,7 @@ func (m *MockSealingAPI) EXPECT() *MockSealingAPIMockRecorder { } // ChainBaseFee mocks base method. -func (m *MockSealingAPI) ChainBaseFee(arg0 context.Context, arg1 sealing.TipSetToken) (big.Int, error) { +func (m *MockSealingAPI) ChainBaseFee(arg0 context.Context, arg1 types0.TipSetToken) (big.Int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ChainBaseFee", arg0, arg1) ret0, _ := ret[0].(big.Int) @@ -67,10 +64,10 @@ func (mr *MockSealingAPIMockRecorder) ChainBaseFee(arg0, arg1 interface{}) *gomo } // ChainGetMessage mocks base method. -func (m *MockSealingAPI) ChainGetMessage(arg0 context.Context, arg1 cid.Cid) (*types.Message, error) { +func (m *MockSealingAPI) ChainGetMessage(arg0 context.Context, arg1 cid.Cid) (*messager.Message, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ChainGetMessage", arg0, arg1) - ret0, _ := ret[0].(*types.Message) + ret0, _ := ret[0].(*messager.Message) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -82,10 +79,10 @@ func (mr *MockSealingAPIMockRecorder) ChainGetMessage(arg0, arg1 interface{}) *g } // ChainHead mocks base method. -func (m *MockSealingAPI) ChainHead(arg0 context.Context) (sealing.TipSetToken, abi.ChainEpoch, error) { +func (m *MockSealingAPI) ChainHead(arg0 context.Context) (types0.TipSetToken, abi.ChainEpoch, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ChainHead", arg0) - ret0, _ := ret[0].(sealing.TipSetToken) + ret0, _ := ret[0].(types0.TipSetToken) ret1, _ := ret[1].(abi.ChainEpoch) ret2, _ := ret[2].(error) return ret0, ret1, ret2 @@ -112,23 +109,82 @@ func (mr *MockSealingAPIMockRecorder) ChainReadObj(arg0, arg1 interface{}) *gomo return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainReadObj", reflect.TypeOf((*MockSealingAPI)(nil).ChainReadObj), arg0, arg1) } -// SendMsg mocks base method. -func (m *MockSealingAPI) SendMsg(arg0 context.Context, arg1, arg2 address.Address, arg3 abi.MethodNum, arg4, arg5 big.Int, arg6 []byte) (cid.Cid, error) { +// GetUnPackedDeals mocks base method. +func (m *MockSealingAPI) GetUnPackedDeals(arg0 context.Context, arg1 address.Address, arg2 *types.GetDealSpec) ([]*types.DealInfoIncludePath, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SendMsg", arg0, arg1, arg2, arg3, arg4, arg5, arg6) - ret0, _ := ret[0].(cid.Cid) + ret := m.ctrl.Call(m, "GetUnPackedDeals", arg0, arg1, arg2) + ret0, _ := ret[0].([]*types.DealInfoIncludePath) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetUnPackedDeals indicates an expected call of GetUnPackedDeals. +func (mr *MockSealingAPIMockRecorder) GetUnPackedDeals(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUnPackedDeals", reflect.TypeOf((*MockSealingAPI)(nil).GetUnPackedDeals), arg0, arg1, arg2) +} + +// MarkDealsAsPacking mocks base method. +func (m *MockSealingAPI) MarkDealsAsPacking(arg0 context.Context, arg1 address.Address, arg2 []abi.DealID) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarkDealsAsPacking", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// MarkDealsAsPacking indicates an expected call of MarkDealsAsPacking. +func (mr *MockSealingAPIMockRecorder) MarkDealsAsPacking(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkDealsAsPacking", reflect.TypeOf((*MockSealingAPI)(nil).MarkDealsAsPacking), arg0, arg1, arg2) +} + +// MessagerSearchMsg mocks base method. +func (m *MockSealingAPI) MessagerSearchMsg(arg0 context.Context, arg1 string) (*types0.MsgLookup, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MessagerSearchMsg", arg0, arg1) + ret0, _ := ret[0].(*types0.MsgLookup) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MessagerSearchMsg indicates an expected call of MessagerSearchMsg. +func (mr *MockSealingAPIMockRecorder) MessagerSearchMsg(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MessagerSearchMsg", reflect.TypeOf((*MockSealingAPI)(nil).MessagerSearchMsg), arg0, arg1) +} + +// MessagerSendMsg mocks base method. +func (m *MockSealingAPI) MessagerSendMsg(arg0 context.Context, arg1, arg2 address.Address, arg3 abi.MethodNum, arg4, arg5 big.Int, arg6 []byte) (string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MessagerSendMsg", arg0, arg1, arg2, arg3, arg4, arg5, arg6) + ret0, _ := ret[0].(string) ret1, _ := ret[1].(error) return ret0, ret1 } -// SendMsg indicates an expected call of SendMsg. -func (mr *MockSealingAPIMockRecorder) SendMsg(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call { +// MessagerSendMsg indicates an expected call of MessagerSendMsg. +func (mr *MockSealingAPIMockRecorder) MessagerSendMsg(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockSealingAPI)(nil).SendMsg), arg0, arg1, arg2, arg3, arg4, arg5, arg6) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MessagerSendMsg", reflect.TypeOf((*MockSealingAPI)(nil).MessagerSendMsg), arg0, arg1, arg2, arg3, arg4, arg5, arg6) +} + +// MessagerWaitMsg mocks base method. +func (m *MockSealingAPI) MessagerWaitMsg(arg0 context.Context, arg1 string) (types0.MsgLookup, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MessagerWaitMsg", arg0, arg1) + ret0, _ := ret[0].(types0.MsgLookup) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MessagerWaitMsg indicates an expected call of MessagerWaitMsg. +func (mr *MockSealingAPIMockRecorder) MessagerWaitMsg(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MessagerWaitMsg", reflect.TypeOf((*MockSealingAPI)(nil).MessagerWaitMsg), arg0, arg1) } // StateComputeDataCommitment mocks base method. -func (m *MockSealingAPI) StateComputeDataCommitment(arg0 context.Context, arg1 address.Address, arg2 abi.RegisteredSealProof, arg3 []abi.DealID, arg4 sealing.TipSetToken) (cid.Cid, error) { +func (m *MockSealingAPI) StateComputeDataCommitment(arg0 context.Context, arg1 address.Address, arg2 abi.RegisteredSealProof, arg3 []abi.DealID, arg4 types0.TipSetToken) (cid.Cid, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateComputeDataCommitment", arg0, arg1, arg2, arg3, arg4) ret0, _ := ret[0].(cid.Cid) @@ -143,7 +199,7 @@ func (mr *MockSealingAPIMockRecorder) StateComputeDataCommitment(arg0, arg1, arg } // StateGetRandomnessFromBeacon mocks base method. -func (m *MockSealingAPI) StateGetRandomnessFromBeacon(arg0 context.Context, arg1 crypto.DomainSeparationTag, arg2 abi.ChainEpoch, arg3 []byte, arg4 sealing.TipSetToken) (abi.Randomness, error) { +func (m *MockSealingAPI) StateGetRandomnessFromBeacon(arg0 context.Context, arg1 crypto.DomainSeparationTag, arg2 abi.ChainEpoch, arg3 []byte, arg4 types0.TipSetToken) (abi.Randomness, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateGetRandomnessFromBeacon", arg0, arg1, arg2, arg3, arg4) ret0, _ := ret[0].(abi.Randomness) @@ -158,7 +214,7 @@ func (mr *MockSealingAPIMockRecorder) StateGetRandomnessFromBeacon(arg0, arg1, a } // StateGetRandomnessFromTickets mocks base method. -func (m *MockSealingAPI) StateGetRandomnessFromTickets(arg0 context.Context, arg1 crypto.DomainSeparationTag, arg2 abi.ChainEpoch, arg3 []byte, arg4 sealing.TipSetToken) (abi.Randomness, error) { +func (m *MockSealingAPI) StateGetRandomnessFromTickets(arg0 context.Context, arg1 crypto.DomainSeparationTag, arg2 abi.ChainEpoch, arg3 []byte, arg4 types0.TipSetToken) (abi.Randomness, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateGetRandomnessFromTickets", arg0, arg1, arg2, arg3, arg4) ret0, _ := ret[0].(abi.Randomness) @@ -173,7 +229,7 @@ func (mr *MockSealingAPIMockRecorder) StateGetRandomnessFromTickets(arg0, arg1, } // StateLookupID mocks base method. -func (m *MockSealingAPI) StateLookupID(arg0 context.Context, arg1 address.Address, arg2 sealing.TipSetToken) (address.Address, error) { +func (m *MockSealingAPI) StateLookupID(arg0 context.Context, arg1 address.Address, arg2 types0.TipSetToken) (address.Address, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateLookupID", arg0, arg1, arg2) ret0, _ := ret[0].(address.Address) @@ -188,10 +244,10 @@ func (mr *MockSealingAPIMockRecorder) StateLookupID(arg0, arg1, arg2 interface{} } // StateMarketStorageDeal mocks base method. -func (m *MockSealingAPI) StateMarketStorageDeal(arg0 context.Context, arg1 abi.DealID, arg2 sealing.TipSetToken) (*api.MarketDeal, error) { +func (m *MockSealingAPI) StateMarketStorageDeal(arg0 context.Context, arg1 abi.DealID, arg2 types0.TipSetToken) (*types1.MarketDeal, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateMarketStorageDeal", arg0, arg1, arg2) - ret0, _ := ret[0].(*api.MarketDeal) + ret0, _ := ret[0].(*types1.MarketDeal) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -203,7 +259,7 @@ func (mr *MockSealingAPIMockRecorder) StateMarketStorageDeal(arg0, arg1, arg2 in } // StateMarketStorageDealProposal mocks base method. -func (m *MockSealingAPI) StateMarketStorageDealProposal(arg0 context.Context, arg1 abi.DealID, arg2 sealing.TipSetToken) (market.DealProposal, error) { +func (m *MockSealingAPI) StateMarketStorageDealProposal(arg0 context.Context, arg1 abi.DealID, arg2 types0.TipSetToken) (market.DealProposal, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateMarketStorageDealProposal", arg0, arg1, arg2) ret0, _ := ret[0].(market.DealProposal) @@ -218,10 +274,10 @@ func (mr *MockSealingAPIMockRecorder) StateMarketStorageDealProposal(arg0, arg1, } // StateMinerActiveSectors mocks base method. -func (m *MockSealingAPI) StateMinerActiveSectors(arg0 context.Context, arg1 address.Address, arg2 sealing.TipSetToken) ([]*miner.SectorOnChainInfo, error) { +func (m *MockSealingAPI) StateMinerActiveSectors(arg0 context.Context, arg1 address.Address, arg2 types0.TipSetToken) ([]*miner0.SectorOnChainInfo, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateMinerActiveSectors", arg0, arg1, arg2) - ret0, _ := ret[0].([]*miner.SectorOnChainInfo) + ret0, _ := ret[0].([]*miner0.SectorOnChainInfo) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -233,7 +289,7 @@ func (mr *MockSealingAPIMockRecorder) StateMinerActiveSectors(arg0, arg1, arg2 i } // StateMinerAvailableBalance mocks base method. -func (m *MockSealingAPI) StateMinerAvailableBalance(arg0 context.Context, arg1 address.Address, arg2 sealing.TipSetToken) (big.Int, error) { +func (m *MockSealingAPI) StateMinerAvailableBalance(arg0 context.Context, arg1 address.Address, arg2 types0.TipSetToken) (big.Int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateMinerAvailableBalance", arg0, arg1, arg2) ret0, _ := ret[0].(big.Int) @@ -248,10 +304,10 @@ func (mr *MockSealingAPIMockRecorder) StateMinerAvailableBalance(arg0, arg1, arg } // StateMinerInfo mocks base method. -func (m *MockSealingAPI) StateMinerInfo(arg0 context.Context, arg1 address.Address, arg2 sealing.TipSetToken) (miner.MinerInfo, error) { +func (m *MockSealingAPI) StateMinerInfo(arg0 context.Context, arg1 address.Address, arg2 types0.TipSetToken) (miner0.MinerInfo, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateMinerInfo", arg0, arg1, arg2) - ret0, _ := ret[0].(miner.MinerInfo) + ret0, _ := ret[0].(miner0.MinerInfo) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -263,7 +319,7 @@ func (mr *MockSealingAPIMockRecorder) StateMinerInfo(arg0, arg1, arg2 interface{ } // StateMinerInitialPledgeCollateral mocks base method. -func (m *MockSealingAPI) StateMinerInitialPledgeCollateral(arg0 context.Context, arg1 address.Address, arg2 miner0.SectorPreCommitInfo, arg3 sealing.TipSetToken) (big.Int, error) { +func (m *MockSealingAPI) StateMinerInitialPledgeCollateral(arg0 context.Context, arg1 address.Address, arg2 miner.SectorPreCommitInfo, arg3 types0.TipSetToken) (big.Int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateMinerInitialPledgeCollateral", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(big.Int) @@ -278,10 +334,10 @@ func (mr *MockSealingAPIMockRecorder) StateMinerInitialPledgeCollateral(arg0, ar } // StateMinerPartitions mocks base method. -func (m *MockSealingAPI) StateMinerPartitions(arg0 context.Context, arg1 address.Address, arg2 uint64, arg3 sealing.TipSetToken) ([]api.Partition, error) { +func (m *MockSealingAPI) StateMinerPartitions(arg0 context.Context, arg1 address.Address, arg2 uint64, arg3 types0.TipSetToken) ([]types1.Partition, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateMinerPartitions", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].([]api.Partition) + ret0, _ := ret[0].([]types1.Partition) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -293,7 +349,7 @@ func (mr *MockSealingAPIMockRecorder) StateMinerPartitions(arg0, arg1, arg2, arg } // StateMinerPreCommitDepositForPower mocks base method. -func (m *MockSealingAPI) StateMinerPreCommitDepositForPower(arg0 context.Context, arg1 address.Address, arg2 miner0.SectorPreCommitInfo, arg3 sealing.TipSetToken) (big.Int, error) { +func (m *MockSealingAPI) StateMinerPreCommitDepositForPower(arg0 context.Context, arg1 address.Address, arg2 miner.SectorPreCommitInfo, arg3 types0.TipSetToken) (big.Int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateMinerPreCommitDepositForPower", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(big.Int) @@ -308,7 +364,7 @@ func (mr *MockSealingAPIMockRecorder) StateMinerPreCommitDepositForPower(arg0, a } // StateMinerProvingDeadline mocks base method. -func (m *MockSealingAPI) StateMinerProvingDeadline(arg0 context.Context, arg1 address.Address, arg2 sealing.TipSetToken) (*dline.Info, error) { +func (m *MockSealingAPI) StateMinerProvingDeadline(arg0 context.Context, arg1 address.Address, arg2 types0.TipSetToken) (*dline.Info, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateMinerProvingDeadline", arg0, arg1, arg2) ret0, _ := ret[0].(*dline.Info) @@ -323,7 +379,7 @@ func (mr *MockSealingAPIMockRecorder) StateMinerProvingDeadline(arg0, arg1, arg2 } // StateMinerSectorAllocated mocks base method. -func (m *MockSealingAPI) StateMinerSectorAllocated(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 sealing.TipSetToken) (bool, error) { +func (m *MockSealingAPI) StateMinerSectorAllocated(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types0.TipSetToken) (bool, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateMinerSectorAllocated", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(bool) @@ -338,7 +394,7 @@ func (mr *MockSealingAPIMockRecorder) StateMinerSectorAllocated(arg0, arg1, arg2 } // StateMinerSectorSize mocks base method. -func (m *MockSealingAPI) StateMinerSectorSize(arg0 context.Context, arg1 address.Address, arg2 sealing.TipSetToken) (abi.SectorSize, error) { +func (m *MockSealingAPI) StateMinerSectorSize(arg0 context.Context, arg1 address.Address, arg2 types0.TipSetToken) (abi.SectorSize, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateMinerSectorSize", arg0, arg1, arg2) ret0, _ := ret[0].(abi.SectorSize) @@ -353,7 +409,7 @@ func (mr *MockSealingAPIMockRecorder) StateMinerSectorSize(arg0, arg1, arg2 inte } // StateMinerWorkerAddress mocks base method. -func (m *MockSealingAPI) StateMinerWorkerAddress(arg0 context.Context, arg1 address.Address, arg2 sealing.TipSetToken) (address.Address, error) { +func (m *MockSealingAPI) StateMinerWorkerAddress(arg0 context.Context, arg1 address.Address, arg2 types0.TipSetToken) (address.Address, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateMinerWorkerAddress", arg0, arg1, arg2) ret0, _ := ret[0].(address.Address) @@ -368,7 +424,7 @@ func (mr *MockSealingAPIMockRecorder) StateMinerWorkerAddress(arg0, arg1, arg2 i } // StateNetworkVersion mocks base method. -func (m *MockSealingAPI) StateNetworkVersion(arg0 context.Context, arg1 sealing.TipSetToken) (network.Version, error) { +func (m *MockSealingAPI) StateNetworkVersion(arg0 context.Context, arg1 types0.TipSetToken) (network.Version, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateNetworkVersion", arg0, arg1) ret0, _ := ret[0].(network.Version) @@ -383,10 +439,10 @@ func (mr *MockSealingAPIMockRecorder) StateNetworkVersion(arg0, arg1 interface{} } // StateSearchMsg mocks base method. -func (m *MockSealingAPI) StateSearchMsg(arg0 context.Context, arg1 cid.Cid) (*sealing.MsgLookup, error) { +func (m *MockSealingAPI) StateSearchMsg(arg0 context.Context, arg1 cid.Cid) (*types0.MsgLookup, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateSearchMsg", arg0, arg1) - ret0, _ := ret[0].(*sealing.MsgLookup) + ret0, _ := ret[0].(*types0.MsgLookup) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -398,10 +454,10 @@ func (mr *MockSealingAPIMockRecorder) StateSearchMsg(arg0, arg1 interface{}) *go } // StateSectorGetInfo mocks base method. -func (m *MockSealingAPI) StateSectorGetInfo(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 sealing.TipSetToken) (*miner.SectorOnChainInfo, error) { +func (m *MockSealingAPI) StateSectorGetInfo(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types0.TipSetToken) (*miner0.SectorOnChainInfo, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateSectorGetInfo", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(*miner.SectorOnChainInfo) + ret0, _ := ret[0].(*miner0.SectorOnChainInfo) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -413,10 +469,10 @@ func (mr *MockSealingAPIMockRecorder) StateSectorGetInfo(arg0, arg1, arg2, arg3 } // StateSectorPartition mocks base method. -func (m *MockSealingAPI) StateSectorPartition(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 sealing.TipSetToken) (*sealing.SectorLocation, error) { +func (m *MockSealingAPI) StateSectorPartition(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types0.TipSetToken) (*miner0.SectorLocation, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateSectorPartition", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(*sealing.SectorLocation) + ret0, _ := ret[0].(*miner0.SectorLocation) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -428,10 +484,10 @@ func (mr *MockSealingAPIMockRecorder) StateSectorPartition(arg0, arg1, arg2, arg } // StateSectorPreCommitInfo mocks base method. -func (m *MockSealingAPI) StateSectorPreCommitInfo(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 sealing.TipSetToken) (*miner.SectorPreCommitOnChainInfo, error) { +func (m *MockSealingAPI) StateSectorPreCommitInfo(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types0.TipSetToken) (*miner0.SectorPreCommitOnChainInfo, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateSectorPreCommitInfo", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(*miner.SectorPreCommitOnChainInfo) + ret0, _ := ret[0].(*miner0.SectorPreCommitOnChainInfo) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -443,10 +499,10 @@ func (mr *MockSealingAPIMockRecorder) StateSectorPreCommitInfo(arg0, arg1, arg2, } // StateWaitMsg mocks base method. -func (m *MockSealingAPI) StateWaitMsg(arg0 context.Context, arg1 cid.Cid) (sealing.MsgLookup, error) { +func (m *MockSealingAPI) StateWaitMsg(arg0 context.Context, arg1 cid.Cid) (types0.MsgLookup, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateWaitMsg", arg0, arg1) - ret0, _ := ret[0].(sealing.MsgLookup) + ret0, _ := ret[0].(types0.MsgLookup) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -456,3 +512,17 @@ func (mr *MockSealingAPIMockRecorder) StateWaitMsg(arg0, arg1 interface{}) *gomo mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateWaitMsg", reflect.TypeOf((*MockSealingAPI)(nil).StateWaitMsg), arg0, arg1) } + +// UpdateDealOnPacking mocks base method. +func (m *MockSealingAPI) UpdateDealOnPacking(arg0 context.Context, arg1 address.Address, arg2 abi.DealID, arg3 abi.SectorNumber, arg4 abi.PaddedPieceSize) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateDealOnPacking", arg0, arg1, arg2, arg3, arg4) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateDealOnPacking indicates an expected call of UpdateDealOnPacking. +func (mr *MockSealingAPIMockRecorder) UpdateDealOnPacking(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDealOnPacking", reflect.TypeOf((*MockSealingAPI)(nil).UpdateDealOnPacking), arg0, arg1, arg2, arg3, arg4) +} diff --git a/storage-sealing/mocks/mock_commit_batcher.go b/storage-sealing/mocks/mock_commit_batcher.go index 6d129b11..9d10a60e 100644 --- a/storage-sealing/mocks/mock_commit_batcher.go +++ b/storage-sealing/mocks/mock_commit_batcher.go @@ -151,7 +151,7 @@ func (mr *MockCommitBatcherApiMockRecorder) StateNetworkVersion(arg0, arg1 inter func (m *MockCommitBatcherApi) StateSectorPreCommitInfo(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetToken) (*miner0.SectorPreCommitOnChainInfo, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateSectorPreCommitInfo", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(*miner.SectorPreCommitOnChainInfo) + ret0, _ := ret[0].(*miner0.SectorPreCommitOnChainInfo) ret1, _ := ret[1].(error) return ret0, ret1 } diff --git a/storage-sealing/sealing.go b/storage-sealing/sealing.go index fe7157de..ffd4c4ac 100644 --- a/storage-sealing/sealing.go +++ b/storage-sealing/sealing.go @@ -37,10 +37,7 @@ import ( var log = logging.Logger("sectors") -type SectorLocation struct { - Deadline uint64 - Partition uint64 -} +type SectorLocation = miner.SectorLocation var ErrSectorAllocated = errors.New("sectorNumber is allocated, but PreCommit info wasn't found on chain") diff --git a/storage/adapter_storage_miner.go b/storage/adapter_storage_miner.go index 32017cd6..6c5bb451 100644 --- a/storage/adapter_storage_miner.go +++ b/storage/adapter_storage_miner.go @@ -13,27 +13,22 @@ import ( "github.com/filecoin-project/go-state-types/crypto" "github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/network" - "github.com/ipfs/go-cid" - market2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/market" market5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/market" - - chain2 "github.com/filecoin-project/venus/pkg/chain" - constants2 "github.com/filecoin-project/venus/pkg/constants" - "github.com/filecoin-project/venus/venus-shared/actors" - "github.com/filecoin-project/venus/venus-shared/actors/builtin/market" - "github.com/filecoin-project/venus/venus-shared/actors/builtin/miner" - "github.com/filecoin-project/venus/venus-shared/types" - api2 "github.com/filecoin-project/venus-market/api" types4 "github.com/filecoin-project/venus-market/types" - "github.com/filecoin-project/venus-sealer/api" "github.com/filecoin-project/venus-sealer/constants" sealing "github.com/filecoin-project/venus-sealer/storage-sealing" types2 "github.com/filecoin-project/venus-sealer/types" - - types3 "github.com/filecoin-project/venus-messager/types" + chain2 "github.com/filecoin-project/venus/pkg/chain" + constants2 "github.com/filecoin-project/venus/pkg/constants" + "github.com/filecoin-project/venus/venus-shared/actors" + "github.com/filecoin-project/venus/venus-shared/actors/builtin/market" + "github.com/filecoin-project/venus/venus-shared/actors/builtin/miner" + "github.com/filecoin-project/venus/venus-shared/types" + types3 "github.com/filecoin-project/venus/venus-shared/types/messager" + "github.com/ipfs/go-cid" ) var _ sealing.SealingAPI = new(SealingAPIAdapter) @@ -472,7 +467,7 @@ func (s SealingAPIAdapter) MessagerSendMsg(ctx context.Context, from, to address Value: value, Method: method, Params: params, - }, &types3.MsgMeta{ + }, &types3.SendSpec{ ExpireEpoch: 0, GasOverEstimation: 0, //todo give a maxFee or for nil diff --git a/storage/wdpost_run.go b/storage/wdpost_run.go index a07ed622..46c946e0 100644 --- a/storage/wdpost_run.go +++ b/storage/wdpost_run.go @@ -14,8 +14,8 @@ import ( "github.com/filecoin-project/go-state-types/network" "github.com/filecoin-project/specs-storage/storage" - proof7 "github.com/filecoin-project/specs-actors/v7/actors/runtime/proof" "github.com/filecoin-project/specs-actors/v3/actors/runtime/proof" + proof7 "github.com/filecoin-project/specs-actors/v7/actors/runtime/proof" "go.opencensus.io/trace" "golang.org/x/xerrors" @@ -23,7 +23,7 @@ import ( "github.com/filecoin-project/venus-sealer/api" "github.com/filecoin-project/venus-sealer/constants" - types3 "github.com/filecoin-project/venus-messager/types" + types3 "github.com/filecoin-project/venus/venus-shared/types/messager" "github.com/filecoin-project/venus/pkg/messagepool" "github.com/filecoin-project/venus/venus-shared/actors" @@ -326,7 +326,7 @@ func (s *WindowPoStScheduler) declareRecoveries(ctx context.Context, dlIdx uint6 return recoveries, nil, err } - uid, err := s.Messager.PushMessage(ctx, msg, &types3.MsgMeta{MaxFee: abi.TokenAmount(s.feeCfg.MaxWindowPoStGasFee)}) + uid, err := s.Messager.PushMessage(ctx, msg, &types3.SendSpec{MaxFee: abi.TokenAmount(s.feeCfg.MaxWindowPoStGasFee)}) if err != nil { return recoveries, nil, xerrors.Errorf("pushing message to mpool: %w", err) } @@ -428,7 +428,7 @@ func (s *WindowPoStScheduler) declareFaults(ctx context.Context, dlIdx uint64, p return faults, nil, err } - uid, err := s.Messager.PushMessage(ctx, msg, &types3.MsgMeta{MaxFee: spec.MaxFee}) + uid, err := s.Messager.PushMessage(ctx, msg, &types3.SendSpec{MaxFee: spec.MaxFee}) if err != nil { return faults, nil, xerrors.Errorf("pushing message to mpool: %w", err) } @@ -865,7 +865,7 @@ func (s *WindowPoStScheduler) submitPoStMessage(ctx context.Context, proof *mine } // TODO: consider maybe caring about the output - uid, err = s.Messager.PushMessage(ctx, msg, &types3.MsgMeta{MaxFee: spec.MaxFee}) + uid, err = s.Messager.PushMessage(ctx, msg, &types3.SendSpec{MaxFee: spec.MaxFee}) if err != nil { log.Errorf("[%d] pushing SubmitWindowedPoSt message failed: %v", idx+1, err) time.Sleep(10 * time.Second) diff --git a/storage/wdpost_run_test.go b/storage/wdpost_run_test.go index 03af2ce3..1aff9ebe 100644 --- a/storage/wdpost_run_test.go +++ b/storage/wdpost_run_test.go @@ -3,6 +3,7 @@ package storage import ( "bytes" "context" + "github.com/google/uuid" "testing" "time" @@ -30,7 +31,7 @@ import ( proof2 "github.com/filecoin-project/specs-actors/v2/actors/runtime/proof" tutils "github.com/filecoin-project/specs-actors/v2/support/testing" - type2 "github.com/filecoin-project/venus-messager/types" + type2 "github.com/filecoin-project/venus/venus-shared/types/messager" "github.com/filecoin-project/venus/venus-shared/actors/builtin/miner" "github.com/filecoin-project/venus/venus-shared/actors/policy" @@ -458,12 +459,12 @@ func (m *mockMessagerAPI) WaitMessage(ctx context.Context, id string, confidence }, nil } -func (m *mockMessagerAPI) PushMessage(ctx context.Context, msg *types.Message, meta *type2.MsgMeta) (string, error) { +func (m *mockMessagerAPI) PushMessage(ctx context.Context, msg *types.Message, spec *type2.SendSpec) (string, error) { m.pushedMessages <- msg - return type2.NewUUID().String(), nil + return uuid.New().String(), nil } -func (m *mockMessagerAPI) PushMessageWithId(ctx context.Context, id string, msg *types.Message, meta *type2.MsgMeta) (string, error) { +func (m *mockMessagerAPI) PushMessageWithId(ctx context.Context, id string, msg *types.Message, spec *type2.SendSpec) (string, error) { m.pushedMessages <- msg return id, nil } diff --git a/storage/wdpost_sched.go b/storage/wdpost_sched.go index cade6540..d60e0aa0 100644 --- a/storage/wdpost_sched.go +++ b/storage/wdpost_sched.go @@ -17,7 +17,6 @@ import ( sectorstorage "github.com/filecoin-project/venus-sealer/sector-storage" "github.com/filecoin-project/venus-sealer/sector-storage/ffiwrapper" - "github.com/filecoin-project/venus/pkg/chain" "github.com/filecoin-project/venus/venus-shared/types" ) @@ -132,9 +131,9 @@ func (s *WindowPoStScheduler) Run(ctx context.Context) { log.Errorf("change.Val was nil") } switch change.Type { - case chain.HCRevert: + case types.HCRevert: lowest = change.Val - case chain.HCApply: + case types.HCApply: highest = change.Val } } diff --git a/tool/api-docs-gen/docgen.go b/tool/api-docs-gen/docgen.go index 4e0958e0..21b4067f 100644 --- a/tool/api-docs-gen/docgen.go +++ b/tool/api-docs-gen/docgen.go @@ -11,12 +11,12 @@ import ( "github.com/filecoin-project/go-state-types/crypto" "github.com/filecoin-project/go-state-types/exitcode" network2 "github.com/filecoin-project/go-state-types/network" - "github.com/filecoin-project/venus-messager/types" "github.com/filecoin-project/venus-sealer/api" "github.com/filecoin-project/venus-sealer/constants" "github.com/filecoin-project/venus-sealer/sector-storage/stores" "github.com/filecoin-project/venus-sealer/sector-storage/storiface" stype "github.com/filecoin-project/venus-sealer/types" + types "github.com/filecoin-project/venus/venus-shared/types/messager" "github.com/google/uuid" "github.com/ipfs/go-cid" "github.com/ipfs/go-graphsync"