diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b2a0f96b5..02e4c42982 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,32 @@ # venus changelog +## v1.10.1 + +* 修复 evm 命令部署合约失败 [[#5785](https://github.com/filecoin-project/venus/pull/5785)] +* 修复无法获取扇区的开始和过期时间 [[#5792](https://github.com/filecoin-project/venus/pull/5792)] +* market 增加 miner 管理接口 [[#5794](https://github.com/filecoin-project/venus/pull/5794)] +* 增加 StateCompute 接口 [[#5795](https://github.com/filecoin-project/venus/pull/5795)] +* 优化调用 newEthBlockFromFilecoinTipSet 函数的耗时 [[#5798](https://github.com/filecoin-project/venus/pull/5798)] + +## v1.10.0 + +* 把实际的 vmTracing 传递给 VM [[#5757](https://github.com/filecoin-project/venus/pull/5757)] +* 增加接口 FilecoinAddressToEthAddress [[#5772]](https://github.com/filecoin-project/venus/pull/5772) +* 重构 market 接口 updatedealstatus [[#5778](https://github.com/filecoin-project/venus/pull/5778)] + +## v1.10.0-rc4 + +* 修复保存 MessageReceipt 失败问题 [[#5743](https://github.com/filecoin-project/venus/pull/5743)] + +## v1.10.0-rc3 + +* 调整 force 网络的 Hygge 升级高度 +* 增加 bootstrap peers flag +* 增加 RPC接口:EthAddressToFilecoinAddress +* 升级 go-libipfs 版本到 v0.4.1 +* 修复 EthGetTransactionCount 接口返回不正确的 nonce +* 调整预迁移开始高度和结束高度 + ## v1.10.0-rc1 这是 venus v1.10.0 版本(**强制性**)的第一个候选版本,此版本将提供 Hygge 网络升级,并引入 Filecoin 网络版本18。 diff --git a/app/submodule/chain/chaininfo_api.go b/app/submodule/chain/chaininfo_api.go index 4c1790e9f2..a233b96770 100644 --- a/app/submodule/chain/chaininfo_api.go +++ b/app/submodule/chain/chaininfo_api.go @@ -483,19 +483,6 @@ func (cia *chainInfoAPI) StateVerifierStatus(ctx context.Context, addr address.A return &dcap, nil } -// MessageWait invokes the callback when a message with the given cid appears on chain. -// It will find the message in both the case that it is already on chain and -// the case that it appears in a newly mined block. An error is returned if one is -// encountered or if the context is canceled. Otherwise, it waits forever for the message -// to appear on chain. -func (cia *chainInfoAPI) MessageWait(ctx context.Context, msgCid cid.Cid, confidence, lookback abi.ChainEpoch) (*types.ChainMessage, error) { - chainMsg, err := cia.chain.MessageStore.LoadMessage(ctx, msgCid) - if err != nil { - return nil, err - } - return cia.chain.Waiter.Wait(ctx, chainMsg, uint64(confidence), lookback, true) -} - // StateSearchMsg searches for a message in the chain, and returns its receipt and the tipset where it was executed func (cia *chainInfoAPI) StateSearchMsg(ctx context.Context, from types.TipSetKey, mCid cid.Cid, lookbackLimit abi.ChainEpoch, allowReplaced bool) (*types.MsgLookup, error) { chainMsg, err := cia.chain.MessageStore.LoadMessage(ctx, mCid) @@ -514,7 +501,7 @@ func (cia *chainInfoAPI) StateSearchMsg(ctx context.Context, from types.TipSetKe if found { return &types.MsgLookup{ - Message: mCid, + Message: msgResult.Message.Cid(), Receipt: *msgResult.Receipt, TipSet: msgResult.TS.Key(), Height: msgResult.TS.Height(), @@ -579,7 +566,7 @@ func (cia *chainInfoAPI) StateWaitMsg(ctx context.Context, mCid cid.Cid, confide } return &types.MsgLookup{ - Message: mCid, + Message: msgResult.Message.Cid(), Receipt: *msgResult.Receipt, ReturnDec: returndec, TipSet: msgResult.TS.Key(), @@ -786,7 +773,7 @@ func (cia *chainInfoAPI) StateCall(ctx context.Context, msg *types.Message, tsk } } - return res, nil + return res, err } // StateReplay replays a given message, assuming it was included in a block in the specified tipset. @@ -882,3 +869,19 @@ func (cia *chainInfoAPI) ChainGetEvents(ctx context.Context, root cid.Cid) ([]ty return ret, err } + +func (cia *chainInfoAPI) StateCompute(ctx context.Context, height abi.ChainEpoch, msgs []*types.Message, tsk types.TipSetKey) (*types.ComputeStateOutput, error) { + ts, err := cia.ChainGetTipSet(ctx, tsk) + if err != nil { + return nil, fmt.Errorf("loading tipset %s: %w", tsk, err) + } + st, t, err := statemanger.ComputeState(ctx, cia.chain.Stmgr, height, msgs, ts) + if err != nil { + return nil, err + } + + return &types.ComputeStateOutput{ + Root: st, + Trace: t, + }, nil +} diff --git a/app/submodule/eth/dummy.go b/app/submodule/eth/dummy.go index bfe5c1d129..2dff5ec037 100644 --- a/app/submodule/eth/dummy.go +++ b/app/submodule/eth/dummy.go @@ -6,6 +6,7 @@ import ( "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-jsonrpc" v1 "github.com/filecoin-project/venus/venus-shared/api/chain/v1" "github.com/filecoin-project/venus/venus-shared/types" @@ -31,6 +32,14 @@ func (e *ethAPIDummy) EthAccounts(ctx context.Context) ([]types.EthAddress, erro return nil, ErrModuleDisabled } +func (e *ethAPIDummy) EthAddressToFilecoinAddress(ctx context.Context, ethAddress types.EthAddress) (address.Address, error) { + return address.Undef, ErrModuleDisabled +} + +func (e *ethAPIDummy) FilecoinAddressToEthAddress(ctx context.Context, filecoinAddress address.Address) (types.EthAddress, error) { + return types.EthAddress{}, ErrModuleDisabled +} + func (e *ethAPIDummy) EthGetBlockTransactionCountByNumber(ctx context.Context, blkNum types.EthUint64) (types.EthUint64, error) { return 0, ErrModuleDisabled } diff --git a/app/submodule/eth/eth_api.go b/app/submodule/eth/eth_api.go index 28b19adac4..c742f48f92 100644 --- a/app/submodule/eth/eth_api.go +++ b/app/submodule/eth/eth_api.go @@ -31,6 +31,7 @@ import ( "github.com/filecoin-project/venus/pkg/statemanger" "github.com/filecoin-project/venus/venus-shared/actors" builtinactors "github.com/filecoin-project/venus/venus-shared/actors/builtin" + builtinevm "github.com/filecoin-project/venus/venus-shared/actors/builtin/evm" types2 "github.com/filecoin-project/venus/venus-shared/actors/types" v1 "github.com/filecoin-project/venus/venus-shared/api/chain/v1" "github.com/filecoin-project/venus/venus-shared/types" @@ -139,6 +140,14 @@ func (a *ethAPI) EthAccounts(context.Context) ([]types.EthAddress, error) { return []types.EthAddress{}, nil } +func (a *ethAPI) EthAddressToFilecoinAddress(ctx context.Context, ethAddress types.EthAddress) (address.Address, error) { + return ethAddress.ToFilecoinAddress() +} + +func (a *ethAPI) FilecoinAddressToEthAddress(ctx context.Context, filecoinAddress address.Address) (types.EthAddress, error) { + return types.EthAddressFromFilecoinAddress(filecoinAddress) +} + func (a *ethAPI) countTipsetMsgs(ctx context.Context, ts *types.TipSet) (int, error) { msgs, err := a.em.chainModule.MessageStore.MessagesForTipset(ts) if err != nil { @@ -317,6 +326,27 @@ func (a *ethAPI) EthGetTransactionCount(ctx context.Context, sender types.EthAdd if err != nil { return types.EthUint64(0), fmt.Errorf("cannot parse block param: %s", blkParam) } + + // First, handle the case where the "sender" is an EVM actor. + if actor, err := a.em.chainModule.Stmgr.GetActorAt(ctx, addr, ts); err != nil { + if errors.Is(err, types.ErrActorNotFound) { + return 0, nil + } + return 0, fmt.Errorf("failed to lookup contract %s: %w", sender, err) + } else if builtinactors.IsEvmActor(actor.Code) { + evmState, err := builtinevm.Load(a.em.chainModule.ChainReader.Store(ctx), actor) + if err != nil { + return 0, fmt.Errorf("failed to load evm state: %w", err) + } + if alive, err := evmState.IsAlive(); err != nil { + return 0, err + } else if !alive { + return 0, nil + } + nonce, err := evmState.Nonce() + return types.EthUint64(nonce), err + } + nonce, err := a.em.mpoolModule.MPool.GetNonce(ctx, addr, ts.Key()) if err != nil { return types.EthUint64(0), err @@ -460,13 +490,18 @@ func (a *ethAPI) EthGetCode(ctx context.Context, ethAddr types.EthAddress, blkPa } func (a *ethAPI) EthGetStorageAt(ctx context.Context, ethAddr types.EthAddress, position types.EthBytes, blkParam string) (types.EthBytes, error) { + ts, err := a.parseBlkParam(ctx, blkParam) + if err != nil { + return nil, fmt.Errorf("cannot parse block param: %s", blkParam) + } + l := len(position) if l > 32 { return nil, fmt.Errorf("supplied storage key is too long") } // pad with zero bytes if smaller than 32 bytes - position = append(make([]byte, 32-l), position...) + position = append(make([]byte, 32-l, 32), position...) to, err := ethAddr.ToFilecoinAddress() if err != nil { @@ -479,6 +514,18 @@ func (a *ethAPI) EthGetStorageAt(ctx context.Context, ethAddr types.EthAddress, return nil, fmt.Errorf("failed to construct system sender address: %w", err) } + actor, err := a.em.chainModule.Stmgr.GetActorAt(ctx, to, ts) + if err != nil { + if errors.Is(err, types.ErrActorNotFound) { + return types.EthBytes(make([]byte, 32)), nil + } + return nil, fmt.Errorf("failed to lookup contract %s: %w", ethAddr, err) + } + + if !builtinactors.IsEvmActor(actor.Code) { + return types.EthBytes(make([]byte, 32)), nil + } + params, err := actors.SerializeParams(&evm.GetStorageAtParams{ StorageKey: *(*[32]byte)(position), }) @@ -497,11 +544,6 @@ func (a *ethAPI) EthGetStorageAt(ctx context.Context, ethAddr types.EthAddress, GasPremium: big.Zero(), } - ts, err := a.chain.ChainHead(ctx) - if err != nil { - return nil, fmt.Errorf("failed to got head %v", err) - } - // Try calling until we find a height with no migration. var res *types.InvocResult for { @@ -523,7 +565,19 @@ func (a *ethAPI) EthGetStorageAt(ctx context.Context, ethAddr types.EthAddress, return nil, fmt.Errorf("no message receipt") } - return res.MsgRct.Return, nil + if res.MsgRct.ExitCode.IsError() { + return nil, fmt.Errorf("failed to lookup storage slot: %s", res.Error) + } + + var ret abi.CborBytes + if err := ret.UnmarshalCBOR(bytes.NewReader(res.MsgRct.Return)); err != nil { + return nil, fmt.Errorf("failed to unmarshal storage slot: %w", err) + } + + // pad with zero bytes if smaller than 32 bytes + ret = append(make([]byte, 32-len(ret), 32), ret...) + + return types.EthBytes(ret), nil } func (a *ethAPI) EthGetBalance(ctx context.Context, address types.EthAddress, blkParam string) (types.EthBigInt, error) { @@ -537,7 +591,12 @@ func (a *ethAPI) EthGetBalance(ctx context.Context, address types.EthAddress, bl return types.EthBigInt{}, fmt.Errorf("cannot parse block param: %s", blkParam) } - actor, err := a.chain.StateGetActor(ctx, filAddr, ts.Key()) + _, view, err := a.em.chainModule.Stmgr.StateView(ctx, ts) + if err != nil { + return types.EthBigInt{}, fmt.Errorf("failed to compute tipset state: %w", err) + } + + actor, err := view.LoadActor(ctx, filAddr) if err != nil { if errors.Is(err, types.ErrActorNotFound) { return types.EthBigIntZero, nil @@ -806,7 +865,8 @@ func (a *ethAPI) applyMessage(ctx context.Context, msg *types.Message, tsk types return nil, fmt.Errorf("no message receipt") } if res.MsgRct.ExitCode.IsError() { - return nil, fmt.Errorf("message execution failed: exit %s, msg receipt return: %s, reason: %v", res.MsgRct.ExitCode, res.MsgRct.Return, res.Error) + reason := parseEthRevert(res.MsgRct.Return) + return nil, fmt.Errorf("message execution failed: exit %s, revert reason: %s, vm error: %s", res.MsgRct.ExitCode, reason, res.Error) } return res, nil @@ -825,14 +885,27 @@ func (a *ethAPI) EthEstimateGas(ctx context.Context, tx types.EthCall) (types.Et if err != nil { return types.EthUint64(0), err } - msg, err = a.mpool.GasEstimateMessageGas(ctx, msg, nil, ts.Key()) + gassedMsg, err := a.mpool.GasEstimateMessageGas(ctx, msg, nil, ts.Key()) if err != nil { return types.EthUint64(0), fmt.Errorf("failed to estimate gas: %w", err) } + if err != nil { + // On failure, GasEstimateMessageGas doesn't actually return the invocation result, + // it just returns an error. That means we can't get the revert reason. + // + // So we re-execute the message with EthCall (well, applyMessage which contains the + // guts of EthCall). This will give us an ethereum specific error with revert + // information. + msg.GasLimit = constants.BlockGasLimit + if _, err2 := a.applyMessage(ctx, msg, ts.Key()); err2 != nil { + err = err2 + } + return types.EthUint64(0), fmt.Errorf("failed to estimate gas: %w", err) + } - expectedGas, err := ethGasSearch(ctx, a.em.chainModule.Stmgr, a.em.mpoolModule.MPool, msg, ts) + expectedGas, err := ethGasSearch(ctx, a.em.chainModule.Stmgr, a.em.mpoolModule.MPool, gassedMsg, ts) if err != nil { - log.Errorw("expected gas", "err", err) + return 0, fmt.Errorf("gas search failed: %w", err) } return types.EthUint64(expectedGas), nil @@ -967,7 +1040,7 @@ func (a *ethAPI) EthCall(ctx context.Context, tx types.EthCall, blkParam string) invokeResult, err := a.applyMessage(ctx, msg, ts.Key()) if err != nil { - return nil, fmt.Errorf("failed to apply message: %w", err) + return nil, err } if msg.To == builtintypes.EthereumAddressManagerActorAddr { @@ -985,11 +1058,7 @@ func (a *ethAPI) Web3ClientVersion(ctx context.Context) (string, error) { } func newEthBlockFromFilecoinTipSet(ctx context.Context, ts *types.TipSet, fullTxInfo bool, ms *chain.MessageStore, ca v1.IChain) (types.EthBlock, error) { - parent, err := ca.ChainGetTipSet(ctx, ts.Parents()) - if err != nil { - return types.EthBlock{}, err - } - parentKeyCid, err := parent.Key().Cid() + parentKeyCid, err := ts.Parents().Cid() if err != nil { return types.EthBlock{}, err } @@ -998,6 +1067,8 @@ func newEthBlockFromFilecoinTipSet(ctx context.Context, ts *types.TipSet, fullTx return types.EthBlock{}, err } + bn := types.EthUint64(ts.Height()) + blkCid, err := ts.Key().Cid() if err != nil { return types.EthBlock{}, err @@ -1014,20 +1085,35 @@ func newEthBlockFromFilecoinTipSet(ctx context.Context, ts *types.TipSet, fullTx block := types.NewEthBlock(len(msgs) > 0) - // this seems to be a very expensive way to get gasUsed of the block. may need to find an efficient way to do it gasUsed := int64(0) - for txIdx, msg := range msgs { - msgLookup, err := ca.StateSearchMsg(ctx, types.EmptyTSK, msg.Cid(), constants.LookbackNoLimit, false) - if err != nil || msgLookup == nil { - return types.EthBlock{}, nil + compOutput, err := ca.StateCompute(ctx, ts.Height(), nil, ts.Key()) + if err != nil { + return types.EthBlock{}, fmt.Errorf("failed to compute state: %w", err) + } + + for txIdx, msg := range compOutput.Trace { + // skip system messages like reward application and cron + if msg.Msg.From == builtintypes.SystemActorAddr { + continue } - gasUsed += msgLookup.Receipt.GasUsed - tx, err := newEthTxFromMessageLookup(ctx, msgLookup, txIdx, ms, ca) + gasUsed += msg.MsgRct.GasUsed + smsgCid, err := getSignedMessage(ctx, ms, msg.MsgCid) + if err != nil { + return types.EthBlock{}, fmt.Errorf("failed to get signed msg %s: %w", msg.MsgCid, err) + } + tx, err := newEthTxFromSignedMessage(ctx, smsgCid, ca) if err != nil { - return types.EthBlock{}, nil + return types.EthBlock{}, fmt.Errorf("failed to convert msg to ethTx: %w", err) } + ti := types.EthUint64(txIdx) + + tx.ChainID = types.EthUint64(types2.Eip155ChainID) + tx.BlockHash = &blkHash + tx.BlockNumber = &bn + tx.TransactionIndex = &ti + if fullTxInfo { block.Transactions = append(block.Transactions, tx) } else { @@ -1036,7 +1122,7 @@ func newEthBlockFromFilecoinTipSet(ctx context.Context, ts *types.TipSet, fullTx } block.Hash = blkHash - block.Number = types.EthUint64(ts.Height()) + block.Number = bn block.ParentHash = parentBlkHash block.Timestamp = types.EthUint64(ts.Blocks()[0].Timestamp) block.BaseFeePerGas = types.EthBigInt{Int: ts.Blocks()[0].ParentBaseFee.Int} @@ -1217,20 +1303,9 @@ func newEthTxFromMessageLookup(ctx context.Context, msgLookup *types.MsgLookup, return types.EthTx{}, err } - smsg, err := ms.LoadSignedMessage(ctx, msgLookup.Message) + smsg, err := getSignedMessage(ctx, ms, msgLookup.Message) if err != nil { - // We couldn't find the signed message, it might be a BLS message, so search for a regular message. - msg, err := ms.LoadUnsignedMessage(ctx, msgLookup.Message) - if err != nil { - return types.EthTx{}, err - } - smsg = &types.SignedMessage{ - Message: *msg, - Signature: crypto.Signature{ - Type: crypto.SigTypeUnknown, - Data: nil, - }, - } + return types.EthTx{}, fmt.Errorf("failed to get signed msg: %w", err) } tx, err := newEthTxFromSignedMessage(ctx, smsg, ca) @@ -1424,11 +1499,13 @@ func (m *ethTxHashManager) ProcessSignedMessage(ctx context.Context, msg *types. ethTx, err := newEthTxFromSignedMessage(ctx, msg, m.chainAPI) if err != nil { log.Errorf("error converting filecoin message to eth tx: %s", err) + return } err = m.TransactionHashLookup.UpsertHash(ethTx.Hash, msg.Cid()) if err != nil { log.Errorf("error inserting tx mapping to db: %s", err) + return } } @@ -1479,6 +1556,85 @@ func parseEthTopics(topics types.EthTopicSpec) (map[string][][]byte, error) { return keys, nil } +const errorFunctionSelector = "\x08\xc3\x79\xa0" // Error(string) +const panicFunctionSelector = "\x4e\x48\x7b\x71" // Panic(uint256) +// Eth ABI (solidity) panic codes. +var panicErrorCodes = map[uint64]string{ + 0x00: "Panic()", + 0x01: "Assert()", + 0x11: "ArithmeticOverflow()", + 0x12: "DivideByZero()", + 0x21: "InvalidEnumVariant()", + 0x22: "InvalidStorageArray()", + 0x31: "PopEmptyArray()", + 0x32: "ArrayIndexOutOfBounds()", + 0x41: "OutOfMemory()", + 0x51: "CalledUninitializedFunction()", +} + +// Parse an ABI encoded revert reason. This reason should be encoded as if it were the parameters to +// an `Error(string)` function call. +// +// See https://docs.soliditylang.org/en/latest/control-structures.html#panic-via-assert-and-error-via-require +func parseEthRevert(ret []byte) string { + if len(ret) == 0 { + return "none" + } + var cbytes abi.CborBytes + if err := cbytes.UnmarshalCBOR(bytes.NewReader(ret)); err != nil { + return "ERROR: revert reason is not cbor encoded bytes" + } + if len(cbytes) == 0 { + return "none" + } + // If it's not long enough to contain an ABI encoded response, return immediately. + if len(cbytes) < 4+32 { + return types.EthBytes(cbytes).String() + } + switch string(cbytes[:4]) { + case panicFunctionSelector: + cbytes := cbytes[4 : 4+32] + // Read the and check the code. + code, err := types.EthUint64FromBytes(cbytes) + if err != nil { + // If it's too big, just return the raw value. + codeInt := big.PositiveFromUnsignedBytes(cbytes) + return fmt.Sprintf("Panic(%s)", types.EthBigInt(codeInt).String()) + } + if s, ok := panicErrorCodes[uint64(code)]; ok { + return s + } + return fmt.Sprintf("Panic(0x%x)", code) + case errorFunctionSelector: + cbytes := cbytes[4:] + cbytesLen := types.EthUint64(len(cbytes)) + // Read the and check the offset. + offset, err := types.EthUint64FromBytes(cbytes[:32]) + if err != nil { + break + } + if cbytesLen < offset { + break + } + + // Read and check the length. + if cbytesLen-offset < 32 { + break + } + start := offset + 32 + length, err := types.EthUint64FromBytes(cbytes[offset : offset+32]) + if err != nil { + break + } + if cbytesLen-start < length { + break + } + // Slice the error message. + return fmt.Sprintf("Error(%s)", cbytes[start:start+length]) + } + return types.EthBytes(cbytes).String() +} + func calculateRewardsAndGasUsed(rewardPercentiles []float64, txGasRewards gasRewardSorter) ([]types.EthBigInt, uint64) { var totalGasUsed uint64 for _, tx := range txGasRewards { @@ -1510,6 +1666,25 @@ func calculateRewardsAndGasUsed(rewardPercentiles []float64, txGasRewards gasRew return rewards, totalGasUsed } +func getSignedMessage(ctx context.Context, ms *chain.MessageStore, msgCid cid.Cid) (*types.SignedMessage, error) { + smsg, err := ms.LoadSignedMessage(ctx, msgCid) + if err != nil { + // We couldn't find the signed message, it might be a BLS message, so search for a regular message. + msg, err := ms.LoadUnsignedMessage(ctx, msgCid) + if err != nil { + return nil, fmt.Errorf("failed to find msg %s: %w", msgCid, err) + } + smsg = &types.SignedMessage{ + Message: *msg, + Signature: crypto.Signature{ + Type: crypto.SigTypeBLS, + }, + } + } + + return smsg, nil +} + type gasRewardTuple struct { gas uint64 reward types.EthBigInt diff --git a/app/submodule/mining/mining_api.go b/app/submodule/mining/mining_api.go index 8d753feb1f..f266596748 100644 --- a/app/submodule/mining/mining_api.go +++ b/app/submodule/mining/mining_api.go @@ -39,7 +39,7 @@ func (miningAPI *MiningAPI) MinerGetBaseInfo(ctx context.Context, maddr address. if err != nil { return nil, fmt.Errorf("failed to load tipset for mining base: %v", err) } - pt, _, err := miningAPI.Ming.Stmgr.RunStateTransition(ctx, ts, nil) + pt, _, err := miningAPI.Ming.Stmgr.RunStateTransition(ctx, ts, nil, false) if err != nil { return nil, fmt.Errorf("failed to get tipset root for mining base: %v", err) } @@ -174,7 +174,7 @@ func (miningAPI *MiningAPI) minerCreateBlock(ctx context.Context, bt *types.Bloc return nil, fmt.Errorf("failed to load parent tipset: %v", err) } - st, receiptCid, err := miningAPI.Ming.Stmgr.RunStateTransition(ctx, pts, nil) + st, receiptCid, err := miningAPI.Ming.Stmgr.RunStateTransition(ctx, pts, nil, false) if err != nil { return nil, fmt.Errorf("failed to load tipset state: %v", err) } diff --git a/app/submodule/network/network_submodule.go b/app/submodule/network/network_submodule.go index 9c2f44125a..6664912e0b 100644 --- a/app/submodule/network/network_submodule.go +++ b/app/submodule/network/network_submodule.go @@ -10,6 +10,8 @@ import ( "github.com/filecoin-project/venus/pkg/net/helloprotocol" "github.com/dchest/blake2b" + "github.com/ipfs/go-bitswap" + bsnet "github.com/ipfs/go-bitswap/network" bserv "github.com/ipfs/go-blockservice" "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" @@ -20,8 +22,6 @@ import ( "github.com/ipfs/go-graphsync/storeutil" exchange "github.com/ipfs/go-ipfs-exchange-interface" cbor "github.com/ipfs/go-ipld-cbor" - "github.com/ipfs/go-libipfs/bitswap" - bsnet "github.com/ipfs/go-libipfs/bitswap/network" blocks "github.com/ipfs/go-libipfs/blocks" logging "github.com/ipfs/go-log" "github.com/libp2p/go-libp2p" diff --git a/cmd/address.go b/cmd/address.go index 14c28d617e..ef35f78b67 100644 --- a/cmd/address.go +++ b/cmd/address.go @@ -60,7 +60,7 @@ type AddressLsResult struct { var addrsNewCmd = &cmds.Command{ Options: []cmds.Option{ - cmds.StringOption("type", "The type of address to create: bls (default) or secp256k1").WithDefault("bls"), + cmds.StringOption("type", "The type of address to create: bls (default) or secp256k1 or delegated").WithDefault("bls"), }, Run: func(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment) error { protocolName := req.Options["type"].(string) @@ -70,6 +70,8 @@ var addrsNewCmd = &cmds.Command{ protocol = address.SECP256K1 case "bls": protocol = address.BLS + case "delegated": + protocol = address.Delegated default: return fmt.Errorf("unrecognized address protocol %s", protocolName) } diff --git a/cmd/evm.go b/cmd/evm.go index 4d494bb0eb..ff4c38f808 100644 --- a/cmd/evm.go +++ b/cmd/evm.go @@ -23,6 +23,7 @@ import ( "github.com/filecoin-project/venus/app/node" "github.com/filecoin-project/venus/pkg/constants" "github.com/filecoin-project/venus/venus-shared/actors" + "github.com/filecoin-project/venus/venus-shared/actors/builtin" v1api "github.com/filecoin-project/venus/venus-shared/api/chain/v1" "github.com/filecoin-project/venus/venus-shared/types" ) @@ -76,16 +77,22 @@ var evmGetInfoCmd = &cmds.Command{ } actor, err := chainAPI.StateGetActor(ctx, faddr, types.EmptyTSK) - if err != nil { - return err - } buf := new(bytes.Buffer) writer := NewSilentWriter(buf) writer.Println("Filecoin address: ", faddr) - writer.Println("Eth address: ", eaddr) - writer.Println("Code cid: ", actor.Code.String()) + writer.Println("Eth address: ", eaddr) + if err != nil { + writer.Printf("Actor lookup failed for faddr %s with error: %s\n", faddr, err) + } else { + idAddr, err := chainAPI.StateLookupID(ctx, faddr, types.EmptyTSK) + if err == nil { + writer.Println("ID address: ", idAddr) + writer.Println("Code cid: ", actor.Code.String()) + writer.Println("Actor Type: ", builtin.ActorNameByCode(actor.Code)) + } + } return re.Emit(buf) }, @@ -241,22 +248,19 @@ var evmDeployCmd = &cmds.Command{ Params: params, } - buf := &bytes.Buffer{} - afmt := NewSilentWriter(buf) - // TODO: On Jan 11th, we decided to add an `EAM#create_external` method // that uses the nonce of the caller instead of taking a user-supplied nonce. // Track: https://github.com/filecoin-project/ref-fvm/issues/1255 // When that's implemented, we should migrate the CLI to use that, // as `EAM#create` will be reserved for the EVM runtime actor. // TODO: this is very racy. It may assign a _different_ nonce than the expected one. - afmt.Println("sending message...") + _ = printOneString(re, "sending message...") smsg, err := env.(*node.Env).MessagePoolAPI.MpoolPushMessage(ctx, msg, nil) if err != nil { return fmt.Errorf("failed to push message: %w", err) } - afmt.Println("waiting for message to execute...") + _ = printOneString(re, fmt.Sprintf("waiting for message %v to execute...", smsg.Cid())) wait, err := env.(*node.Env).ChainAPI.StateWaitMsg(ctx, smsg.Cid(), 0, constants.LookbackNoLimit, true) if err != nil { return fmt.Errorf("error waiting for message: %w", err) @@ -277,6 +281,10 @@ var evmDeployCmd = &cmds.Command{ if err != nil { return err } + + buf := &bytes.Buffer{} + afmt := NewSilentWriter(buf) + afmt.Printf("Actor ID: %d\n", result.ActorID) afmt.Printf("ID Address: %s\n", addr) afmt.Printf("Robust Address: %s\n", result.RobustAddress) @@ -340,7 +348,7 @@ var evmInvokeCmd = &cmds.Command{ var fromAddr address.Address if from, _ := req.Options["from"].(string); from == "" { - defaddr, err := env.(node.Env).WalletAPI.WalletDefaultAddress(ctx) + defaddr, err := getEnv(env).WalletAPI.WalletDefaultAddress(ctx) if err != nil { return err } @@ -365,16 +373,14 @@ var evmInvokeCmd = &cmds.Command{ Params: callData, } - buf := &bytes.Buffer{} - afmt := NewSilentWriter(buf) - afmt.Println("sending message...") - smsg, err := env.(node.Env).MessagePoolAPI.MpoolPushMessage(ctx, msg, nil) + _ = printOneString(re, "sending message...") + smsg, err := getEnv(env).MessagePoolAPI.MpoolPushMessage(ctx, msg, nil) if err != nil { return fmt.Errorf("failed to push message: %w", err) } - afmt.Println("waiting for message to execute...") - wait, err := env.(node.Env).ChainAPI.StateWaitMsg(ctx, smsg.Cid(), 0, constants.LookbackNoLimit, true) + _ = printOneString(re, fmt.Sprintf("waiting for message %v to execute...", smsg.Cid())) + wait, err := getEnv(env).ChainAPI.StateWaitMsg(ctx, smsg.Cid(), 0, constants.LookbackNoLimit, true) if err != nil { return fmt.Errorf("error waiting for message: %w", err) } @@ -384,6 +390,8 @@ var evmInvokeCmd = &cmds.Command{ return fmt.Errorf("actor execution failed") } + buf := &bytes.Buffer{} + afmt := NewSilentWriter(buf) afmt.Println("Gas used: ", wait.Receipt.GasUsed) result, err := cbg.ReadByteArray(bytes.NewBuffer(wait.Receipt.Return), uint64(len(wait.Receipt.Return))) if err != nil { @@ -391,7 +399,7 @@ var evmInvokeCmd = &cmds.Command{ } if len(result) > 0 { - afmt.Println(hex.EncodeToString(result)) + afmt.Println("Result: ", hex.EncodeToString(result)) } else { afmt.Println("OK") } diff --git a/cmd/message.go b/cmd/message.go index 5a35e3add6..f2050dfd10 100644 --- a/cmd/message.go +++ b/cmd/message.go @@ -11,6 +11,7 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" fbig "github.com/filecoin-project/go-state-types/big" + builtintypes "github.com/filecoin-project/go-state-types/builtin" "github.com/ipfs/go-cid" cmds "github.com/ipfs/go-ipfs-cmds" "github.com/pkg/errors" @@ -106,12 +107,6 @@ var msgSendCmd = &cmds.Command{ return fmt.Errorf("mal-formed value: %v", err) } - methodID := builtin.MethodSend - method, ok := req.Options["method"] - if ok { - methodID = abi.MethodNum(method.(uint64)) - } - var fromAddr address.Address if addrStr, _ := req.Options["from-eth-addr"].(string); len(addrStr) != 0 { fromAddr, err = address.NewFromString(addrStr) @@ -125,14 +120,53 @@ var msgSendCmd = &cmds.Command{ } } - if fromAddr.Protocol() == address.Delegated { + var params []byte + if rawPH := req.Options["params-hex"]; rawPH != nil { + decparams, err := hex.DecodeString(rawPH.(string)) + if err != nil { + return fmt.Errorf("failed to decode hex params: %w", err) + } + params = decparams + } + + methodID := builtin.MethodSend + method := req.Options["method"] + if types.IsEthAddress(fromAddr) { + // Method numbers don't make sense from eth accounts. + if method != nil { + return fmt.Errorf("messages from f410f addresses may not specify a method number") + } + + // Now, figure out the correct method number from the recipient. + if toAddr == builtintypes.EthereumAddressManagerActorAddr { + methodID = builtintypes.MethodsEAM.CreateExternal + } else { + methodID = builtintypes.MethodsEVM.InvokeContract + } + + if req.Options["params-json"] != nil { + return fmt.Errorf("may not call with json parameters from an eth account") + } + + // And format the parameters, if present. + if len(params) > 0 { + var buf bytes.Buffer + if err := cbg.WriteByteArray(&buf, params); err != nil { + return fmt.Errorf("failed to marshal EVM parameters") + } + params = buf.Bytes() + } + + // We can only send to an f410f or f0 address. if !(toAddr.Protocol() == address.ID || toAddr.Protocol() == address.Delegated) { // Resolve id addr if possible. toAddr, err = env.(*node.Env).ChainAPI.StateLookupID(ctx, toAddr, types.EmptyTSK) if err != nil { - return fmt.Errorf("f4 addresses can only send to other f4 or id addresses. could not find id address for %s", toAddr.String()) + return fmt.Errorf("addresses starting with f410f can only send to other addresses starting with f410f, or id addresses. could not find id address for %s", toAddr.String()) } } + } else if method != nil { + methodID = abi.MethodNum(method.(uint64)) } if methodID == builtin.MethodSend && fromAddr.String() == toAddr.String() { @@ -148,24 +182,14 @@ var msgSendCmd = &cmds.Command{ return err } - var params []byte rawPJ := req.Options["params-json"] if rawPJ != nil { - decparams, err := decodeTypedParams(ctx, env.(*node.Env), toAddr, methodID, rawPJ.(string)) - if err != nil { - return fmt.Errorf("failed to decode json params: %s", err) - } - params = decparams - } - - rawPH := req.Options["params-hex"] - if rawPH != nil { if params != nil { return fmt.Errorf("can only specify one of 'params-json' and 'params-hex'") } - decparams, err := hex.DecodeString(rawPH.(string)) + decparams, err := decodeTypedParams(ctx, env.(*node.Env), toAddr, methodID, rawPJ.(string)) if err != nil { - return fmt.Errorf("failed to decode hex params: %s", err) + return fmt.Errorf("failed to decode json params: %s", err) } params = decparams } diff --git a/cmd/miner.go b/cmd/miner.go index f6e0fbabc9..52e77314f1 100644 --- a/cmd/miner.go +++ b/cmd/miner.go @@ -229,7 +229,7 @@ var minerInfoCmd = &cmds.Command{ blockstoreAPI := env.(*node.Env).BlockStoreAPI api := env.(*node.Env).ChainAPI - blockDelay, err := blockDelay(req) + blockDelay, err := getBlockDelay(ctx, env) if err != nil { return err } diff --git a/cmd/miner_proving.go b/cmd/miner_proving.go index 69dc70b57e..91c9f0bf4b 100644 --- a/cmd/miner_proving.go +++ b/cmd/miner_proving.go @@ -43,7 +43,7 @@ var provingInfoCmd = &cmds.Command{ } ctx := req.Context - blockDelay, err := blockDelay(req) + blockDelay, err := getBlockDelay(ctx, env) if err != nil { return err } @@ -123,8 +123,8 @@ var provingInfoCmd = &cmds.Command{ writer.Printf("Current Epoch: %d\n", cd.CurrentEpoch) writer.Printf("Proving Period Boundary: %d\n", cd.PeriodStart%cd.WPoStProvingPeriod) - writer.Printf("Proving Period Start: %s\n", EpochTime(cd.CurrentEpoch, cd.PeriodStart, blockDelay)) - writer.Printf("Next Period Start: %s\n", EpochTime(cd.CurrentEpoch, cd.PeriodStart+cd.WPoStProvingPeriod, blockDelay)) + writer.Printf("Proving Period Start: %s\n", EpochTimeTs(cd.CurrentEpoch, cd.PeriodStart, blockDelay, head)) + writer.Printf("Next Period Start: %s\n", EpochTimeTs(cd.CurrentEpoch, cd.PeriodStart+cd.WPoStProvingPeriod, blockDelay, head)) writer.Println() writer.Printf("Faults: %d (%.2f%%)\n", faults, faultPerc) diff --git a/cmd/state.go b/cmd/state.go index 5e3f045e91..c0019fd1f1 100644 --- a/cmd/state.go +++ b/cmd/state.go @@ -5,14 +5,11 @@ import ( "encoding/json" "fmt" "io" - "path/filepath" + "os" "strconv" - "github.com/filecoin-project/venus/app/paths" "github.com/filecoin-project/venus/cmd/tablewriter" - "github.com/filecoin-project/venus/pkg/config" - "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" actorstypes "github.com/filecoin-project/go-state-types/actors" @@ -57,6 +54,7 @@ var stateCmd = &cmds.Command{ "list-actor": stateListActorCmd, "actor-cids": stateSysActorCIDsCmd, "replay": stateReplayCmd, + "compute-state": StateComputeStateCmd, }, } @@ -257,7 +255,8 @@ var stateSectorCmd = &cmds.Command{ return err } - ts, err := env.(*node.Env).ChainAPI.ChainHead(req.Context) + ctx := req.Context + ts, err := env.(*node.Env).ChainAPI.ChainHead(ctx) if err != nil { return err } @@ -267,12 +266,12 @@ var stateSectorCmd = &cmds.Command{ return err } - blockDelay, err := blockDelay(req) + blockDelay, err := getBlockDelay(ctx, env) if err != nil { return err } - si, err := env.(*node.Env).ChainAPI.StateSectorGetInfo(req.Context, maddr, abi.SectorNumber(sid), ts.Key()) + si, err := env.(*node.Env).ChainAPI.StateSectorGetInfo(ctx, maddr, abi.SectorNumber(sid), ts.Key()) if err != nil { return err } @@ -289,8 +288,8 @@ var stateSectorCmd = &cmds.Command{ writer.Println("SealedCID: ", si.SealedCID) writer.Println("DealIDs: ", si.DealIDs) writer.Println() - writer.Println("Activation: ", EpochTime(height, si.Activation, blockDelay)) - writer.Println("Expiration: ", EpochTime(height, si.Expiration, blockDelay)) + writer.Println("Activation: ", EpochTimeTs(height, si.Activation, blockDelay, ts)) + writer.Println("Expiration: ", EpochTimeTs(height, si.Expiration, blockDelay, ts)) writer.Println() writer.Println("DealWeight: ", si.DealWeight) writer.Println("VerifiedDealWeight: ", si.VerifiedDealWeight) @@ -311,22 +310,6 @@ var stateSectorCmd = &cmds.Command{ }, } -func blockDelay(req *cmds.Request) (uint64, error) { - var err error - repoDir, _ := req.Options[OptionRepoDir].(string) - repoDir, err = paths.GetRepoPath(repoDir) - if err != nil { - return 0, err - } - cfgPath := filepath.Join(repoDir, "config.json") - cfg, err := config.ReadFile(cfgPath) - if err != nil { - return 0, err - } - - return cfg.NetworkParams.BlockDelay, nil -} - var stateGetActorCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Print actor information", @@ -471,22 +454,23 @@ var stateMinerInfo = &cmds.Command{ return err } - blockDelay, err := blockDelay(req) + ctx := req.Context + blockDelay, err := getBlockDelay(ctx, env) if err != nil { return err } - ts, err := env.(*node.Env).ChainAPI.ChainHead(req.Context) + ts, err := env.(*node.Env).ChainAPI.ChainHead(ctx) if err != nil { return err } - mi, err := env.(*node.Env).ChainAPI.StateMinerInfo(req.Context, addr, ts.Key()) + mi, err := env.(*node.Env).ChainAPI.StateMinerInfo(ctx, addr, ts.Key()) if err != nil { return err } - availableBalance, err := env.(*node.Env).ChainAPI.StateMinerAvailableBalance(req.Context, addr, ts.Key()) + availableBalance, err := env.(*node.Env).ChainAPI.StateMinerAvailableBalance(ctx, addr, ts.Key()) if err != nil { return fmt.Errorf("getting miner available balance: %w", err) } @@ -535,7 +519,7 @@ var stateMinerInfo = &cmds.Command{ writer.Println() - cd, err := env.(*node.Env).ChainAPI.StateMinerProvingDeadline(req.Context, addr, ts.Key()) + cd, err := env.(*node.Env).ChainAPI.StateMinerProvingDeadline(ctx, addr, ts.Key()) if err != nil { return fmt.Errorf("getting miner info: %w", err) } @@ -727,3 +711,86 @@ func makeActorView(act *types.Actor, addr address.Address) *ActorView { Head: act.Head, } } + +var StateComputeStateCmd = &cmds.Command{ + Helptext: cmds.HelpText{ + Tagline: "Perform state computations", + }, + Options: []cmds.Option{ + cmds.Uint64Option("vm-height", "set the height that the vm will see"), + cmds.BoolOption("apply-mpool-messages", "apply messages from the mempool to the computed state"), + cmds.BoolOption("show-trace", "print out full execution trace for given tipset"), + cmds.BoolOption("json", "generate json output"), + cmds.StringOption("compute-state-output", "a json file containing pre-existing compute-state output, to generate html reports without rerunning state changes"), + cmds.BoolOption("no-timing", "don't show timing information in html traces"), + cmds.StringOption("tipset", ""), + }, + Run: func(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment) error { + ctx := req.Context + + ts, err := LoadTipSet(ctx, req, getEnv(env).ChainAPI) + if err != nil { + return err + } + h, _ := req.Options["vm-height"].(uint64) + if h == 0 { + h = uint64(ts.Height()) + } + + var msgs []*types.Message + if applyMsg, _ := req.Options["apply-mpool-messages"].(bool); applyMsg { + pmsgs, err := getEnv(env).MessagePoolAPI.MpoolSelect(ctx, ts.Key(), 1) + if err != nil { + return err + } + + for _, sm := range pmsgs { + msgs = append(msgs, &sm.Message) + } + } + + var stout *types.ComputeStateOutput + if csofile, _ := req.Options["compute-state-output"].(string); len(csofile) != 0 { + data, err := os.ReadFile(csofile) + if err != nil { + return err + } + + var o types.ComputeStateOutput + if err := json.Unmarshal(data, &o); err != nil { + return err + } + + stout = &o + } else { + o, err := getEnv(env).ChainAPI.StateCompute(ctx, abi.ChainEpoch(h), msgs, ts.Key()) + if err != nil { + return err + } + + stout = o + } + + buf := &bytes.Buffer{} + writer := NewSilentWriter(buf) + + if ok, _ := req.Options["json"].(bool); ok { + out, err := json.Marshal(stout) + if err != nil { + return err + } + writer.Println(string(out)) + return re.Emit(buf) + } + + writer.Println("computed state cid: ", stout.Root) + if showTrace, _ := req.Options["show-trace"].(bool); showTrace { + for _, ir := range stout.Trace { + writer.Printf("%s\t%s\t%s\t%d\t%x\t%d\t%x\n", ir.Msg.From, ir.Msg.To, ir.Msg.Value, ir.Msg.Method, ir.Msg.Params, ir.MsgRct.ExitCode, ir.MsgRct.Return) + printInternalExecutions(writer, "\t", ir.ExecutionTrace.Subcalls) + } + } + + return re.Emit(buf) + }, +} diff --git a/cmd/utils.go b/cmd/utils.go index 041149b799..8104298d6a 100644 --- a/cmd/utils.go +++ b/cmd/utils.go @@ -141,6 +141,15 @@ func cidsFromSlice(args []string) ([]cid.Cid, error) { return out, nil } +func getBlockDelay(ctx context.Context, env cmds.Environment) (uint64, error) { + params, err := env.(*node.Env).ChainAPI.StateGetNetworkParams(ctx) + if err != nil { + return 0, err + } + + return params.BlockDelaySecs, nil +} + func EpochTime(curr, e abi.ChainEpoch, blockDelay uint64) string { switch { case curr > e: @@ -154,6 +163,26 @@ func EpochTime(curr, e abi.ChainEpoch, blockDelay uint64) string { panic("math broke") } +// EpochTimeTs is like EpochTime, but also outputs absolute time. `ts` is only +// used to provide a timestamp at some epoch to calculate time from. It can be +// a genesis tipset. +// +// Example output: `1944975 (01 Jul 22 08:07 CEST, 10 hours 29 minutes ago)` +func EpochTimeTs(curr, e abi.ChainEpoch, blockDelay uint64, ts *types.TipSet) string { + timeStr := time.Unix(int64(ts.MinTimestamp()+(uint64(e-ts.Height())*blockDelay)), 0).Format(time.RFC822) + + switch { + case curr > e: + return fmt.Sprintf("%d (%s, %s ago)", e, timeStr, durafmt.Parse(time.Second*time.Duration(int64(blockDelay)*int64(curr-e))).LimitFirstN(2)) + case curr == e: + return fmt.Sprintf("%d (%s, now)", e, timeStr) + case curr < e: + return fmt.Sprintf("%d (%s, in %s)", e, timeStr, durafmt.Parse(time.Second*time.Duration(int64(blockDelay)*int64(e-curr))).LimitFirstN(2)) + } + + panic("math broke") +} + func printOneString(re cmds.ResponseEmitter, str string) error { buf := new(bytes.Buffer) writer := NewSilentWriter(buf) @@ -195,3 +224,7 @@ func isController(mi types.MinerInfo, addr address.Address) bool { return false } + +func getEnv(env cmds.Environment) *node.Env { + return env.(*node.Env) +} diff --git a/extern/filecoin-ffi b/extern/filecoin-ffi index 7efaa7b47f..1bc8bf8b48 160000 --- a/extern/filecoin-ffi +++ b/extern/filecoin-ffi @@ -1 +1 @@ -Subproject commit 7efaa7b47fe9d4bdb4ba0b2a0fafa4e573864ee5 +Subproject commit 1bc8bf8b482b2ef34cbce17bfc3a7ec68c047461 diff --git a/fixtures/networks/calibration.go b/fixtures/networks/calibration.go index bacb090a17..5a04fceb83 100644 --- a/fixtures/networks/calibration.go +++ b/fixtures/networks/calibration.go @@ -4,6 +4,7 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/network" + builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" "github.com/filecoin-project/venus/pkg/config" "github.com/filecoin-project/venus/venus-shared/types" ) @@ -48,7 +49,7 @@ func Calibration() *NetworkConf { UpgradeLiftoffHeight: -5, UpgradeKumquatHeight: 90, UpgradeCalicoHeight: 120, - UpgradePersianHeight: 100 + (120 * 1), + UpgradePersianHeight: 120 + (builtin2.EpochsInHour * 1), UpgradeClausHeight: 270, UpgradeOrangeHeight: 300, UpgradeTrustHeight: 330, diff --git a/fixtures/networks/mainnet.go b/fixtures/networks/mainnet.go index d038fe2dbe..a02c03b2ae 100644 --- a/fixtures/networks/mainnet.go +++ b/fixtures/networks/mainnet.go @@ -70,7 +70,7 @@ func Mainnet() *NetworkConf { UpgradeOhSnapHeight: 1594680, // 2022-03-01T15:00:00Z UpgradeSkyrHeight: 1960320, // 2022-07-06T14:00:00Z UpgradeSharkHeight: 2383680, // 2022-11-30T14:00:00Z - UpgradeHyggeHeight: 99999999999999, + UpgradeHyggeHeight: 2683348, // 2023-03-14T15:14:00Z }, DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 5, 51000: 1}, AddressNetwork: address.Mainnet, diff --git a/go.mod b/go.mod index ac747b19df..76ab0e59ea 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( github.com/filecoin-project/go-fil-markets v1.25.2 github.com/filecoin-project/go-jsonrpc v0.1.5 github.com/filecoin-project/go-paramfetch v0.0.4 - github.com/filecoin-project/go-state-types v0.10.0-rc3 + github.com/filecoin-project/go-state-types v0.10.0 github.com/filecoin-project/pubsub v1.0.0 github.com/filecoin-project/specs-actors v0.9.15 github.com/filecoin-project/specs-actors/v2 v2.3.6 @@ -44,7 +44,7 @@ require ( github.com/filecoin-project/specs-actors/v8 v8.0.1 github.com/filecoin-project/specs-storage v0.4.1 github.com/filecoin-project/test-vectors/schema v0.0.5 - github.com/filecoin-project/venus-auth v1.10.0-rc2.0.20230228032348-a2418f5a8838 + github.com/filecoin-project/venus-auth v1.10.2-0.20230308100319-913815325d5e github.com/fxamacker/cbor/v2 v2.4.0 github.com/go-errors/errors v1.0.1 github.com/go-kit/kit v0.12.0 @@ -58,6 +58,7 @@ require ( github.com/hashicorp/golang-lru v0.5.4 github.com/howeyc/gopass v0.0.0-20190910152052-7cb4b85ec19c github.com/ipfs-force-community/metrics v1.0.1-0.20211022060227-11142a08b729 + github.com/ipfs/go-bitswap v0.10.2 github.com/ipfs/go-blockservice v0.4.0 github.com/ipfs/go-cid v0.3.2 github.com/ipfs/go-datastore v0.6.0 @@ -104,7 +105,7 @@ require ( github.com/whyrusleeping/go-sysinfo v0.0.0-20190219211824-4a357d4b90b1 go.opencensus.io v0.23.0 go.uber.org/zap v1.23.0 - golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 + golang.org/x/crypto v0.5.0 golang.org/x/net v0.7.0 golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 golang.org/x/sync v0.0.0-20220907140024-f12130a52804 @@ -116,7 +117,14 @@ require ( gotest.tools v2.2.0+incompatible ) -require github.com/ipfs/go-block-format v0.1.1 // indirect +require ( + github.com/bytedance/sonic v1.8.0 // indirect + github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect + github.com/goccy/go-json v0.10.0 // indirect + github.com/ipfs/go-block-format v0.1.1 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect +) require ( github.com/BurntSushi/toml v1.1.0 // indirect @@ -158,14 +166,14 @@ require ( github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/gbrlsnchs/jwt/v3 v3.0.1 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/gin-gonic/gin v1.7.7 // indirect + github.com/gin-gonic/gin v1.9.0 // indirect github.com/go-kit/log v0.2.0 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-playground/locales v0.13.0 // indirect - github.com/go-playground/universal-translator v0.17.0 // indirect - github.com/go-playground/validator/v10 v10.4.1 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.11.2 // indirect github.com/go-redis/redis/v7 v7.0.0-beta // indirect github.com/go-redis/redis_rate/v7 v7.0.1 // indirect github.com/go-resty/resty/v2 v2.4.0 // indirect @@ -233,7 +241,7 @@ require ( github.com/marten-seemann/qtls-go1-19 v0.1.0 // indirect github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect github.com/mattn/go-pointer v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.10 // indirect github.com/mattn/go-sqlite3 v1.14.16 @@ -260,7 +268,7 @@ require ( github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.2 // indirect + github.com/pelletier/go-toml/v2 v2.0.6 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e // indirect github.com/prometheus/client_model v0.2.0 // indirect @@ -283,7 +291,7 @@ require ( github.com/subosito/gotenv v1.4.0 // indirect github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e // indirect github.com/uber/jaeger-client-go v2.25.0+incompatible // indirect - github.com/ugorji/go/codec v1.1.7 // indirect + github.com/ugorji/go/codec v1.2.9 // indirect github.com/urfave/cli/v2 v2.16.3 // indirect github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f // indirect github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect @@ -316,6 +324,6 @@ require ( replace ( github.com/filecoin-project/filecoin-ffi => ./extern/filecoin-ffi - github.com/filecoin-project/go-jsonrpc => github.com/ipfs-force-community/go-jsonrpc v0.1.7-0.20230214070559-dbe74781184a + github.com/filecoin-project/go-jsonrpc => github.com/ipfs-force-community/go-jsonrpc v0.1.7 github.com/filecoin-project/test-vectors => ./extern/test-vectors ) diff --git a/go.sum b/go.sum index c56be7bf6f..0543a2d403 100644 --- a/go.sum +++ b/go.sum @@ -157,6 +157,9 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= +github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= +github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= +github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -166,6 +169,9 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= +github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -348,8 +354,8 @@ github.com/filecoin-project/go-state-types v0.1.4/go.mod h1:xCA/WfKlC2zcn3fUmDv4 github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= github.com/filecoin-project/go-state-types v0.1.8/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= github.com/filecoin-project/go-state-types v0.1.10/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= -github.com/filecoin-project/go-state-types v0.10.0-rc3 h1:qExCc2swTe5ndsiu9dEoMqIwppjuTNRbsAFgpzHnHbc= -github.com/filecoin-project/go-state-types v0.10.0-rc3/go.mod h1:aLIas+W8BWAfpLWEPUOGMPBdhcVwoCG4pIQSQk26024= +github.com/filecoin-project/go-state-types v0.10.0 h1:vsSThZIaPmOxNGG59+8D/HnlWRtlbdOjduH6ye+v8f0= +github.com/filecoin-project/go-state-types v0.10.0/go.mod h1:aLIas+W8BWAfpLWEPUOGMPBdhcVwoCG4pIQSQk26024= github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= github.com/filecoin-project/go-statemachine v1.0.2 h1:421SSWBk8GIoCoWYYTE/d+qCWccgmRH0uXotXRDjUbc= github.com/filecoin-project/go-statemachine v1.0.2/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54= @@ -382,8 +388,8 @@ github.com/filecoin-project/specs-storage v0.4.1/go.mod h1:Z2eK6uMwAOSLjek6+sy0j github.com/filecoin-project/storetheindex v0.4.30-0.20221114113647-683091f8e893 h1:6GCuzxLVHBzlz7y+FkbHh6n0UyoEGWqDwJKQPJoz7bE= github.com/filecoin-project/test-vectors/schema v0.0.5 h1:w3zHQhzM4pYxJDl21avXjOKBLF8egrvwUwjpT8TquDg= github.com/filecoin-project/test-vectors/schema v0.0.5/go.mod h1:iQ9QXLpYWL3m7warwvK1JC/pTri8mnfEmKygNDqqY6E= -github.com/filecoin-project/venus-auth v1.10.0-rc2.0.20230228032348-a2418f5a8838 h1:NbBSFyb5yoKfbtd5jX9JdkJ9vupuS0DM2f/tY7Pi9lo= -github.com/filecoin-project/venus-auth v1.10.0-rc2.0.20230228032348-a2418f5a8838/go.mod h1:5scCRopeVuhwom6QIJaFENmrmL+HrwVElx+qU/oQ3Dw= +github.com/filecoin-project/venus-auth v1.10.2-0.20230308100319-913815325d5e h1:Bxpt1AzPeNxmUnFT2Y8rpabr9x0wIC0Q87DeRmjL2co= +github.com/filecoin-project/venus-auth v1.10.2-0.20230308100319-913815325d5e/go.mod h1:aBfIfNxQkdcY8Rk5wrQn9qRtJpH4RTDdc10Ac+ferzs= 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= @@ -409,8 +415,8 @@ github.com/getkin/kin-openapi v0.13.0/go.mod h1:WGRs2ZMM1Q8LR1QBEwUxC6RJEfaBcD0s github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.7 h1:3DoBmSbJbZAWqXJC3SLjAPfutPJJRN1U5pALB7EeTTs= -github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= +github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= +github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= github.com/go-chi/chi v4.0.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= @@ -439,14 +445,13 @@ github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= +github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-redis/redis/v7 v7.0.0-beta h1:sm826nuE9AVZl06YSag54VTSpbGdIUMXCXXOHh48nFU= github.com/go-redis/redis/v7 v7.0.0-beta/go.mod h1:dohSoK1cSNPaisjbZhSk7RYyPhVx2k+4sAbJdPK5KPs= @@ -461,6 +466,8 @@ github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LB github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= +github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190402143921-271e53dc4968/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -674,8 +681,8 @@ github.com/influxdata/influxdb-client-go/v2 v2.2.2/go.mod h1:fa/d1lAdUHxuc1jedx3 github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7wlPfJLvMCdtV4zPulc4uCPrlywQOmbFOhgQNU= github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/ipfs-force-community/go-jsonrpc v0.1.7-0.20230214070559-dbe74781184a h1:qiOQ2/neQ5fbfBE5cPr5ncR1YsukuO5PmlIwmv4CcaU= -github.com/ipfs-force-community/go-jsonrpc v0.1.7-0.20230214070559-dbe74781184a/go.mod h1:jBSvPTl8V1N7gSTuCR4bis8wnQnIjHbRPpROol6iQKM= +github.com/ipfs-force-community/go-jsonrpc v0.1.7 h1:e0ZTapGFhDY54j0QpRYN54Q3FHawUBQAM1KvXOzZtYY= +github.com/ipfs-force-community/go-jsonrpc v0.1.7/go.mod h1:jBSvPTl8V1N7gSTuCR4bis8wnQnIjHbRPpROol6iQKM= github.com/ipfs-force-community/metrics v1.0.1-0.20211022060227-11142a08b729 h1:elS3KmzAMVrcZpmP2RMEjs9Zlwh6LfhJTfYQdj4TREs= github.com/ipfs-force-community/metrics v1.0.1-0.20211022060227-11142a08b729/go.mod h1:mn40SioMuKtjmRumHFy/fJ26Pn028XuDjUJE9dorjyw= github.com/ipfs/bbloom v0.0.1/go.mod h1:oqo8CVWsJFMOZqTglBG4wydCE4IQA/G2/SEofB0rjUI= @@ -688,6 +695,7 @@ github.com/ipfs/go-bitswap v0.1.0/go.mod h1:FFJEf18E9izuCqUtHxbWEvq+reg7o4CW5wSA github.com/ipfs/go-bitswap v0.1.2/go.mod h1:qxSWS4NXGs7jQ6zQvoPY3+NmOfHHG47mhkiLzBpJQIs= github.com/ipfs/go-bitswap v0.5.1/go.mod h1:P+ckC87ri1xFLvk74NlXdP0Kj9RmWAh4+H78sC6Qopo= github.com/ipfs/go-bitswap v0.10.2 h1:B81RIwkTnIvSYT1ZCzxjYTeF0Ek88xa9r1AMpTfk+9Q= +github.com/ipfs/go-bitswap v0.10.2/go.mod h1:+fZEvycxviZ7c+5KlKwTzLm0M28g2ukCPqiuLfJk4KA= github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc= github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= github.com/ipfs/go-block-format v0.0.3/go.mod h1:4LmD4ZUw0mhO+JSKdpWwrzATiEfM7WWgQ8H5l6P8MVk= @@ -964,7 +972,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/libp2p/go-addr-util v0.0.1/go.mod h1:4ac6O7n9rIAKB1dnd+s8IbbMXkt+oBpzX4/+RACcnlQ= @@ -1296,8 +1303,9 @@ github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcME github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-pointer v0.0.1 h1:n+XhsuGeVO6MEAp7xyEukFINEa+Quek5psIR/ylA6o0= github.com/mattn/go-pointer v0.0.1/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -1510,8 +1518,8 @@ github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtP github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.2 h1:+jQXlF3scKIcSEKkdHzXhCTDLPFi5r1wnK6yPS+49Gw= -github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI= +github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= +github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9 h1:1/WtZae0yGtPq+TI6+Tv1WTxkukpXeMlviSxvL7SRgk= github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9/go.mod h1:x3N5drFsm2uilKKuuYo6LdyD8vZAW55sH/9w+pbo1sw= @@ -1704,7 +1712,6 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= @@ -1716,6 +1723,8 @@ github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e h1: github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e/go.mod h1:XDKHRm5ThF8YJjx001LtgelzsoaEcvnA7lVWz9EeX3g= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/twitchyliquid64/golang-asm v0.15.0/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/twmb/murmur3 v1.1.6 h1:mqrRot1BRxm+Yct+vavLMou2/iJt0tNVTTC0QoIjaZg= github.com/uber/jaeger-client-go v2.15.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-client-go v2.23.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= @@ -1724,10 +1733,9 @@ github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMW github.com/uber/jaeger-lib v1.5.1-0.20181102163054-1fc5c315e03c/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw= github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= +github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= @@ -1879,6 +1887,8 @@ go4.org v0.0.0-20200411211856-f5505b9728dd h1:BNJlw5kRTzdmyfh5U8F93HA2OwkP7ZGwA5 go4.org v0.0.0-20200411211856-f5505b9728dd/go.mod h1:CIiUVy99QCPfoE13bO4EZaz5GZMZXMSBGhxRdsvzbkg= golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= golang.org/x/arch v0.0.0-20201008161808-52c3e6f60cff/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1922,8 +1932,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= +golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= diff --git a/main.go b/main.go index e549e29fde..4bf46db5e7 100644 --- a/main.go +++ b/main.go @@ -15,6 +15,7 @@ func main() { lvl := os.Getenv("GO_FILECOIN_LOG_LEVEL") if lvl == "" { logging.SetAllLoggers(logging.LevelInfo) + _ = logging.SetLogLevel("statemanager", "info") _ = logging.SetLogLevel("beacon", "error") _ = logging.SetLogLevel("peer-tracker", "error") _ = logging.SetLogLevel("dht", "error") diff --git a/pkg/chain/message_store.go b/pkg/chain/message_store.go index 6eae86b4e5..2f0f17b062 100644 --- a/pkg/chain/message_store.go +++ b/pkg/chain/message_store.go @@ -307,7 +307,6 @@ func (ms *MessageStore) LoadTipSetMesssages(ctx context.Context, ts *types.TipSe // storage and returns the slice implied by the collection func (ms *MessageStore) LoadReceipts(ctx context.Context, c cid.Cid) ([]types.MessageReceipt, error) { as := cbor.NewCborStore(ms.bs) - fmt.Println(c.String()) a, err := adt.AsArray(adt.WrapStore(ctx, as), c) if err != nil { return nil, err @@ -329,8 +328,7 @@ func (ms *MessageStore) LoadReceipts(ctx context.Context, c cid.Cid) ([]types.Me // StoreReceipts puts the input signed messages to a collection and then writes // this collection to ipld storage. The cid of the collection is returned. func (ms *MessageStore) StoreReceipts(ctx context.Context, receipts []types.MessageReceipt) (cid.Cid, error) { - tmp := blockstoreutil.NewTemporary() - rectarr := adt.MakeEmptyArray(adt.WrapStore(ctx, cbor.NewCborStore(tmp))) + rectarr := adt.MakeEmptyArray(adt.WrapStore(ctx, cbor.NewCborStore(ms.bs))) for i, receipt := range receipts { if err := rectarr.Set(uint64(i), &receipt); err != nil { @@ -338,16 +336,6 @@ func (ms *MessageStore) StoreReceipts(ctx context.Context, receipts []types.Mess } } - root, err := rectarr.Root() - if err != nil { - return cid.Undef, err - } - - err = blockstoreutil.CopyParticial(ctx, tmp, ms.bs, root) - if err != nil { - return cid.Undef, err - } - return rectarr.Root() } diff --git a/pkg/chain/store.go b/pkg/chain/store.go index b3dd8ae468..6be3a1698a 100644 --- a/pkg/chain/store.go +++ b/pkg/chain/store.go @@ -571,12 +571,10 @@ func (store *Store) SetHead(ctx context.Context, newTS *types.TipSet) error { new: added, } - store.persistTipSetKey(ctx, newTS.Key()) - return nil } -func (store *Store) persistTipSetKey(ctx context.Context, key types.TipSetKey) { +func (store *Store) PersistTipSetKey(ctx context.Context, key types.TipSetKey) { tskBlk, err := key.ToStorageBlock() if err != nil { log.Errorf("failed to create a block from tsk: %s", key) @@ -1051,7 +1049,7 @@ func (store *Store) Import(ctx context.Context, r io.Reader) (*types.TipSet, err } // save tipsetkey - store.persistTipSetKey(ctx, curParentTipset.Key()) + store.PersistTipSetKey(ctx, curParentTipset.Key()) curTipset = curParentTipset } diff --git a/pkg/chain/testing.go b/pkg/chain/testing.go index 4cfba8de0e..171d49d687 100644 --- a/pkg/chain/testing.go +++ b/pkg/chain/testing.go @@ -190,8 +190,8 @@ func (f *fakeStmgr) GetActorAt(ctx context.Context, a address.Address, set *type return f.cs.GetActorAt(ctx, set, a) } -func (f *fakeStmgr) RunStateTransition(ctx context.Context, set *types.TipSet, cb vm.ExecCallBack) (root cid.Cid, receipts cid.Cid, err error) { - return f.eva.RunStateTransition(ctx, set, cb) +func (f *fakeStmgr) RunStateTransition(ctx context.Context, set *types.TipSet, cb vm.ExecCallBack, vmTracing bool) (root cid.Cid, receipts cid.Cid, err error) { + return f.eva.RunStateTransition(ctx, set, cb, vmTracing) } var _ IStmgr = &fakeStmgr{} @@ -283,7 +283,7 @@ func (f *Builder) AppendOn(ctx context.Context, parent *types.TipSet, width int) } func (f *Builder) FlushHead(ctx context.Context) error { - _, _, e := f.FakeStateEvaluator().RunStateTransition(ctx, f.store.GetHead(), nil) + _, _, e := f.FakeStateEvaluator().RunStateTransition(ctx, f.store.GetHead(), nil, false) return e } @@ -645,7 +645,7 @@ type FakeStateEvaluator struct { } // RunStateTransition delegates to StateBuilder.ComputeState -func (e *FakeStateEvaluator) RunStateTransition(ctx context.Context, ts *types.TipSet, cb vm.ExecCallBack) (rootCid cid.Cid, receiptCid cid.Cid, err error) { +func (e *FakeStateEvaluator) RunStateTransition(ctx context.Context, ts *types.TipSet, cb vm.ExecCallBack, vmTracing bool) (rootCid cid.Cid, receiptCid cid.Cid, err error) { key := ts.Key() e.stLk.Lock() workingCh, exist := e.ChsWorkingOn[key] @@ -707,7 +707,7 @@ func (e *FakeStateEvaluator) ValidateFullBlock(ctx context.Context, blk *types.B return err } - root, receipts, err := e.RunStateTransition(ctx, parent, nil) + root, receipts, err := e.RunStateTransition(ctx, parent, nil, false) if err != nil { return err } diff --git a/pkg/chain/waiter.go b/pkg/chain/waiter.go index 34142eb71c..8115dc3cf8 100644 --- a/pkg/chain/waiter.go +++ b/pkg/chain/waiter.go @@ -35,7 +35,7 @@ type waiterChainReader interface { type IStmgr interface { GetActorAt(context.Context, address.Address, *types.TipSet) (*types.Actor, error) - RunStateTransition(context.Context, *types.TipSet, vm.ExecCallBack) (root cid.Cid, receipts cid.Cid, err error) + RunStateTransition(context.Context, *types.TipSet, vm.ExecCallBack, bool) (root cid.Cid, receipts cid.Cid, err error) } // Waiter waits for a message to appear on chain. @@ -309,7 +309,7 @@ func (w *Waiter) receiptForTipset(ctx context.Context, ts *types.TipSet, msg typ if err != nil { return nil, false, errors.Wrap(err, "error retrieving receipt from tipset") } - return &types.ChainMessage{TS: ts, Message: msg.VMMessage(), Block: bms.Block, Receipt: recpt}, true, nil + return &types.ChainMessage{TS: ts, Message: msg, Block: bms.Block, Receipt: recpt}, true, nil } } } @@ -321,7 +321,7 @@ func (w *Waiter) receiptForTipset(ctx context.Context, ts *types.TipSet, msg typ func (w *Waiter) receiptByIndex(ctx context.Context, ts *types.TipSet, targetCid cid.Cid, blockMsgs []types.BlockMessagesInfo) (*types.MessageReceipt, error) { var receiptCid cid.Cid var err error - if _, receiptCid, err = w.Stmgr.RunStateTransition(ctx, ts, nil); err != nil { + if _, receiptCid, err = w.Stmgr.RunStateTransition(ctx, ts, nil, false); err != nil { return nil, fmt.Errorf("RunStateTransition failed:%w", err) } diff --git a/pkg/chainsync/syncer/syncer.go b/pkg/chainsync/syncer/syncer.go index 91eee1e948..8e84f1c792 100644 --- a/pkg/chainsync/syncer/syncer.go +++ b/pkg/chainsync/syncer/syncer.go @@ -233,6 +233,8 @@ func (syncer *Syncer) syncOne(ctx context.Context, parent, next *types.TipSet) e } } + syncer.chainStore.PersistTipSetKey(ctx, next.Key()) + return nil } @@ -824,7 +826,7 @@ func (d *delayRunTsTransition) listenUpdate() { if atomic.LoadInt64(&d.runningCount) < maxProcessLen { atomic.AddInt64(&d.runningCount, 1) go func(ts *types.TipSet) { - _, _, err := d.syncer.stmgr.RunStateTransition(context.TODO(), ts, nil) + _, _, err := d.syncer.stmgr.RunStateTransition(context.TODO(), ts, nil, false) if err != nil { logSyncer.Errorf("stmgr.runStateTransaction failed:%s", err.Error()) } diff --git a/pkg/chainsync/syncer/syncer_integration_test.go b/pkg/chainsync/syncer/syncer_integration_test.go index f713b10239..3213e135ff 100644 --- a/pkg/chainsync/syncer/syncer_integration_test.go +++ b/pkg/chainsync/syncer/syncer_integration_test.go @@ -73,7 +73,7 @@ func TestLoadFork(t *testing.T) { assert.Error(t, s.HandleNewTipSet(ctx, rightTarget)) verifyHead(t, builder.Store(), left) - _, _, err = blockValidator.RunStateTransition(ctx, blockValidator.ChainStore.GetHead(), nil) + _, _, err = blockValidator.RunStateTransition(ctx, blockValidator.ChainStore.GetHead(), nil, false) require.NoError(t, err) // The syncer/bsstore assume that the fetcher populates the underlying block bsstore such that diff --git a/pkg/chainsync/syncer/syncer_test.go b/pkg/chainsync/syncer/syncer_test.go index 1afa4b67e3..8542f02152 100644 --- a/pkg/chainsync/syncer/syncer_test.go +++ b/pkg/chainsync/syncer/syncer_test.go @@ -465,7 +465,7 @@ func newPoisonValidator(t *testing.T, headerFailure, fullFailure uint64) *poison return &poisonValidator{headerFailureTS: headerFailure, fullFailureTS: fullFailure} } -func (pv *poisonValidator) RunStateTransition(ctx context.Context, ts *types.TipSet, cb vm.ExecCallBack) (cid.Cid, cid.Cid, error) { +func (pv *poisonValidator) RunStateTransition(ctx context.Context, ts *types.TipSet, cb vm.ExecCallBack, vmTracing bool) (cid.Cid, cid.Cid, error) { stamp := ts.At(0).Timestamp if pv.fullFailureTS == stamp { return testhelpers.EmptyTxMetaCID, testhelpers.EmptyTxMetaCID, errors.New("run state transition fails on poison timestamp") diff --git a/pkg/consensus/block_validator.go b/pkg/consensus/block_validator.go index 661bf83cbb..5f1c3a761f 100644 --- a/pkg/consensus/block_validator.go +++ b/pkg/consensus/block_validator.go @@ -197,7 +197,7 @@ func (bv *BlockValidator) validateBlock(ctx context.Context, blk *types.BlockHea } minerCheck := async.Err(func() error { - stateRoot, _, err := bv.Stmgr.RunStateTransition(ctx, parent, nil) + stateRoot, _, err := bv.Stmgr.RunStateTransition(ctx, parent, nil, false) if err != nil { return err } @@ -264,7 +264,7 @@ func (bv *BlockValidator) validateBlock(ctx context.Context, blk *types.BlockHea }) msgsCheck := async.Err(func() error { - stateRoot, _, err := bv.Stmgr.RunStateTransition(ctx, parent, nil) + stateRoot, _, err := bv.Stmgr.RunStateTransition(ctx, parent, nil, false) if err != nil { return err } @@ -277,7 +277,7 @@ func (bv *BlockValidator) validateBlock(ctx context.Context, blk *types.BlockHea }) stateRootCheck := async.Err(func() error { - stateRoot, receipt, err := bv.Stmgr.RunStateTransition(ctx, parent, nil) + stateRoot, receipt, err := bv.Stmgr.RunStateTransition(ctx, parent, nil, false) if err != nil { return fmt.Errorf("get tipsetstate(%d, %s) failed: %w", blk.Height, blk.Parents, err) } diff --git a/pkg/consensus/expected.go b/pkg/consensus/expected.go index 1ebfeefc15..faae8d3651 100644 --- a/pkg/consensus/expected.go +++ b/pkg/consensus/expected.go @@ -165,7 +165,7 @@ func NewExpected(cs cbor.IpldStore, // RunStateTransition applies the messages in a tipset to a state, and persists that new state. // It errors if the tipset was not mined according to the EC rules, or if any of the messages // in the tipset results in an error. -func (c *Expected) RunStateTransition(ctx context.Context, ts *types.TipSet, cb vm.ExecCallBack) (cid.Cid, cid.Cid, error) { +func (c *Expected) RunStateTransition(ctx context.Context, ts *types.TipSet, cb vm.ExecCallBack, vmTracing bool) (cid.Cid, cid.Cid, error) { begin := time.Now() defer func() { logExpect.Infof("process ts height %d, blocks %d, took %.4f(s)", ts.Height(), ts.Len(), time.Since(begin).Seconds()) @@ -215,7 +215,7 @@ func (c *Expected) RunStateTransition(ctx context.Context, ts *types.TipSet, cb PRoot: ts.At(0).ParentStateRoot, SysCallsImpl: c.syscallsImpl, TipSetGetter: vmcontext.TipSetGetterForTipset(c.chainState.GetTipSetByHeight, ts), - Tracing: false, + Tracing: vmTracing, ActorDebugging: c.netParamCfg.ActorDebugging, ReturnEvents: c.returnEvents, } diff --git a/pkg/consensus/protocol.go b/pkg/consensus/protocol.go index 808283e308..92261a9dcd 100644 --- a/pkg/consensus/protocol.go +++ b/pkg/consensus/protocol.go @@ -36,5 +36,5 @@ type Protocol interface { type StateTransformer interface { // RunStateTransition returns the state root CID resulting from applying the input ts to the // prior `stateID`. It returns an error if the transition is invalid. - RunStateTransition(ctx context.Context, ts *types.TipSet, cb vm.ExecCallBack) (root cid.Cid, receipt cid.Cid, err error) + RunStateTransition(ctx context.Context, ts *types.TipSet, cb vm.ExecCallBack, vmTracing bool) (root cid.Cid, receipt cid.Cid, err error) } diff --git a/pkg/constants/version.go b/pkg/constants/version.go index d2a5b14794..5a225e3279 100644 --- a/pkg/constants/version.go +++ b/pkg/constants/version.go @@ -5,7 +5,7 @@ import ( ) // BuildVersion is the local build version, set by build system -const BuildVersion = "1.10.0-rc2" +const BuildVersion = "1.10.1" var CurrentCommit string diff --git a/pkg/fork/fork.go b/pkg/fork/fork.go index ba61211266..64dd3146f4 100644 --- a/pkg/fork/fork.go +++ b/pkg/fork/fork.go @@ -364,8 +364,8 @@ func DefaultUpgradeSchedule(cf *ChainFork, upgradeHeight *config.ForkUpgradeConf Migration: cf.UpgradeActorsV10, PreMigrations: []PreMigration{{ PreMigration: cf.PreUpgradeActorsV10, - StartWithin: 180, - DontStartWithin: 60, + StartWithin: 60, + DontStartWithin: 10, StopWithin: 5, }}, Expensive: true, diff --git a/pkg/messagepool/gas.go b/pkg/messagepool/gas.go index 5d753cb0d2..ee58a79c96 100644 --- a/pkg/messagepool/gas.go +++ b/pkg/messagepool/gas.go @@ -291,13 +291,16 @@ func (mp *MessagePool) evalMessageGasLimit(ctx context.Context, msgIn *types.Mes ret := res.MsgRct.GasUsed - // todo: remove after nv18 transitionalMulti := 1.0 // Overestimate gas around the upgrade - if ts.Height() <= mp.forkParams.UpgradeSkyrHeight && (mp.forkParams.UpgradeSkyrHeight-ts.Height() <= 20) { - transitionalMulti = 2.0 - + if ts.Height() <= mp.forkParams.UpgradeHyggeHeight && (mp.forkParams.UpgradeHyggeHeight-ts.Height() <= 20) { func() { + // Bare transfers get about 3x more expensive: https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0057.md#product-considerations + if msgIn.Method == builtin.MethodSend { + transitionalMulti = 3.0 + return + } + _, st, err := mp.sm.ParentState(ctx, ts) if err != nil { return @@ -312,26 +315,27 @@ func (mp *MessagePool) evalMessageGasLimit(ctx context.Context, msgIn *types.Mes if builtin.IsStorageMinerActor(act.Code) { switch msgIn.Method { - case 5: - transitionalMulti = 3.954 + case 3: + transitionalMulti = 1.92 + case 4: + transitionalMulti = 1.72 case 6: - transitionalMulti = 4.095 + transitionalMulti = 1.06 case 7: - // skip, stay at 2.0 - // transitionalMulti = 1.289 - case 11: - transitionalMulti = 17.8758 + transitionalMulti = 1.2 case 16: - transitionalMulti = 2.1704 - case 25: - transitionalMulti = 3.1177 + transitionalMulti = 1.19 + case 18: + transitionalMulti = 1.73 + case 23: + transitionalMulti = 1.73 case 26: - transitionalMulti = 2.3322 + transitionalMulti = 1.15 + case 27: + transitionalMulti = 1.18 default: } } - - // skip storage market, 80th percentie for everything ~1.9, leave it at 2.0 }() log.Infof("overestimate gas around the upgrade msg: %v, transitional multi: %v", msg, transitionalMulti) } diff --git a/pkg/migration/migrate.go b/pkg/migration/migrate.go index 141d75ac89..9e8be5ba4f 100644 --- a/pkg/migration/migrate.go +++ b/pkg/migration/migrate.go @@ -381,7 +381,7 @@ func Version11Upgrade(repoPath string) (err error) { switch cfg.NetworkParams.NetworkType { case types.NetworkMainnet: - cfg.NetworkParams.ForkUpgradeParam.UpgradeHyggeHeight = 99999999999999 + cfg.NetworkParams.ForkUpgradeParam.UpgradeHyggeHeight = 2683348 cfg.NetworkParams.Eip155ChainID = 314 case types.Network2k: cfg.NetworkParams.GenesisNetworkVersion = network.Version17 @@ -393,7 +393,7 @@ func Version11Upgrade(repoPath string) (err error) { cfg.NetworkParams.GenesisNetworkVersion = network.Version17 cfg.NetworkParams.ForkUpgradeParam.UpgradeHyggeHeight = 30 case types.NetworkInterop: - cfg.NetworkParams.ForkUpgradeParam.UpgradeHyggeHeight = 99999999999999 + cfg.NetworkParams.ForkUpgradeParam.UpgradeHyggeHeight = 2683348 case types.NetworkButterfly: cfg.NetworkParams.ForkUpgradeParam.UpgradeHyggeHeight = 600 cfg.NetworkParams.Eip155ChainID = 3141592 diff --git a/pkg/net/exchange/server.go b/pkg/net/exchange/server.go index ea704fe643..9f25365bfd 100644 --- a/pkg/net/exchange/server.go +++ b/pkg/net/exchange/server.go @@ -70,8 +70,7 @@ func (s *server) handleStream(stream inet.Stream) { exchangeServerLog.Warnf("failed to read block sync request: %s", err) return } - fmt.Println(stream.Conn().RemotePeer()) - exchangeServerLog.Infow("block sync request", "start", req.Head, "len", req.Length) + exchangeServerLog.Infow("block sync request", "start", req.Head, "len", req.Length, "remote peer", stream.Conn().RemotePeer()) resp, err := s.processRequest(ctx, &req) if err != nil { diff --git a/pkg/state/view.go b/pkg/state/view.go index fcfaf864e5..06c464e2c7 100644 --- a/pkg/state/view.go +++ b/pkg/state/view.go @@ -91,7 +91,7 @@ func (v *View) InitResolveAddress(ctx context.Context, a addr.Address) (addr.Add } if !found { - return addr.Undef, fmt.Errorf("not found resolve address") + return addr.Undef, fmt.Errorf("not found resolve address %v", a) } return rAddr, nil diff --git a/pkg/statemanger/state_manger.go b/pkg/statemanger/state_manger.go index bd3b455a28..28fcaef613 100644 --- a/pkg/statemanger/state_manger.go +++ b/pkg/statemanger/state_manger.go @@ -14,12 +14,15 @@ import ( "github.com/filecoin-project/venus/pkg/chain" "github.com/filecoin-project/venus/pkg/consensus" "github.com/filecoin-project/venus/pkg/fork" + "github.com/filecoin-project/venus/pkg/fvm" appstate "github.com/filecoin-project/venus/pkg/state" "github.com/filecoin-project/venus/pkg/state/tree" "github.com/filecoin-project/venus/pkg/vm" "github.com/filecoin-project/venus/pkg/vm/gas" + "github.com/filecoin-project/venus/pkg/vm/vmcontext" "github.com/filecoin-project/venus/venus-shared/actors/builtin/market" "github.com/filecoin-project/venus/venus-shared/actors/builtin/paych" + blockstoreutil "github.com/filecoin-project/venus/venus-shared/blockstore" "github.com/filecoin-project/venus/venus-shared/types" "github.com/ipfs/go-cid" logging "github.com/ipfs/go-log/v2" @@ -150,7 +153,7 @@ func (s *Stmgr) ParentState(ctx context.Context, ts *types.TipSet) (*types.TipSe ts.Key().String(), err) } - if stateRoot, _, err := s.RunStateTransition(ctx, parent, nil); err != nil { + if stateRoot, _, err := s.RunStateTransition(ctx, parent, nil, false); err != nil { return nil, nil, fmt.Errorf("runstateTransition failed:%w", err) } else if !stateRoot.Equals(ts.At(0).ParentStateRoot) { return nil, nil, fmt.Errorf("runstateTransition error, %w", consensus.ErrStateRootMismatch) @@ -175,7 +178,7 @@ func (s *Stmgr) TipsetStateTsk(ctx context.Context, tsk types.TipSetKey) (*types } func (s *Stmgr) TipsetState(ctx context.Context, ts *types.TipSet) (*tree.State, error) { - root, _, err := s.RunStateTransition(ctx, ts, nil) + root, _, err := s.RunStateTransition(ctx, ts, nil, false) if err != nil { return nil, err } @@ -197,7 +200,7 @@ redo: } s.stLk.Unlock() - if root, _, err := s.RunStateTransition(ctx, pts, nil); err != nil { + if root, _, err := s.RunStateTransition(ctx, pts, nil, false); err != nil { return err } else if !root.Equals(cts.At(0).ParentStateRoot) { cts = pts @@ -209,7 +212,7 @@ redo: return nil } -func (s *Stmgr) RunStateTransition(ctx context.Context, ts *types.TipSet, cb vm.ExecCallBack) (root cid.Cid, receipts cid.Cid, err error) { +func (s *Stmgr) RunStateTransition(ctx context.Context, ts *types.TipSet, cb vm.ExecCallBack, vmTracing bool) (root cid.Cid, receipts cid.Cid, err error) { if nil != s.stopFlag(false) { return cid.Undef, cid.Undef, fmt.Errorf("state manager is stopping") } @@ -266,7 +269,7 @@ func (s *Stmgr) RunStateTransition(ctx context.Context, ts *types.TipSet, cb vm. return ts.Blocks()[0].ParentStateRoot, ts.Blocks()[0].ParentMessageReceipts, nil } - if root, receipts, err = s.cp.RunStateTransition(ctx, ts, cb); err != nil { + if root, receipts, err = s.cp.RunStateTransition(ctx, ts, cb, vmTracing); err != nil { return cid.Undef, cid.Undef, err } @@ -353,7 +356,7 @@ func (s *Stmgr) RunStateTransitionV2(ctx context.Context, ts *types.TipSet) (cid return ts.Blocks()[0].ParentStateRoot, ts.Blocks()[0].ParentMessageReceipts, nil } - if state.stateRoot, state.receipt, err = s.cp.RunStateTransition(ctx, ts, nil); err != nil { + if state.stateRoot, state.receipt, err = s.cp.RunStateTransition(ctx, ts, nil, false); err != nil { return cid.Undef, cid.Undef, err } else if err = s.cs.PutTipSetMetadata(ctx, &chain.TipSetMetadata{ TipSet: ts, @@ -400,7 +403,7 @@ func (s *Stmgr) StateViewTsk(ctx context.Context, tsk types.TipSetKey) (*types.T } func (s *Stmgr) StateView(ctx context.Context, ts *types.TipSet) (cid.Cid, *appstate.View, error) { - stateCid, _, err := s.RunStateTransition(ctx, ts, nil) + stateCid, _, err := s.RunStateTransition(ctx, ts, nil, false) if err != nil { return cid.Undef, nil, err } @@ -431,7 +434,7 @@ func (s *Stmgr) Replay(ctx context.Context, ts *types.TipSet, msgCID cid.Cid) (* return nil } - _, _, err := s.cp.RunStateTransition(ctx, ts, cb) + _, _, err := s.cp.RunStateTransition(ctx, ts, cb, true) if err != nil && !errors.Is(err, errHaltExecution) { return nil, nil, fmt.Errorf("unexpected error during execution: %w", err) } @@ -443,10 +446,41 @@ func (s *Stmgr) Replay(ctx context.Context, ts *types.TipSet, msgCID cid.Cid) (* return outm, outr, nil } +func (s *Stmgr) ExecutionTrace(ctx context.Context, ts *types.TipSet) (cid.Cid, []*types.InvocResult, error) { + var invocTrace []*types.InvocResult + + cb := func(mcid cid.Cid, msg *types.Message, ret *vm.Ret) error { + ir := &types.InvocResult{ + MsgCid: mcid, + Msg: msg, + MsgRct: &ret.Receipt, + ExecutionTrace: ret.GasTracker.ExecutionTrace, + Duration: ret.Duration, + } + if ret.ActorErr != nil { + ir.Error = ret.ActorErr.Error() + } + if !ret.OutPuts.Refund.Nil() { + ir.GasCost = MakeMsgGasCost(msg, ret) + } + + invocTrace = append(invocTrace, ir) + + return nil + } + + st, _, err := s.cp.RunStateTransition(ctx, ts, cb, true) + if err != nil { + return cid.Undef, nil, err + } + + return st, invocTrace, nil +} + func MakeMsgGasCost(msg *types.Message, ret *vm.Ret) types.MsgGasCost { return types.MsgGasCost{ Message: msg.Cid(), - GasUsed: big.NewInt(ret.GasTracker.GasUsed), + GasUsed: big.NewInt(ret.Receipt.GasUsed), BaseFeeBurn: ret.OutPuts.BaseFeeBurn, OverEstimationBurn: ret.OutPuts.OverEstimationBurn, MinerPenalty: ret.OutPuts.MinerPenalty, @@ -456,9 +490,79 @@ func MakeMsgGasCost(msg *types.Message, ret *vm.Ret) types.MsgGasCost { } } +func ComputeState(ctx context.Context, s *Stmgr, height abi.ChainEpoch, msgs []*types.Message, ts *types.TipSet) (cid.Cid, []*types.InvocResult, error) { + if ts == nil { + ts = s.cs.GetHead() + } + + base, trace, err := s.ExecutionTrace(ctx, ts) + if err != nil { + return cid.Undef, nil, err + } + + for i := ts.Height(); i < height; i++ { + // Technically, the tipset we're passing in here should be ts+1, but that may not exist. + base, err = s.fork.HandleStateForks(ctx, base, i, ts) + if err != nil { + return cid.Undef, nil, fmt.Errorf("error handling state forks: %w", err) + } + + // We intentionally don't run cron here, as we may be trying to look into the + // future. It's not guaranteed to be accurate... but that's fine. + } + + buffStore := blockstoreutil.NewTieredBstore(s.cs.Blockstore(), blockstoreutil.NewTemporarySync()) + vmopt := vm.VmOption{ + CircSupplyCalculator: func(ctx context.Context, epoch abi.ChainEpoch, tree tree.Tree) (abi.TokenAmount, error) { + cs, err := s.cs.GetCirculatingSupplyDetailed(ctx, epoch, tree) + if err != nil { + return abi.TokenAmount{}, err + } + return cs.FilCirculating, nil + }, + PRoot: base, + Epoch: ts.Height(), + Timestamp: ts.MinTimestamp(), + Rnd: consensus.NewHeadRandomness(s.rnd, ts.Key()), + Bsstore: buffStore, + SysCallsImpl: s.syscallsImpl, + GasPriceSchedule: s.gasSchedule, + NetworkVersion: s.GetNetworkVersion(ctx, height), + BaseFee: ts.Blocks()[0].ParentBaseFee, + Fork: s.fork, + LookbackStateGetter: vmcontext.LookbackStateGetterForTipset(ctx, s.cs, s.fork, ts), + TipSetGetter: vmcontext.TipSetGetterForTipset(s.cs.GetTipSetByHeight, ts), + Tracing: true, + ActorDebugging: s.actorDebugging, + } + + vmi, err := fvm.NewVM(ctx, vmopt) + if err != nil { + return cid.Undef, nil, err + } + + for i, msg := range msgs { + // TODO: Use the signed message length for secp messages + ret, err := vmi.ApplyMessage(ctx, msg) + if err != nil { + return cid.Undef, nil, fmt.Errorf("applying message %s: %w", msg.Cid(), err) + } + if ret.Receipt.ExitCode != 0 { + s.log.Infof("compute state apply message %d failed (exit: %d): %s", i, ret.Receipt.ExitCode, ret.ActorErr) + } + } + + root, err := vmi.Flush(ctx) + if err != nil { + return cid.Undef, nil, err + } + + return root, trace, nil +} + func (s *Stmgr) FlushChainHead() (*types.TipSet, error) { head := s.cs.GetHead() - _, _, err := s.RunStateTransition(context.TODO(), head, nil) + _, _, err := s.RunStateTransition(context.TODO(), head, nil, false) return head, err } diff --git a/venus-devtool/api-gen/common/common.go b/venus-devtool/api-gen/common/common.go index c483b5d91a..b4e1102c9e 100644 --- a/venus-devtool/api-gen/common/common.go +++ b/venus-devtool/api-gen/common/common.go @@ -12,8 +12,9 @@ import ( gatewayv0 "github.com/filecoin-project/venus/venus-shared/api/gateway/v0" gatewayv1 "github.com/filecoin-project/venus/venus-shared/api/gateway/v1" gatewayv2 "github.com/filecoin-project/venus/venus-shared/api/gateway/v2" - "github.com/filecoin-project/venus/venus-shared/api/market" market_client "github.com/filecoin-project/venus/venus-shared/api/market/client" + marketv0 "github.com/filecoin-project/venus/venus-shared/api/market/v0" + marketv1 "github.com/filecoin-project/venus/venus-shared/api/market/v1" "github.com/filecoin-project/venus/venus-shared/api/messager" "github.com/filecoin-project/venus/venus-shared/api/wallet" ) @@ -79,9 +80,9 @@ func init() { }, }, util.APIMeta{ - Type: reflect.TypeOf((*market.IMarket)(nil)).Elem(), + Type: reflect.TypeOf((*marketv0.IMarket)(nil)).Elem(), ParseOpt: util.InterfaceParseOption{ - ImportPath: "github.com/filecoin-project/venus/venus-shared/api/market", + ImportPath: "github.com/filecoin-project/venus/venus-shared/api/market/v0", IncludeAll: true, }, RPCMeta: util.RPCMeta{ @@ -89,6 +90,17 @@ func init() { MethodNamespace: "VENUS_MARKET", }, }, + util.APIMeta{ + Type: reflect.TypeOf((*marketv1.IMarket)(nil)).Elem(), + ParseOpt: util.InterfaceParseOption{ + ImportPath: "github.com/filecoin-project/venus/venus-shared/api/market/v1", + IncludeAll: true, + }, + RPCMeta: util.RPCMeta{ + Version: 1, + MethodNamespace: "VENUS_MARKET", + }, + }, util.APIMeta{ Type: reflect.TypeOf((*market_client.IMarketClient)(nil)).Elem(), ParseOpt: util.InterfaceParseOption{ diff --git a/venus-devtool/api-gen/example.go b/venus-devtool/api-gen/example.go index d96419b005..3290ed4cb2 100644 --- a/venus-devtool/api-gen/example.go +++ b/venus-devtool/api-gen/example.go @@ -23,9 +23,9 @@ import ( "github.com/filecoin-project/go-state-types/exitcode" "github.com/filecoin-project/venus/venus-shared/types/market" auuid "github.com/google/uuid" - blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" "github.com/ipfs/go-graphsync" + blocks "github.com/ipfs/go-libipfs/blocks" textselector "github.com/ipld/go-ipld-selector-text-lite" pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/libp2p/go-libp2p/core/metrics" @@ -349,7 +349,6 @@ func exampleStruct(method string, t, parent reflect.Type) interface{} { } if strings.Title(f.Name) == f.Name { - fmt.Println(f.Name) ns.Field(i).Set(reflect.ValueOf(ExampleValue(method, f.Type, t))) } } diff --git a/venus-devtool/bundle-gen/main.go b/venus-devtool/bundle-gen/main.go index 8742f8cdb6..7150aedb90 100644 --- a/venus-devtool/bundle-gen/main.go +++ b/venus-devtool/bundle-gen/main.go @@ -4,6 +4,8 @@ import ( "bytes" "fmt" "os" + "strconv" + "strings" "text/template" "github.com/urfave/cli/v2" @@ -12,19 +14,57 @@ import ( "github.com/filecoin-project/venus/venus-shared/actors" ) +func splitOverride(override string) (string, string) { + x := strings.Split(override, "=") + return x[0], x[1] +} + func main() { app := &cli.App{ Name: "bundle-gen", Usage: "generate builtin actors for venus-shared", Flags: []cli.Flag{ &cli.StringFlag{Name: "dst"}, + &cli.StringFlag{Name: "version"}, + &cli.StringFlag{Name: "release"}, + &cli.StringSliceFlag{Name: "release_overrides"}, }, Action: func(ctx *cli.Context) error { + // read metadata from the embedded bundle, includes all info except git tags metadata, err := actors.ReadEmbeddedBuiltinActorsMetadata() if err != nil { return err } + // IF args have been provided, extract git tag info from them, otherwise + // rely on previously embedded metadata for git tags. + if ver := ctx.String("version"); len(ver) != 0 { + // overrides are in the format network_name=override + gitTag := ctx.String("release") + packedActorsVersion, err := strconv.Atoi(ver[1:]) + if err != nil { + return err + } + + overrides := map[string]string{} + for _, override := range ctx.StringSlice("release_overrides") { + k, v := splitOverride(override) + overrides[k] = v + } + for _, m := range metadata { + if int(m.Version) == packedActorsVersion { + override, ok := overrides[m.Network] + if ok { + m.BundleGitTag = override + } else { + m.BundleGitTag = gitTag + } + } else { + m.BundleGitTag = getOldGitTagFromEmbeddedMetadata(m) + } + } + } + buf := &bytes.Buffer{} if err := tmpl.Execute(buf, metadata); err != nil { return err @@ -46,6 +86,17 @@ func main() { } } +func getOldGitTagFromEmbeddedMetadata(m *actors.BuiltinActorsMetadata) string { + for _, v := range actors.EmbeddedBuiltinActorsMetadata { + // if we agree on the manifestCid for the previously embedded metadata, use the previously set tag + if m.Version == v.Version && m.Network == v.Network && m.ManifestCid == v.ManifestCid { + return m.BundleGitTag + } + } + + return "" +} + var tmpl *template.Template = template.Must(template.New("actor-metadata").Parse(` // WARNING: This file has automatically been generated package actors @@ -56,6 +107,7 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet {{- range . }} { Network: {{printf "%q" .Network}}, Version: {{.Version}}, + {{if .BundleGitTag}} BundleGitTag: {{printf "%q" .BundleGitTag}}, {{end}} ManifestCid: mustParseCid({{printf "%q" .ManifestCid}}), Actors: map[string]cid.Cid { {{- range $name, $cid := .Actors }} diff --git a/venus-devtool/go.mod b/venus-devtool/go.mod index 3f4300ce89..d9c2527a20 100644 --- a/venus-devtool/go.mod +++ b/venus-devtool/go.mod @@ -8,13 +8,13 @@ require ( github.com/filecoin-project/go-data-transfer v1.15.2 github.com/filecoin-project/go-fil-markets v1.25.2 github.com/filecoin-project/go-jsonrpc v0.2.1 - github.com/filecoin-project/go-state-types v0.10.0-rc3 - github.com/filecoin-project/lotus v1.20.0-rc1 + github.com/filecoin-project/go-state-types v0.10.0 + github.com/filecoin-project/lotus v1.20.1 github.com/filecoin-project/venus v0.0.0-00010101000000-000000000000 github.com/google/uuid v1.3.0 - github.com/ipfs/go-block-format v0.1.1 github.com/ipfs/go-cid v0.3.2 github.com/ipfs/go-graphsync v0.13.2 + github.com/ipfs/go-libipfs v0.4.1 github.com/ipld/go-ipld-selector-text-lite v0.0.1 github.com/libp2p/go-libp2p v0.23.4 github.com/libp2p/go-libp2p-pubsub v0.8.2 @@ -101,6 +101,7 @@ require ( github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/icza/backscanner v0.0.0-20210726202459-ac2ffc679f94 // indirect github.com/ipfs/bbloom v0.0.4 // indirect + github.com/ipfs/go-block-format v0.1.1 // indirect github.com/ipfs/go-blockservice v0.4.0 // indirect github.com/ipfs/go-datastore v0.6.0 // indirect github.com/ipfs/go-ds-badger2 v0.1.2 // indirect @@ -116,7 +117,6 @@ require ( github.com/ipfs/go-ipld-format v0.4.0 // indirect github.com/ipfs/go-ipld-legacy v0.1.1 // indirect github.com/ipfs/go-ipns v0.3.0 // indirect - github.com/ipfs/go-libipfs v0.4.1 // indirect github.com/ipfs/go-log v1.0.5 // indirect github.com/ipfs/go-log/v2 v2.5.1 // indirect github.com/ipfs/go-merkledag v0.8.1 // indirect @@ -147,7 +147,7 @@ require ( github.com/libp2p/go-netroute v0.2.0 // indirect github.com/libp2p/go-openssl v0.1.0 // indirect github.com/magefile/mage v1.13.0 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect github.com/mattn/go-pointer v0.0.1 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/miekg/dns v1.1.50 // indirect @@ -198,7 +198,7 @@ require ( go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.23.0 // indirect go4.org v0.0.0-20200411211856-f5505b9728dd // indirect - golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect + golang.org/x/crypto v0.5.0 // indirect golang.org/x/exp v0.0.0-20220916125017-b168a2c6b86b // indirect golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect golang.org/x/net v0.7.0 // indirect diff --git a/venus-devtool/go.sum b/venus-devtool/go.sum index 761e3ea058..596bc88415 100644 --- a/venus-devtool/go.sum +++ b/venus-devtool/go.sum @@ -332,14 +332,14 @@ github.com/filecoin-project/go-state-types v0.1.4/go.mod h1:xCA/WfKlC2zcn3fUmDv4 github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= github.com/filecoin-project/go-state-types v0.1.8/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= github.com/filecoin-project/go-state-types v0.1.10/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= -github.com/filecoin-project/go-state-types v0.10.0-rc3 h1:qExCc2swTe5ndsiu9dEoMqIwppjuTNRbsAFgpzHnHbc= -github.com/filecoin-project/go-state-types v0.10.0-rc3/go.mod h1:aLIas+W8BWAfpLWEPUOGMPBdhcVwoCG4pIQSQk26024= +github.com/filecoin-project/go-state-types v0.10.0 h1:vsSThZIaPmOxNGG59+8D/HnlWRtlbdOjduH6ye+v8f0= +github.com/filecoin-project/go-state-types v0.10.0/go.mod h1:aLIas+W8BWAfpLWEPUOGMPBdhcVwoCG4pIQSQk26024= github.com/filecoin-project/go-statemachine v1.0.2 h1:421SSWBk8GIoCoWYYTE/d+qCWccgmRH0uXotXRDjUbc= github.com/filecoin-project/go-statestore v0.2.0 h1:cRRO0aPLrxKQCZ2UOQbzFGn4WDNdofHZoGPjfNaAo5Q= github.com/filecoin-project/go-statestore v0.2.0/go.mod h1:8sjBYbS35HwPzct7iT4lIXjLlYyPor80aU7t7a/Kspo= github.com/filecoin-project/index-provider v0.9.1 h1:Jnh9dviIHvQxZ2baNoYu3n8z6F9O62ksnVlyREgPyyM= -github.com/filecoin-project/lotus v1.20.0-rc1 h1:VWvqNgM9u+bSEkdLmPpdv61HqpXNFaFVbUF3mIH6G2g= -github.com/filecoin-project/lotus v1.20.0-rc1/go.mod h1:h+VTMD+klqctZBruSVi8OuAUYULufxSv8HvBmJZ7bdk= +github.com/filecoin-project/lotus v1.20.1 h1:thlefi6NROiJo58dRBf+RweNmTlxCFdEIysLjx83tMw= +github.com/filecoin-project/lotus v1.20.1/go.mod h1:dprpVaiQezI8Jl4tWcPNIYGGAAo31feZlGAOk8D7bJU= github.com/filecoin-project/pubsub v1.0.0 h1:ZTmT27U07e54qV1mMiQo4HDr0buo8I1LDHBYLXlsNXM= github.com/filecoin-project/pubsub v1.0.0/go.mod h1:GkpB33CcUtUNrLPhJgfdy4FDx4OMNR9k+46DHx/Lqrg= github.com/filecoin-project/specs-actors v0.9.13/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao= @@ -1214,8 +1214,8 @@ github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-pointer v0.0.1 h1:n+XhsuGeVO6MEAp7xyEukFINEa+Quek5psIR/ylA6o0= github.com/mattn/go-pointer v0.0.1/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -1787,8 +1787,8 @@ golang.org/x/crypto v0.0.0-20210813211128-0a44fdfbc16e/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= +golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= diff --git a/venus-shared/actors/builtin-actors-code/v10.tar.zst b/venus-shared/actors/builtin-actors-code/v10.tar.zst index 8453eba42d..9ac6453f8c 100644 Binary files a/venus-shared/actors/builtin-actors-code/v10.tar.zst and b/venus-shared/actors/builtin-actors-code/v10.tar.zst differ diff --git a/venus-shared/actors/builtin/evm/actor.go b/venus-shared/actors/builtin/evm/actor.go index 49edfcba9e..c677c9a319 100644 --- a/venus-shared/actors/builtin/evm/actor.go +++ b/venus-shared/actors/builtin/evm/actor.go @@ -52,6 +52,7 @@ type State interface { cbor.Marshaler Nonce() (uint64, error) + IsAlive() (bool, error) GetState() interface{} GetBytecode() ([]byte, error) diff --git a/venus-shared/actors/builtin/evm/actor.go.template b/venus-shared/actors/builtin/evm/actor.go.template index 0f6d12bbb8..6d9a3ce92b 100644 --- a/venus-shared/actors/builtin/evm/actor.go.template +++ b/venus-shared/actors/builtin/evm/actor.go.template @@ -50,6 +50,7 @@ type State interface { cbor.Marshaler Nonce() (uint64, error) + IsAlive() (bool, error) GetState() interface{} GetBytecode() ([]byte, error) diff --git a/venus-shared/actors/builtin/evm/state.sep.go.template b/venus-shared/actors/builtin/evm/state.sep.go.template index 788fe12393..68488ae58d 100644 --- a/venus-shared/actors/builtin/evm/state.sep.go.template +++ b/venus-shared/actors/builtin/evm/state.sep.go.template @@ -6,6 +6,7 @@ import ( "github.com/ipfs/go-cid" "github.com/filecoin-project/venus/venus-shared/actors/adt" + "github.com/filecoin-project/go-state-types/abi" evm{{.v}} "github.com/filecoin-project/go-state-types/builtin{{.import}}evm" ) @@ -42,6 +43,10 @@ func (s *state{{.v}}) Nonce() (uint64, error) { return s.State.Nonce, nil } +func (s *state{{.v}}) IsAlive() (bool, error) { + return s.State.Tombstone == nil, nil +} + func (s *state{{.v}}) GetState() interface{} { return &s.State } diff --git a/venus-shared/actors/builtin/evm/state.v10.go b/venus-shared/actors/builtin/evm/state.v10.go index f1a431eac1..a265e43514 100644 --- a/venus-shared/actors/builtin/evm/state.v10.go +++ b/venus-shared/actors/builtin/evm/state.v10.go @@ -5,9 +5,9 @@ package evm import ( "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/venus/venus-shared/actors/adt" - "github.com/filecoin-project/go-state-types/abi" evm10 "github.com/filecoin-project/go-state-types/builtin/v10/evm" ) @@ -43,6 +43,10 @@ func (s *state10) Nonce() (uint64, error) { return s.State.Nonce, nil } +func (s *state10) IsAlive() (bool, error) { + return s.State.Tombstone == nil, nil +} + func (s *state10) GetState() interface{} { return &s.State } diff --git a/venus-shared/actors/builtin_actors.go b/venus-shared/actors/builtin_actors.go index 067a84d222..acc0827153 100644 --- a/venus-shared/actors/builtin_actors.go +++ b/venus-shared/actors/builtin_actors.go @@ -138,10 +138,11 @@ func loadManifests(netw string) error { } type BuiltinActorsMetadata struct { // nolint - Network string - Version actorstypes.Version - ManifestCid cid.Cid - Actors map[string]cid.Cid + Network string + Version actorstypes.Version + ManifestCid cid.Cid + Actors map[string]cid.Cid + BundleGitTag string } // ReadEmbeddedBuiltinActorsMetadata reads the metadata from the embedded built-in actor bundles. diff --git a/venus-shared/actors/builtin_actors_gen.go b/venus-shared/actors/builtin_actors_gen.go index 3fea5c7bac..729e6c9bdc 100644 --- a/venus-shared/actors/builtin_actors_gen.go +++ b/venus-shared/actors/builtin_actors_gen.go @@ -6,8 +6,9 @@ import ( ) var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMetadata{{ - Network: "butterflynet", - Version: 8, + Network: "butterflynet", + Version: 8, + ManifestCid: mustParseCid("bafy2bzaceba5qgs4z3imhlxwds5vamahngatvuuglbv5yl3ftfiosj6ud5chs"), Actors: map[string]cid.Cid{ "account": mustParseCid("bafk2bzacebd5zetyjtragjwrv2nqktct6u2pmsi4eifbanovxohx3a7lszjxi"), @@ -28,8 +29,9 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": mustParseCid("bafk2bzacebu4joy25gneu2qv3qfm3ktakzalndjrbhekeqrqk3zhotv6nyy2g"), }, }, { - Network: "butterflynet", - Version: 9, + Network: "butterflynet", + Version: 9, + ManifestCid: mustParseCid("bafy2bzacec35by4erhcdgcsgzp7yb3j57utydlxxfc73m3k5pep67ehvvyv6i"), Actors: map[string]cid.Cid{ "account": mustParseCid("bafk2bzaceajsdln7v4chxqoukiw7lxw6aexg5qdsaex2hgelz2sbu24iblhzg"), @@ -46,30 +48,32 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": mustParseCid("bafk2bzacecjkesz766626ab4svnzpq3jfs26a75vfktlfaku5fjdao2eyiqyq"), }, }, { - Network: "butterflynet", - Version: 10, - ManifestCid: mustParseCid("bafy2bzacec4tgdtsrgbdywc5nzf5ekiw5zuefrasiahb4n5yqwcrwjzcdp4nk"), + Network: "butterflynet", + Version: 10, + + ManifestCid: mustParseCid("bafy2bzaceckjhsggacixv2d377zfdcnuio4hzkveprio3xnhm3gohi3zy3zco"), Actors: map[string]cid.Cid{ - "account": mustParseCid("bafk2bzaceae6holtld4caox2xood5rpcjotrxj7lnfxvfmhivb3s2ddyj22qw"), - "cron": mustParseCid("bafk2bzaceab2vrkun6ps3hactaumfzgm6zk4sdasiqiedxzdttkvw64hndcdg"), - "datacap": mustParseCid("bafk2bzacecixx45mf6chwktsd2g5krlr35p3g7pkkrvzjeujz4ryhlztpl7fq"), - "eam": mustParseCid("bafk2bzaceciekaxrlgnmosmthbgptpdu2bzdoo7mt67p7cqbdvnxup6xpd6ns"), - "ethaccount": mustParseCid("bafk2bzacecb4ttgbjzkaqrg7phqgao2kxsgeet4wnrr5qmftlfad26v6jpk4o"), - "evm": mustParseCid("bafk2bzacecrwejr7bedjww67ppof3abb6df66w76r7wpuzc426arc4oibndeu"), - "init": mustParseCid("bafk2bzacea5ke6q7je2ofrai7dpw67vat463d5f74g4evvwtcu7dhp4ff6ztk"), - "multisig": mustParseCid("bafk2bzacecs6aws25bvqmyzny3vcilr2xw35jymryu4yzodg7l7gf4bhjpolw"), - "paymentchannel": mustParseCid("bafk2bzacedtewkfsicz2rm4hsjsbagrl2mhmqfdikpsq3ggoct5iqa6caka6a"), + "account": mustParseCid("bafk2bzacedkt3uzgugcsdrcsyfvizcpyr5eshltmienbyhjne2t7t3ktkihny"), + "cron": mustParseCid("bafk2bzacecrehknegmfnhmhwy2g43cw52mvl7ptfpp44syus4iph7az7uveuq"), + "datacap": mustParseCid("bafk2bzaced4krgbpj4sywcc453l3pygqr4qocc6nxylhztsm4duvkgfwd7vws"), + "eam": mustParseCid("bafk2bzacebn5lyg5pfhjpdlf3r7lnah4x33bhp5afftdgbr4kbpuioytr4bhe"), + "ethaccount": mustParseCid("bafk2bzaceaxyu24a2tbiacfr4p367xjtptrbang4qrh3fx65cojyrzolwyi4u"), + "evm": mustParseCid("bafk2bzacea5bqaubqeuqmpguxrem2pgocjr43wcfi5e3jpw2e3b4o6tcvs746"), + "init": mustParseCid("bafk2bzaceaufptkdg2gc4eq4ijqxtqp7wxwifusxb6kxay3vdz3wr5epqjbho"), + "multisig": mustParseCid("bafk2bzacedp3c26ccw3l7fci4xhedxhqeqevkubuf5okuslq7o7rcqwqfahci"), + "paymentchannel": mustParseCid("bafk2bzacedlmiqvbutz4ebx2mezy3pqj72x2yt4gwea7sf4dv4a4s7xidelok"), "placeholder": mustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": mustParseCid("bafk2bzacecqmh47zzzlzbtaueaz2fvhiqnktccfrcqicul4j6tca2bruvtn44"), - "storagemarket": mustParseCid("bafk2bzacecbvqe4k6jyvwovxfnkylj3zpb2vjxkc3ar53x7c2pe5mkokxuyk6"), - "storageminer": mustParseCid("bafk2bzaceczbh2aofwcif4aqycydmnsjkkww4i4yfl4zca5j2dqopbz46dvrg"), - "storagepower": mustParseCid("bafk2bzacealioyiirrvov5rnh63omtsifppcsgba7my2tp7bslhd454wczepy"), - "system": mustParseCid("bafk2bzaceax2qvj3ap2dxvzgjps2vtmfgfrej3hdgk7a5euqdgsmak7ptalaa"), - "verifiedregistry": mustParseCid("bafk2bzaceaeqg3nqpjrgklq6nli6hz73s76hp4bwn6jsa64y22dj3csvmcl32"), + "reward": mustParseCid("bafk2bzacecrzxiowkhzpgz4rl2pdldzwmmnctuq5zzntqjkgyhyfllo3afb5s"), + "storagemarket": mustParseCid("bafk2bzacebh2q3ofolirt5q2jpx367dfv22aecevsmybba3yhnxfs3foe6c5q"), + "storageminer": mustParseCid("bafk2bzaceavop4j7iwneew6h7p667gvx37baloxilxetwkhsrr26jme6yye5o"), + "storagepower": mustParseCid("bafk2bzacecfblbat4w7jkxx7kjst33lowyb7s6apdnl7fsnpmy5c3jfq5kvye"), + "system": mustParseCid("bafk2bzacebojf25kc5yo7gskdbdgg5f52oppej2jp6nknzlvrww4ue5vkddd2"), + "verifiedregistry": mustParseCid("bafk2bzaceavue3zekq4wmvttck2vgxlcensrsgh5niu5qhna2owejycorftcc"), }, }, { - Network: "calibrationnet", - Version: 8, + Network: "calibrationnet", + Version: 8, + ManifestCid: mustParseCid("bafy2bzacedrdn6z3z7xz7lx4wll3tlgktirhllzqxb766dxpaqp3ukxsjfsba"), Actors: map[string]cid.Cid{ "account": mustParseCid("bafk2bzacecruossn66xqbeutqx5r4k2kjzgd43frmwd4qkw6haez44ubvvpxo"), @@ -85,8 +89,9 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": mustParseCid("bafk2bzaceaihibfu625lbtzdp3tcftscshrmbgghgrc7kzqhxn4455pycpdkm"), }, }, { - Network: "calibrationnet", - Version: 9, + Network: "calibrationnet", + Version: 9, + ManifestCid: mustParseCid("bafy2bzacedbedgynklc4dgpyxippkxmba2mgtw7ecntoneclsvvl4klqwuyyy"), Actors: map[string]cid.Cid{ "account": mustParseCid("bafk2bzaceavfgpiw6whqigmskk74z4blm22nwjfnzxb4unlqz2e4wg3c5ujpw"), @@ -103,8 +108,9 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": mustParseCid("bafk2bzacebh7dj6j7yi5vadh7lgqjtq42qi2uq4n6zy2g5vjeathacwn2tscu"), }, }, { - Network: "calibrationnet", - Version: 10, + Network: "calibrationnet", + Version: 10, + ManifestCid: mustParseCid("bafy2bzaced25ta3j6ygs34roprilbtb3f6mxifyfnm7z7ndquaruxzdq3y7lo"), Actors: map[string]cid.Cid{ "account": mustParseCid("bafk2bzacebhfuz3sv7duvk653544xsxhdn4lsmy7ol7k6gdgancyctvmd7lnq"), @@ -125,8 +131,9 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": mustParseCid("bafk2bzacec67wuchq64k7kgrujguukjvdlsl24pgighqdx5vgjhyk6bycrwnc"), }, }, { - Network: "caterpillarnet", - Version: 8, + Network: "caterpillarnet", + Version: 8, + ManifestCid: mustParseCid("bafy2bzacebsdvrxmdajiyxq2mxxxppvg2zwvqjzz3pgbsxwh6pvdcjofpmnxw"), Actors: map[string]cid.Cid{ "account": mustParseCid("bafk2bzacedfms6w3ghqtljpgsfuiqa6ztjx7kcuin6myjezj6rypj3zjbqms6"), @@ -147,8 +154,9 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": mustParseCid("bafk2bzacebzndvdqtdck2y35smcxezldgh6nm6rbkj3g3fmiknsgg2uah235y"), }, }, { - Network: "caterpillarnet", - Version: 9, + Network: "caterpillarnet", + Version: 9, + ManifestCid: mustParseCid("bafy2bzacebsdvrxmdajiyxq2mxxxppvg2zwvqjzz3pgbsxwh6pvdcjofpmnxw"), Actors: map[string]cid.Cid{ "account": mustParseCid("bafk2bzacedfms6w3ghqtljpgsfuiqa6ztjx7kcuin6myjezj6rypj3zjbqms6"), @@ -169,30 +177,32 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": mustParseCid("bafk2bzacebzndvdqtdck2y35smcxezldgh6nm6rbkj3g3fmiknsgg2uah235y"), }, }, { - Network: "caterpillarnet", - Version: 10, - ManifestCid: mustParseCid("bafy2bzacedn6med544h6r7frzvyq5cvd7dqgnwgpmzgf42d4agoysx6tf475i"), + Network: "caterpillarnet", + Version: 10, + + ManifestCid: mustParseCid("bafy2bzaceajftd7jawqnwf4kzkotksrwy6ag7mu2apkvypzrrmxboheuum5oi"), Actors: map[string]cid.Cid{ - "account": mustParseCid("bafk2bzaceaysjus6ldo45qnedaopwctamtvvk4ga2l4dh7dmdtltsfin4puuk"), - "cron": mustParseCid("bafk2bzaceatq2ltzs2p37nniek3qpkitzlfd7iu2qtupzjtgvtggxglrhj7ay"), - "datacap": mustParseCid("bafk2bzacecgwe56okusbtsfimiwstxe7ova25uvrkj4osk3w5wl2qclvd64bi"), - "eam": mustParseCid("bafk2bzaceak3xbmmyj5glnm65kv5p7zc6u7x2xallwpz7aphqqouadn3jvumm"), - "ethaccount": mustParseCid("bafk2bzacec5bcn2i4ktsc54wx7gf4gwdd6xjcukh43szfya47jicxlwrhfrhk"), - "evm": mustParseCid("bafk2bzacebbc2iv4tw2kfmmcm7k3uxilpqvbjg6jsqbov4n7wqcxvvmtazfbc"), - "init": mustParseCid("bafk2bzacecvlqa2szdyem4gwgks2yk7bfernmzbxgo5felnpqgikyesdyiury"), - "multisig": mustParseCid("bafk2bzacebvqjxop2ald5f5hvu7qqb7ali7iluxcbdd3ssllawco6kafjteqw"), - "paymentchannel": mustParseCid("bafk2bzacebux5gmkddtur2kfebwzrxwqyqh2almlt4bw3v7f4bg3gy2zqjhbe"), + "account": mustParseCid("bafk2bzacecsbx4tovnr5x2ifcpqbpx33oht74mgtvmaauzrqcq2wnm7prr7ak"), + "cron": mustParseCid("bafk2bzacecpzfajba6m4v4ty342jw6lcu6n63bwtldmzko733wpd2q5jzfdvu"), + "datacap": mustParseCid("bafk2bzaceaa5zplkxvguwvnecfen62buhli5rraa3ga74b33a3sbscanzx4ok"), + "eam": mustParseCid("bafk2bzaceaffoa3eqmj7h53lwjatfqrjw63l3czk3vthyjz6oyhgwka3xwp6g"), + "ethaccount": mustParseCid("bafk2bzaceb7suh5m4xagoq6ap5v5x7vrhex2coq6gu6d54jteblm36cxhk5b2"), + "evm": mustParseCid("bafk2bzaceccmwmnb42pn7y7skbjwjur7b2eqxuw4lvm3he2xpvudjzluss4os"), + "init": mustParseCid("bafk2bzaceai72h4hxbgbp6gwm3m24uujscrj4bmbh6pxoerqtduijxt6dchfq"), + "multisig": mustParseCid("bafk2bzacebycdokda2gysqpnl3dwksgidujgsksf4n6qotjq4erj5zd7clkzy"), + "paymentchannel": mustParseCid("bafk2bzaceb5ucvftftiim6cxjusdpsmbht4x33kgexxgv5447gevk47h7jjqk"), "placeholder": mustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": mustParseCid("bafk2bzacebhm5w7q7wlxrwgbldolzq5qfcdmcu66j6ty37ppvpwafxzlizxn4"), - "storagemarket": mustParseCid("bafk2bzacebgniq7x22ep4oiithvlzepxo5jsvhuang2vqfz3prozihmviw5ey"), - "storageminer": mustParseCid("bafk2bzacecchnrfi4cgbpis4aagiqkhalgqudjlu25da7rer4ltlgpojersgm"), - "storagepower": mustParseCid("bafk2bzaceaxomr5xbhacbbn5ib6unekjz6igoqr4r4a2taxqcpyb4gpwi6zvk"), - "system": mustParseCid("bafk2bzacebmymcxtwkk6dzgtmkbradncjpsxdqkcwtemhio5acvpm742rguv6"), - "verifiedregistry": mustParseCid("bafk2bzaceae5zbc2h6gpyu6uzsvelvww53p5mujq2dvs3zi74w6mvnigwc3va"), + "reward": mustParseCid("bafk2bzaceajqygfkhamlzfsquqjgoy4p7pc2fruouqajapfucf22rbmtt5yf6"), + "storagemarket": mustParseCid("bafk2bzacednmzko2o5iv5kc6qxvpqfx5rq72krxzvna6cqoqem6flbfukglby"), + "storageminer": mustParseCid("bafk2bzacedayzz5qw7t7ykycf3a2hp666j5hb23a3mnmgp4xbbpvrx3h3ags4"), + "storagepower": mustParseCid("bafk2bzacedd3eiejzp35xuwjf3cvgd43b5ukqhelqmtgzqzqnt2wcy56pb744"), + "system": mustParseCid("bafk2bzacecfivztuulqqv4o5oyvvvrkblwix4hqt24pqru6ivnpioefhuhria"), + "verifiedregistry": mustParseCid("bafk2bzacecdhw6x7dfrxfysmn6tdbn2ny464omgqppxhjuawxauscidppd7pc"), }, }, { - Network: "devnet", - Version: 8, + Network: "devnet", + Version: 8, + ManifestCid: mustParseCid("bafy2bzacedq7tuibavyqxzkq4uybjj7ly22eu42mjkoehwn5d47xfunmtjm4k"), Actors: map[string]cid.Cid{ "account": mustParseCid("bafk2bzacea4tlgnp7m6tlldpz3termlwxlnyq24nwd4zdzv4r6nsjuaktuuzc"), @@ -208,8 +218,9 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": mustParseCid("bafk2bzaceaajgtglewgitshgdi2nzrvq7eihjtyqj5yiamesqun2hujl3xev2"), }, }, { - Network: "devnet", - Version: 9, + Network: "devnet", + Version: 9, + ManifestCid: mustParseCid("bafy2bzacedozk3jh2j4nobqotkbofodq4chbrabioxbfrygpldgoxs3zwgggk"), Actors: map[string]cid.Cid{ "account": mustParseCid("bafk2bzaced5llqnqqhypolyuogz3h2wjomugqkrhyhocvly3aoib4c5xiush6"), @@ -226,30 +237,32 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": mustParseCid("bafk2bzacednorhcy446agy7ecpmfms2u4aoa3mj2eqomffuoerbik5yavrxyi"), }, }, { - Network: "devnet", - Version: 10, - ManifestCid: mustParseCid("bafy2bzaceco52tjbexpijsegolhdkhlziflum4bl27hcjrpnny273t3lsa6tc"), + Network: "devnet", + Version: 10, + + ManifestCid: mustParseCid("bafy2bzacebzz376j5kizfck56366kdz5aut6ktqrvqbi3efa2d4l2o2m653ts"), Actors: map[string]cid.Cid{ - "account": mustParseCid("bafk2bzacec6mdvynyu4cxb53tcdbkcu7w7jzxduxqqadi2y2rx2tsm42627tk"), - "cron": mustParseCid("bafk2bzaceaiscwdpdzdooja7hwz56ee3zztjogl4gljkccpefi7uliqtaq2ek"), - "datacap": mustParseCid("bafk2bzacedmfwrwwqmwxtfpvhp33mvt5btq2ewbjfrvfetwnrxt5r37i3ymzk"), - "eam": mustParseCid("bafk2bzaced2lwwrqtkgwxdgadpdbxpxjoh2gsunjg3bgtoubs47p7fbktbu26"), - "ethaccount": mustParseCid("bafk2bzacea5zob56gdcxudkubhol4gijzgwgtaaix4pmv3vpg4ihtsuxbdhqa"), - "evm": mustParseCid("bafk2bzaceacw53ajmggrugzfiag75suv27hvqoduypk24xru3cumctpxotbya"), - "init": mustParseCid("bafk2bzaceahgtz6647nbarvyjwtvjadzd2i2m75jv6nnrq3kgwrjxnvkykmhs"), - "multisig": mustParseCid("bafk2bzaceduhknhgd45j5aey7c7pszbbwqm4vuih4iwbuffjxekqteebuja5q"), - "paymentchannel": mustParseCid("bafk2bzacec5x44xqfgmdvsxr4nwzbcwaotodzffsjsslw64xblr7xgx7jr6c4"), + "account": mustParseCid("bafk2bzacedkj5dqs5xxamnlug2d5dyjl6askf7wlmvwzhmsrzcvogv7acqfe6"), + "cron": mustParseCid("bafk2bzaceabslrigld2vshng6sppbp3bsptjtttvbxctwqe5lkyl2efom2wu4"), + "datacap": mustParseCid("bafk2bzaceagg4qklzhhg5oj4shwqpoeykeyxus7xhj2abuot2tycdwsf2oaaa"), + "eam": mustParseCid("bafk2bzaceafttsbglcetxwtzqtdniittwczogkefgnxztgsp7mymcpvdlhdik"), + "ethaccount": mustParseCid("bafk2bzacedypn6tf3yrj4bavmscddygeima3puih37fbkxuhjhlrzbjh3dbo4"), + "evm": mustParseCid("bafk2bzacec5ywczgg73fnwi36nlxso3zduop3fwj3pq6ynn5zltrs4dpcwglg"), + "init": mustParseCid("bafk2bzacebkanlbkwwtniyz4fawevnkoyje67l5nflltmciplqiutekxzzfh4"), + "multisig": mustParseCid("bafk2bzacectxa2izvpaybmmpvearekrybxtglctwnexzzneyn6xrnrmectmpa"), + "paymentchannel": mustParseCid("bafk2bzacectov7vawkhsvq7aobyjq3oppamytq425wpkxejmq65vvcdm4bt2e"), "placeholder": mustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": mustParseCid("bafk2bzacebzyuwya26rjjxmtzcszf5hcv54b3l7bz6hbflbx3wmpycbqcq6fa"), - "storagemarket": mustParseCid("bafk2bzaceav2nt4ek457u3ngn7da2gaqblwdumpzhsohp4d7whmubvarkllac"), - "storageminer": mustParseCid("bafk2bzacecxr3rdjaive7opvfyqv3p7tft6ragdozlqd6hciprlknda7u5hk6"), - "storagepower": mustParseCid("bafk2bzaceabvb7af55pgm3xpcc7lqjaupw3dyyokbmhjvbo2ebelizalmugfq"), - "system": mustParseCid("bafk2bzacecp7sswldmz6cbl7lh6y5vtwnn43mvdkgcazcyjjcpjjbtydb2f3w"), - "verifiedregistry": mustParseCid("bafk2bzaced27273xjvuyhxlne2kmbrbtupcxxpdchqbkiyr3dcqoijaok2k7e"), + "reward": mustParseCid("bafk2bzacec3xpbrxw2rnpuve4mxfhny44lxbpbwmduy4ula4ohj2bp6wplpvc"), + "storagemarket": mustParseCid("bafk2bzacec5nexsejraoqraywka7zcacjoxgpdbopehdkhiwqwcyghtof4s3w"), + "storageminer": mustParseCid("bafk2bzacecw5xzj6z5b7qxx5xca5py4aoecmqj2pxb6nw673alufy22zckkyo"), + "storagepower": mustParseCid("bafk2bzaceckhnpxoaanjf474wxzkntlnzdofoy75ehyuydfjkuw4swhotws4y"), + "system": mustParseCid("bafk2bzaceairk5qz5hyzt4yyaxa356aszyifswiust5ilxizwxujcmtzvjzoa"), + "verifiedregistry": mustParseCid("bafk2bzaced2mkyqobpgna5jevosym3adv2bvraggigyz2jgn5cxymirxj4x3i"), }, }, { - Network: "hyperspace", - Version: 8, + Network: "hyperspace", + Version: 8, + ManifestCid: mustParseCid("bafy2bzacedvffumcvf72f2btjqvece3kpcdorxq5tq76iwcmqbzvsiu526cqm"), Actors: map[string]cid.Cid{ "account": mustParseCid("bafk2bzacecim7uybic2qprbkjhowg7qkniv4zywj5h5g4u4ss72urco2akzuo"), @@ -270,8 +283,9 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": mustParseCid("bafk2bzacea7rfkjrixaidksnmjehglmavyt56nyeu3sfxu2e3dcpf62oab6tw"), }, }, { - Network: "mainnet", - Version: 8, + Network: "mainnet", + Version: 8, + ManifestCid: mustParseCid("bafy2bzacebogjbpiemi7npzxchgcjjki3tfxon4ims55obfyfleqntteljsea"), Actors: map[string]cid.Cid{ "account": mustParseCid("bafk2bzacedudbf7fc5va57t3tmo63snmt3en4iaidv4vo3qlyacbxaa6hlx6y"), @@ -287,8 +301,9 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": mustParseCid("bafk2bzaceb3zbkjz3auizmoln2unmxep7dyfcmsre64vnqfhdyh7rkqfoxlw4"), }, }, { - Network: "mainnet", - Version: 9, + Network: "mainnet", + Version: 9, + ManifestCid: mustParseCid("bafy2bzaceb6j6666h36xnhksu3ww4kxb6e25niayfgkdnifaqi6m6ooc66i6i"), Actors: map[string]cid.Cid{ "account": mustParseCid("bafk2bzacect2p7urje3pylrrrjy3tngn6yaih4gtzauuatf2jllk3ksgfiw2y"), @@ -305,30 +320,32 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": mustParseCid("bafk2bzacecf3yodlyudzukumehbuabgqljyhjt5ifiv4vetcfohnvsxzynwga"), }, }, { - Network: "mainnet", - Version: 10, - ManifestCid: mustParseCid("bafy2bzacecyg4biu2uccoekdzen4qxf4qt24deyx6j5rpwfys7qp6lixvzsxo"), + Network: "mainnet", + Version: 10, + + ManifestCid: mustParseCid("bafy2bzacecsuyf7mmvrhkx2evng5gnz5canlnz2fdlzu2lvcgptiq2pzuovos"), Actors: map[string]cid.Cid{ - "account": mustParseCid("bafk2bzacect72amqxedrtjymuq5lfrskk2itnniyfa5gdvqp5sjoeeb33oi2e"), - "cron": mustParseCid("bafk2bzaceb3nfsu5jbftadzxy24caz4tlgi6476yml25tfq2g7higtgnifys4"), - "datacap": mustParseCid("bafk2bzacec3s7oovwjxdx3hnhtqr75fsvhj7p4545gedt3kf2iuaw7zqhym2c"), - "eam": mustParseCid("bafk2bzacebw4ye6kvufarvrtqebs57idw6ydtzli7egd4h2t33jwoi547trra"), - "ethaccount": mustParseCid("bafk2bzaceavrimh4mcla6zi25uhs3ystix2n5rp4kfqeiewkh337zpjbo3egq"), - "evm": mustParseCid("bafk2bzacecnsk2ydh2q6wxf2fzsvivo6cfrka3jos62io2ds2xou4gl2byqvw"), - "init": mustParseCid("bafk2bzacebb3l4gw6hfszizw5zwho3pfpnmgrmxqm4ie42dgn62325lo4vwc2"), - "multisig": mustParseCid("bafk2bzacedi6ii3ewygygjukn4viros3uiztonnf6tg6b3ppqk4pdtqrwgeuw"), - "paymentchannel": mustParseCid("bafk2bzacebwqqfhodha2jl7tbws3dpy2dkngepbllqx6hy72zdokui3ow6eeq"), + "account": mustParseCid("bafk2bzaceampw4romta75hyz5p4cqriypmpbgnkxncgxgqn6zptv5lsp2w2bo"), + "cron": mustParseCid("bafk2bzacedcbtsifegiu432m5tysjzkxkmoczxscb6hqpmrr6img7xzdbbs2g"), + "datacap": mustParseCid("bafk2bzacealj5uk7wixhvk7l5tnredtelralwnceafqq34nb2lbylhtuyo64u"), + "eam": mustParseCid("bafk2bzacedrpm5gbleh4xkyo2jvs7p5g6f34soa6dpv7ashcdgy676snsum6g"), + "ethaccount": mustParseCid("bafk2bzaceaqoc5zakbhjxn3jljc4lxnthllzunhdor7sxhwgmskvc6drqc3fa"), + "evm": mustParseCid("bafk2bzaceahmzdxhqsm7cu2mexusjp6frm7r4kdesvti3etv5evfqboos2j4g"), + "init": mustParseCid("bafk2bzaced2f5rhir3hbpqbz5ght7ohv2kgj42g5ykxrypuo2opxsup3ykwl6"), + "multisig": mustParseCid("bafk2bzaceduf3hayh63jnl4z2knxv7cnrdenoubni22fxersc4octlwpxpmy4"), + "paymentchannel": mustParseCid("bafk2bzaceartlg4mrbwgzcwric6mtvyawpbgx2xclo2vj27nna57nxynf3pgc"), "placeholder": mustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": mustParseCid("bafk2bzacedbeexrv2d4kiridcvqgdatcwo2an4xsmg3ckdrptxu6c3y7mm6ji"), - "storagemarket": mustParseCid("bafk2bzacedalaigmokrtimabt7y7bkok5nd2j5gmifdahht3dsz5ulj7vxdgu"), - "storageminer": mustParseCid("bafk2bzacecpq5wjp3frz3b4cd2pozegi7sykgcawnaowjm6ddyai2epbphxvw"), - "storagepower": mustParseCid("bafk2bzacedfxlpyj5uxlh5uuhl55lazmhm7q6pr3qoywxb25qrytbptpy7zb6"), - "system": mustParseCid("bafk2bzacecbscw26oyfgdse6y6ij5fqtaq5uo2ehfom26mle4rk4ann2xf2jq"), - "verifiedregistry": mustParseCid("bafk2bzaceanpda37bvefmzfemikyokwnspzxdxqz5kriaqex4hpevdhphu6sq"), + "reward": mustParseCid("bafk2bzacebnhtaejfjtzymyfmbdrfmo7vgj3zsof6zlucbmkhrvcuotw5dxpq"), + "storagemarket": mustParseCid("bafk2bzaceclejwjtpu2dhw3qbx6ow7b4pmhwa7ocrbbiqwp36sq5yeg6jz2bc"), + "storageminer": mustParseCid("bafk2bzaced4h7noksockro7glnssz2jnmo2rpzd7dvnmfs4p24zx3h6gtx47s"), + "storagepower": mustParseCid("bafk2bzacec4ay4crzo73ypmh7o3fjendhbqrxake46bprabw67fvwjz5q6ixq"), + "system": mustParseCid("bafk2bzacedakk5nofebyup4m7nvx6djksfwhnxzrfuq4oyemhpl4lllaikr64"), + "verifiedregistry": mustParseCid("bafk2bzacedfel6edzqpe5oujno7fog4i526go4dtcs6vwrdtbpy2xq6htvcg6"), }, }, { - Network: "testing", - Version: 8, + Network: "testing", + Version: 8, + ManifestCid: mustParseCid("bafy2bzacedkjpqx27wgsvfxzuxfvixuxtbpt2y6yo6igcasez6gqiowron776"), Actors: map[string]cid.Cid{ "account": mustParseCid("bafk2bzacebmfbtdj5vruje5auacrhhprcjdd6uclhukb7je7t2f6ozfcgqlu2"), @@ -344,8 +361,9 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": mustParseCid("bafk2bzacectzxvtoselhnzsair5nv6k5vokvegnht6z2lfee4p3xexo4kg4m6"), }, }, { - Network: "testing", - Version: 9, + Network: "testing", + Version: 9, + ManifestCid: mustParseCid("bafy2bzacecnnrmekqw2xvud46g3vo6x26cogh3ydgljqajlxqxzzbuxsjlwjm"), Actors: map[string]cid.Cid{ "account": mustParseCid("bafk2bzaceaiebfiuu76zoywzltelio2zuvsavirka27ur6kspn7scvcl5cuiy"), @@ -362,30 +380,32 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": mustParseCid("bafk2bzaceatmqip2o3ausbntvdhj7yemu6hb3b5yqv6hm42gylbbmz7geocpm"), }, }, { - Network: "testing", - Version: 10, - ManifestCid: mustParseCid("bafy2bzacedjgfy7dmbd4i3io5r47eokprndhucdvwaxqyw4ijhhtldhewojk4"), + Network: "testing", + Version: 10, + + ManifestCid: mustParseCid("bafy2bzacebsp3bkxwsijenqeimhvhtg52d6o76hn6qhzxveqfq7d5hdd5l2ee"), Actors: map[string]cid.Cid{ - "account": mustParseCid("bafk2bzacedhme5nkedu2x3vwwfakrs4zwqrbdcb7epevety7peisq4bcahyke"), - "cron": mustParseCid("bafk2bzaced5ky3x7w6naz45tsx4omkfztyy4flmr72hfr725ksrxdhvzuulwm"), - "datacap": mustParseCid("bafk2bzacedlhpgrdwzyfhcywoud5n5gwx2arwmyqvg7yogmrpt7h5gfmotjpc"), - "eam": mustParseCid("bafk2bzaceb754ghlrlmiqref2snlqsgvmpmg3tsjokok6eshh4pt4guv64zg4"), - "ethaccount": mustParseCid("bafk2bzaceaa5vdnlqdbf5tamzxvmuva3e5zfvy5vycw4gem2b6hmintnx6ye4"), - "evm": mustParseCid("bafk2bzaceaq5fequmt5jeuixw3qn6exx4atcpveugvblpz5oacy2xnypz2mww"), - "init": mustParseCid("bafk2bzaced275afmy4htdxsgff557owyteyl32vrntbdeemzqf3qkw22n6n4u"), - "multisig": mustParseCid("bafk2bzacebiao7jb3c7svwcphkdvixj6z3genj5ufwtattmp3cmelhqinq4na"), - "paymentchannel": mustParseCid("bafk2bzacecjuud657ydp5fwlbeiqzknzkqcrqh4d5huunmtubhas55fsj3n4k"), + "account": mustParseCid("bafk2bzaceazxb6p2xg6caivmie6k2bvutyesngwyvhwv4eemwu7ia4vnqkcuy"), + "cron": mustParseCid("bafk2bzaceax6ym73boyl5zdpbcr6zmbajzylmcdvlapz5zcqgzcshakz44jbq"), + "datacap": mustParseCid("bafk2bzacea63x3v6lvtb4ast5uq3nhrpokvylymvezyr5xyjl6vtlfwkuw6qo"), + "eam": mustParseCid("bafk2bzacebhualcn7fofyqr6lhrel32ud23hcwzeenfqu3rrn5nmt6gugqgo6"), + "ethaccount": mustParseCid("bafk2bzacecgft7e3v4kbpb3tlt5s6hng74ptu3ggcdi4wmt5p4vr6qkmkw2zc"), + "evm": mustParseCid("bafk2bzaceaoqvbqetgicqpvwvcnpjx5aa74kwlhq3u7mwv4yseszxkimwz5pk"), + "init": mustParseCid("bafk2bzaceapmoyg2qppzle24t25ncyycn2uwhnw6crqkqlokkbc7w4mn74wko"), + "multisig": mustParseCid("bafk2bzacecn3dlepgaps3h6iwlq65dx6zyrbfi4pmgdqxphb5idubb6ibflwe"), + "paymentchannel": mustParseCid("bafk2bzaceaanxurr2k3ueolwcnminmdfp3tyxtntqg5fou37smeulb5dxqjzk"), "placeholder": mustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": mustParseCid("bafk2bzaceae7eic2i2cmpxmkssezmutfc635tyzxxsmnu6ctnvkd33akrpipq"), - "storagemarket": mustParseCid("bafk2bzaceaj36pbc7sxzdelygq4ew3n2w3l5y442ogvznw3mw54fxafavjcru"), - "storageminer": mustParseCid("bafk2bzacednqbtebg7xxsr2sle42pfxmz5chxn32bsjssgc3mzt7iw2eevaly"), - "storagepower": mustParseCid("bafk2bzacebovido4zxtywaz32ejagvtk4v7z5w5nwxrflaldsf56xd7pecu4w"), - "system": mustParseCid("bafk2bzacecxbbatjxkfjm5f27esjghqe2o5ajmcalp4rbqq5vtxdmpq4ylmb2"), - "verifiedregistry": mustParseCid("bafk2bzacecwzauoon6sngmiiv4ppoxshirgzyfssfircvampxjkv673vlim6m"), + "reward": mustParseCid("bafk2bzacedujdvwk4omjexdnmh2qrkqbw27v4c2g3krajhtzyfzart36bimum"), + "storagemarket": mustParseCid("bafk2bzacecdbjjxvdtltobiu7thwyyr2puunoz3q4vyfnhhxl2sbp4ovwq37s"), + "storageminer": mustParseCid("bafk2bzacebo5q7jrf4qjrhtotwt5ouzlygvml4bzofs2egdnbxyfmuo7tro6c"), + "storagepower": mustParseCid("bafk2bzacebt2ipqnorxbzncwjadkulip6blzksmwd4mmyrfjsmjyf55itra2k"), + "system": mustParseCid("bafk2bzacecf2jimdz7knhngs64ximfz3eaud6s3kiunmkybgrkupdjyo2dw7o"), + "verifiedregistry": mustParseCid("bafk2bzacecdmek2htsgcyoyl35glakyab66cojqo2y335njnm7krleb6yfbps"), }, }, { - Network: "testing-fake-proofs", - Version: 8, + Network: "testing-fake-proofs", + Version: 8, + ManifestCid: mustParseCid("bafy2bzacecd3lb5v6tzjylnhnrhexslssyaozy6hogzgpkhztoe76exbrgrug"), Actors: map[string]cid.Cid{ "account": mustParseCid("bafk2bzacebmfbtdj5vruje5auacrhhprcjdd6uclhukb7je7t2f6ozfcgqlu2"), @@ -401,8 +421,9 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": mustParseCid("bafk2bzacectzxvtoselhnzsair5nv6k5vokvegnht6z2lfee4p3xexo4kg4m6"), }, }, { - Network: "testing-fake-proofs", - Version: 9, + Network: "testing-fake-proofs", + Version: 9, + ManifestCid: mustParseCid("bafy2bzacecql2gj2tri4fnbznmldue73qzt6zszvugw4exd64mwb52zrhv7k2"), Actors: map[string]cid.Cid{ "account": mustParseCid("bafk2bzaceaiebfiuu76zoywzltelio2zuvsavirka27ur6kspn7scvcl5cuiy"), @@ -419,26 +440,27 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet "verifiedregistry": mustParseCid("bafk2bzaceatmqip2o3ausbntvdhj7yemu6hb3b5yqv6hm42gylbbmz7geocpm"), }, }, { - Network: "testing-fake-proofs", - Version: 10, - ManifestCid: mustParseCid("bafy2bzaceblvi7d3yosakpuux27gqzr34gcjr6a2f6uzbyagmwybgfsk4xeu2"), + Network: "testing-fake-proofs", + Version: 10, + + ManifestCid: mustParseCid("bafy2bzacedwap2uuii4luljckrnb4vkur2unb6fyinn7xjie6xlva2wmlygj2"), Actors: map[string]cid.Cid{ - "account": mustParseCid("bafk2bzacedhme5nkedu2x3vwwfakrs4zwqrbdcb7epevety7peisq4bcahyke"), - "cron": mustParseCid("bafk2bzaced5ky3x7w6naz45tsx4omkfztyy4flmr72hfr725ksrxdhvzuulwm"), - "datacap": mustParseCid("bafk2bzacedlhpgrdwzyfhcywoud5n5gwx2arwmyqvg7yogmrpt7h5gfmotjpc"), - "eam": mustParseCid("bafk2bzaceb754ghlrlmiqref2snlqsgvmpmg3tsjokok6eshh4pt4guv64zg4"), - "ethaccount": mustParseCid("bafk2bzaceaa5vdnlqdbf5tamzxvmuva3e5zfvy5vycw4gem2b6hmintnx6ye4"), - "evm": mustParseCid("bafk2bzaceaq5fequmt5jeuixw3qn6exx4atcpveugvblpz5oacy2xnypz2mww"), - "init": mustParseCid("bafk2bzaced275afmy4htdxsgff557owyteyl32vrntbdeemzqf3qkw22n6n4u"), - "multisig": mustParseCid("bafk2bzacebiao7jb3c7svwcphkdvixj6z3genj5ufwtattmp3cmelhqinq4na"), - "paymentchannel": mustParseCid("bafk2bzacecjuud657ydp5fwlbeiqzknzkqcrqh4d5huunmtubhas55fsj3n4k"), + "account": mustParseCid("bafk2bzaceazxb6p2xg6caivmie6k2bvutyesngwyvhwv4eemwu7ia4vnqkcuy"), + "cron": mustParseCid("bafk2bzaceax6ym73boyl5zdpbcr6zmbajzylmcdvlapz5zcqgzcshakz44jbq"), + "datacap": mustParseCid("bafk2bzacea63x3v6lvtb4ast5uq3nhrpokvylymvezyr5xyjl6vtlfwkuw6qo"), + "eam": mustParseCid("bafk2bzacebhualcn7fofyqr6lhrel32ud23hcwzeenfqu3rrn5nmt6gugqgo6"), + "ethaccount": mustParseCid("bafk2bzacecgft7e3v4kbpb3tlt5s6hng74ptu3ggcdi4wmt5p4vr6qkmkw2zc"), + "evm": mustParseCid("bafk2bzaceaoqvbqetgicqpvwvcnpjx5aa74kwlhq3u7mwv4yseszxkimwz5pk"), + "init": mustParseCid("bafk2bzaceapmoyg2qppzle24t25ncyycn2uwhnw6crqkqlokkbc7w4mn74wko"), + "multisig": mustParseCid("bafk2bzacecn3dlepgaps3h6iwlq65dx6zyrbfi4pmgdqxphb5idubb6ibflwe"), + "paymentchannel": mustParseCid("bafk2bzaceaanxurr2k3ueolwcnminmdfp3tyxtntqg5fou37smeulb5dxqjzk"), "placeholder": mustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": mustParseCid("bafk2bzaceae7eic2i2cmpxmkssezmutfc635tyzxxsmnu6ctnvkd33akrpipq"), - "storagemarket": mustParseCid("bafk2bzaceaj36pbc7sxzdelygq4ew3n2w3l5y442ogvznw3mw54fxafavjcru"), - "storageminer": mustParseCid("bafk2bzaceaoaduzssj46mse6gizcy764ingsgvuavafkowf4vexluindct3ji"), - "storagepower": mustParseCid("bafk2bzacedqvicpfdcegfsj6p4rb3judx7v5v6trpnca7djbim4pts5appis4"), - "system": mustParseCid("bafk2bzacecxbbatjxkfjm5f27esjghqe2o5ajmcalp4rbqq5vtxdmpq4ylmb2"), - "verifiedregistry": mustParseCid("bafk2bzacecwzauoon6sngmiiv4ppoxshirgzyfssfircvampxjkv673vlim6m"), + "reward": mustParseCid("bafk2bzacedujdvwk4omjexdnmh2qrkqbw27v4c2g3krajhtzyfzart36bimum"), + "storagemarket": mustParseCid("bafk2bzacecdbjjxvdtltobiu7thwyyr2puunoz3q4vyfnhhxl2sbp4ovwq37s"), + "storageminer": mustParseCid("bafk2bzacedc5klueery4fn2voso4u76rgo54uctsculesdbxxbeh6rgp2q4te"), + "storagepower": mustParseCid("bafk2bzacecuz2h2renlfio4xkyrvvro7nwidf7utpjy3oizk2xuszoz3gmea6"), + "system": mustParseCid("bafk2bzacecf2jimdz7knhngs64ximfz3eaud6s3kiunmkybgrkupdjyo2dw7o"), + "verifiedregistry": mustParseCid("bafk2bzacecdmek2htsgcyoyl35glakyab66cojqo2y335njnm7krleb6yfbps"), }, }} diff --git a/venus-shared/actors/types/eth.go b/venus-shared/actors/types/eth.go index a1324f2e73..97ee6fd2e3 100644 --- a/venus-shared/actors/types/eth.go +++ b/venus-shared/actors/types/eth.go @@ -70,6 +70,18 @@ func EthUint64FromHex(s string) (EthUint64, error) { return EthUint64(parsedInt), nil } +// Parse a uint64 from big-endian encoded bytes. +func EthUint64FromBytes(b []byte) (EthUint64, error) { + if len(b) != 32 { + return 0, fmt.Errorf("eth int must be 32 bytes long") + } + var zeros [32 - 8]byte + if !bytes.Equal(b[:len(zeros)], zeros[:]) { + return 0, fmt.Errorf("eth int overflows 64 bits") + } + return EthUint64(binary.BigEndian.Uint64(b[len(zeros):])), nil +} + func (e EthUint64) Hex() string { if e == 0 { return "0x0" @@ -84,11 +96,15 @@ var ( EthBigIntZero = EthBigInt{Int: big.Zero().Int} ) -func (e EthBigInt) MarshalJSON() ([]byte, error) { +func (e EthBigInt) String() string { if e.Int == nil || e.Int.BitLen() == 0 { - return json.Marshal("0x0") + return "0x0" } - return json.Marshal(fmt.Sprintf("0x%x", e.Int)) + return fmt.Sprintf("0x%x", e.Int) +} + +func (e EthBigInt) MarshalJSON() ([]byte, error) { + return json.Marshal(e.String()) } func (e *EthBigInt) UnmarshalJSON(b []byte) error { @@ -112,13 +128,15 @@ func (e *EthBigInt) UnmarshalJSON(b []byte) error { // EthBytes represent arbitrary bytes. A nil or empty slice serializes to "0x". type EthBytes []byte -func (e EthBytes) MarshalJSON() ([]byte, error) { +func (e EthBytes) String() string { if len(e) == 0 { - return json.Marshal("0x") + return "0x" } - s := hex.EncodeToString(e) + return "0x" + hex.EncodeToString(e) +} - return json.Marshal("0x" + s) +func (e EthBytes) MarshalJSON() ([]byte, error) { + return json.Marshal(e.String()) } func (e *EthBytes) UnmarshalJSON(b []byte) error { @@ -283,6 +301,19 @@ func EthAddressFromPubKey(pubk []byte) ([]byte, error) { return ethAddr, nil } +func IsEthAddress(addr address.Address) bool { + if addr.Protocol() != address.Delegated { + return false + } + payload := addr.Payload() + namespace, _, err := varint.FromUvarint(payload) + if err != nil { + return false + } + + return namespace == builtintypes.EthereumAddressManagerActorID +} + func EthAddressFromFilecoinAddress(addr address.Address) (EthAddress, error) { switch addr.Protocol() { case address.ID: diff --git a/venus-shared/api/chain/v0/chain.go b/venus-shared/api/chain/v0/chain.go index ea256dc6dd..18b15dd80d 100644 --- a/venus-shared/api/chain/v0/chain.go +++ b/venus-shared/api/chain/v0/chain.go @@ -61,7 +61,6 @@ type IChainInfo interface { GetActor(ctx context.Context, addr address.Address) (*types.Actor, error) //perm:read GetParentStateRootActor(ctx context.Context, ts *types.TipSet, addr address.Address) (*types.Actor, error) //perm:read GetEntry(ctx context.Context, height abi.ChainEpoch, round uint64) (*types.BeaconEntry, error) //perm:read - MessageWait(ctx context.Context, msgCid cid.Cid, confidence, lookback abi.ChainEpoch) (*types.ChainMessage, error) //perm:read ProtocolParameters(ctx context.Context) (*types.ProtocolParams, error) //perm:read ResolveToKeyAddr(ctx context.Context, addr address.Address, ts *types.TipSet) (address.Address, error) //perm:read StateNetworkName(ctx context.Context) (types.NetworkName, error) //perm:read @@ -84,6 +83,39 @@ type IChainInfo interface { StateActorManifestCID(context.Context, network.Version) (cid.Cid, error) //perm:read StateCall(ctx context.Context, msg *types.Message, tsk types.TipSetKey) (*types.InvocResult, error) //perm:read StateReplay(context.Context, types.TipSetKey, cid.Cid) (*types.InvocResult, error) //perm:read + // 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. + // + // When called, StateCompute will: + // - Load the provided tipset, or use the current chain head if not provided + // - Compute the tipset state of the provided tipset on top of the parent state + // - (note that this step runs before vmheight is applied to the execution) + // - Execute state upgrade if any were scheduled at the epoch, or in null + // blocks preceding the tipset + // - Call the cron actor on null blocks preceding the tipset + // - For each block in the tipset + // - Apply messages in blocks in the specified + // - Award block reward by calling the reward actor + // - Call the cron actor for the current epoch + // - If the specified vmheight is higher than the current epoch, apply any + // needed state upgrades to the state + // - Apply the specified messages to the state + // + // The vmheight parameter sets VM execution epoch, and can be used to simulate + // message execution in different network versions. If the specified vmheight + // epoch is higher than the epoch of the specified tipset, any state upgrades + // until the vmheight will be executed on the state before applying messages + // specified by the user. + // + // Note that the initial tipset state computation is not affected by the + // vmheight parameter - only the messages in the `apply` set are + // + // If the caller wants to simply compute the state, vmheight should be set to + // the epoch of the specified tipset. + // + // Messages in the `apply` parameter must have the correct nonces, and gas + // values set. + StateCompute(context.Context, abi.ChainEpoch, []*types.Message, types.TipSetKey) (*types.ComputeStateOutput, error) //perm:read } type IMinerState interface { diff --git a/venus-shared/api/chain/v0/method.md b/venus-shared/api/chain/v0/method.md index 0d933a9ab0..44383fee02 100644 --- a/venus-shared/api/chain/v0/method.md +++ b/venus-shared/api/chain/v0/method.md @@ -43,12 +43,12 @@ curl http://:/rpc/v0 -X POST -H "Content-Type: application/json" -H " * [GetEntry](#getentry) * [GetFullBlock](#getfullblock) * [GetParentStateRootActor](#getparentstaterootactor) - * [MessageWait](#messagewait) * [ProtocolParameters](#protocolparameters) * [ResolveToKeyAddr](#resolvetokeyaddr) * [StateActorCodeCIDs](#stateactorcodecids) * [StateActorManifestCID](#stateactormanifestcid) * [StateCall](#statecall) + * [StateCompute](#statecompute) * [StateGetNetworkParams](#stategetnetworkparams) * [StateGetReceipt](#stategetreceipt) * [StateNetworkName](#statenetworkname) @@ -1164,105 +1164,6 @@ Response: } ``` -### MessageWait - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - 10101, - 10101 -] -``` - -Response: -```json -{ - "TS": { - "Cids": null, - "Blocks": null, - "Height": 0 - }, - "Message": { - "CID": { - "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" - }, - "Version": 42, - "To": "f01234", - "From": "f01234", - "Nonce": 42, - "Value": "0", - "GasLimit": 9, - "GasFeeCap": "0", - "GasPremium": "0", - "Method": 1, - "Params": "Ynl0ZSBhcnJheQ==" - }, - "Block": { - "Miner": "f01234", - "Ticket": { - "VRFProof": "Bw==" - }, - "ElectionProof": { - "WinCount": 9, - "VRFProof": "Bw==" - }, - "BeaconEntries": [ - { - "Round": 42, - "Data": "Ynl0ZSBhcnJheQ==" - } - ], - "WinPoStProof": [ - { - "PoStProof": 8, - "ProofBytes": "Ynl0ZSBhcnJheQ==" - } - ], - "Parents": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "ParentWeight": "0", - "Height": 10101, - "ParentStateRoot": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "ParentMessageReceipts": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Messages": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "BLSAggregate": { - "Type": 2, - "Data": "Ynl0ZSBhcnJheQ==" - }, - "Timestamp": 42, - "BlockSig": { - "Type": 2, - "Data": "Ynl0ZSBhcnJheQ==" - }, - "ForkSignaling": 42, - "ParentBaseFee": "0" - }, - "Receipt": { - "ExitCode": 0, - "Return": "Ynl0ZSBhcnJheQ==", - "GasUsed": 9, - "EventsRoot": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } -} -``` - ### ProtocolParameters @@ -1515,6 +1416,225 @@ Response: } ``` +### StateCompute +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. + +When called, StateCompute will: +- Load the provided tipset, or use the current chain head if not provided +- Compute the tipset state of the provided tipset on top of the parent state +- (note that this step runs before vmheight is applied to the execution) +- Execute state upgrade if any were scheduled at the epoch, or in null +blocks preceding the tipset +- Call the cron actor on null blocks preceding the tipset +- For each block in the tipset +- Apply messages in blocks in the specified +- Award block reward by calling the reward actor +- Call the cron actor for the current epoch +- If the specified vmheight is higher than the current epoch, apply any +needed state upgrades to the state +- Apply the specified messages to the state + +The vmheight parameter sets VM execution epoch, and can be used to simulate +message execution in different network versions. If the specified vmheight +epoch is higher than the epoch of the specified tipset, any state upgrades +until the vmheight will be executed on the state before applying messages +specified by the user. + +Note that the initial tipset state computation is not affected by the +vmheight parameter - only the messages in the `apply` set are + +If the caller wants to simply compute the state, vmheight should be set to +the epoch of the specified tipset. + +Messages in the `apply` parameter must have the correct nonces, and gas +values set. + + +Perms: read + +Inputs: +```json +[ + 10101, + [ + { + "CID": { + "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" + }, + "Version": 42, + "To": "f01234", + "From": "f01234", + "Nonce": 42, + "Value": "0", + "GasLimit": 9, + "GasFeeCap": "0", + "GasPremium": "0", + "Method": 1, + "Params": "Ynl0ZSBhcnJheQ==" + } + ], + [ + { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + { + "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" + } + ] +] +``` + +Response: +```json +{ + "Root": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "Trace": [ + { + "MsgCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "Msg": { + "CID": { + "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" + }, + "Version": 42, + "To": "f01234", + "From": "f01234", + "Nonce": 42, + "Value": "0", + "GasLimit": 9, + "GasFeeCap": "0", + "GasPremium": "0", + "Method": 1, + "Params": "Ynl0ZSBhcnJheQ==" + }, + "MsgRct": { + "ExitCode": 0, + "Return": "Ynl0ZSBhcnJheQ==", + "GasUsed": 9, + "EventsRoot": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + } + }, + "GasCost": { + "Message": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "GasUsed": "0", + "BaseFeeBurn": "0", + "OverEstimationBurn": "0", + "MinerPenalty": "0", + "MinerTip": "0", + "Refund": "0", + "TotalCost": "0" + }, + "ExecutionTrace": { + "Msg": { + "CID": { + "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" + }, + "Version": 42, + "To": "f01234", + "From": "f01234", + "Nonce": 42, + "Value": "0", + "GasLimit": 9, + "GasFeeCap": "0", + "GasPremium": "0", + "Method": 1, + "Params": "Ynl0ZSBhcnJheQ==" + }, + "MsgRct": { + "ExitCode": 0, + "Return": "Ynl0ZSBhcnJheQ==", + "GasUsed": 9, + "EventsRoot": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + } + }, + "Error": "string value", + "Duration": 60000000000, + "GasCharges": [ + { + "Name": "string value", + "loc": [ + { + "File": "string value", + "Line": 123, + "Function": "string value" + } + ], + "tg": 9, + "cg": 9, + "sg": 9, + "vtg": 9, + "vcg": 9, + "vsg": 9, + "tt": 60000000000, + "ex": {} + } + ], + "Subcalls": [ + { + "Msg": { + "CID": { + "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" + }, + "Version": 42, + "To": "f01234", + "From": "f01234", + "Nonce": 42, + "Value": "0", + "GasLimit": 9, + "GasFeeCap": "0", + "GasPremium": "0", + "Method": 1, + "Params": "Ynl0ZSBhcnJheQ==" + }, + "MsgRct": { + "ExitCode": 0, + "Return": "Ynl0ZSBhcnJheQ==", + "GasUsed": 9, + "EventsRoot": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + } + }, + "Error": "string value", + "Duration": 60000000000, + "GasCharges": [ + { + "Name": "string value", + "loc": [ + { + "File": "string value", + "Line": 123, + "Function": "string value" + } + ], + "tg": 9, + "cg": 9, + "sg": 9, + "vtg": 9, + "vcg": 9, + "vsg": 9, + "tt": 60000000000, + "ex": {} + } + ], + "Subcalls": null + } + ] + }, + "Error": "string value", + "Duration": 60000000000 + } + ] +} +``` + ### StateGetNetworkParams StateGetNetworkParams return current network params diff --git a/venus-shared/api/chain/v0/mock/mock_fullnode.go b/venus-shared/api/chain/v0/mock/mock_fullnode.go index b7ef2df026..e7a9878061 100644 --- a/venus-shared/api/chain/v0/mock/mock_fullnode.go +++ b/venus-shared/api/chain/v0/mock/mock_fullnode.go @@ -661,21 +661,6 @@ func (mr *MockFullNodeMockRecorder) LockWallet(arg0 interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LockWallet", reflect.TypeOf((*MockFullNode)(nil).LockWallet), arg0) } -// MessageWait mocks base method. -func (m *MockFullNode) MessageWait(arg0 context.Context, arg1 cid.Cid, arg2, arg3 abi.ChainEpoch) (*types0.ChainMessage, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "MessageWait", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(*types0.ChainMessage) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// MessageWait indicates an expected call of MessageWait. -func (mr *MockFullNodeMockRecorder) MessageWait(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MessageWait", reflect.TypeOf((*MockFullNode)(nil).MessageWait), arg0, arg1, arg2, arg3) -} - // MinerCreateBlock mocks base method. func (m *MockFullNode) MinerCreateBlock(arg0 context.Context, arg1 *types0.BlockTemplate) (*types0.BlockMsg, error) { m.ctrl.T.Helper() @@ -1623,6 +1608,21 @@ func (mr *MockFullNodeMockRecorder) StateCirculatingSupply(arg0, arg1 interface{ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateCirculatingSupply", reflect.TypeOf((*MockFullNode)(nil).StateCirculatingSupply), arg0, arg1) } +// StateCompute mocks base method. +func (m *MockFullNode) StateCompute(arg0 context.Context, arg1 abi.ChainEpoch, arg2 []*types.Message, arg3 types0.TipSetKey) (*types0.ComputeStateOutput, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "StateCompute", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(*types0.ComputeStateOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// StateCompute indicates an expected call of StateCompute. +func (mr *MockFullNodeMockRecorder) StateCompute(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateCompute", reflect.TypeOf((*MockFullNode)(nil).StateCompute), arg0, arg1, arg2, arg3) +} + // StateDealProviderCollateralBounds mocks base method. func (m *MockFullNode) StateDealProviderCollateralBounds(arg0 context.Context, arg1 abi.PaddedPieceSize, arg2 bool, arg3 types0.TipSetKey) (types0.DealCollateralBounds, error) { m.ctrl.T.Helper() diff --git a/venus-shared/api/chain/v0/proxy_gen.go b/venus-shared/api/chain/v0/proxy_gen.go index c5846b48f8..32717345e9 100644 --- a/venus-shared/api/chain/v0/proxy_gen.go +++ b/venus-shared/api/chain/v0/proxy_gen.go @@ -254,12 +254,12 @@ type IChainInfoStruct struct { GetEntry func(ctx context.Context, height abi.ChainEpoch, round uint64) (*types.BeaconEntry, error) `perm:"read"` GetFullBlock func(ctx context.Context, id cid.Cid) (*types.FullBlock, error) `perm:"read"` GetParentStateRootActor func(ctx context.Context, ts *types.TipSet, addr address.Address) (*types.Actor, error) `perm:"read"` - MessageWait func(ctx context.Context, msgCid cid.Cid, confidence, lookback abi.ChainEpoch) (*types.ChainMessage, error) `perm:"read"` ProtocolParameters func(ctx context.Context) (*types.ProtocolParams, error) `perm:"read"` ResolveToKeyAddr func(ctx context.Context, addr address.Address, ts *types.TipSet) (address.Address, error) `perm:"read"` StateActorCodeCIDs func(context.Context, network.Version) (map[string]cid.Cid, error) `perm:"read"` StateActorManifestCID func(context.Context, network.Version) (cid.Cid, error) `perm:"read"` StateCall func(ctx context.Context, msg *types.Message, tsk types.TipSetKey) (*types.InvocResult, error) `perm:"read"` + StateCompute func(context.Context, abi.ChainEpoch, []*types.Message, types.TipSetKey) (*types.ComputeStateOutput, error) `perm:"read"` StateGetNetworkParams func(ctx context.Context) (*types.NetworkParams, error) `perm:"read"` StateGetReceipt func(ctx context.Context, msg cid.Cid, from types.TipSetKey) (*types.MessageReceipt, error) `perm:"read"` StateNetworkName func(ctx context.Context) (types.NetworkName, error) `perm:"read"` @@ -344,9 +344,6 @@ func (s *IChainInfoStruct) GetFullBlock(p0 context.Context, p1 cid.Cid) (*types. func (s *IChainInfoStruct) GetParentStateRootActor(p0 context.Context, p1 *types.TipSet, p2 address.Address) (*types.Actor, error) { return s.Internal.GetParentStateRootActor(p0, p1, p2) } -func (s *IChainInfoStruct) MessageWait(p0 context.Context, p1 cid.Cid, p2, p3 abi.ChainEpoch) (*types.ChainMessage, error) { - return s.Internal.MessageWait(p0, p1, p2, p3) -} func (s *IChainInfoStruct) ProtocolParameters(p0 context.Context) (*types.ProtocolParams, error) { return s.Internal.ProtocolParameters(p0) } @@ -362,6 +359,9 @@ func (s *IChainInfoStruct) StateActorManifestCID(p0 context.Context, p1 network. func (s *IChainInfoStruct) StateCall(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*types.InvocResult, error) { return s.Internal.StateCall(p0, p1, p2) } +func (s *IChainInfoStruct) StateCompute(p0 context.Context, p1 abi.ChainEpoch, p2 []*types.Message, p3 types.TipSetKey) (*types.ComputeStateOutput, error) { + return s.Internal.StateCompute(p0, p1, p2, p3) +} func (s *IChainInfoStruct) StateGetNetworkParams(p0 context.Context) (*types.NetworkParams, error) { return s.Internal.StateGetNetworkParams(p0) } diff --git a/venus-shared/api/chain/v1/chain.go b/venus-shared/api/chain/v1/chain.go index 920a27e04b..5ea92ed118 100644 --- a/venus-shared/api/chain/v1/chain.go +++ b/venus-shared/api/chain/v1/chain.go @@ -47,25 +47,24 @@ type IChainInfo interface { // StateGetBeaconEntry returns the beacon entry for the given filecoin epoch. If // the entry has not yet been produced, the call will block until the entry // becomes available - StateGetBeaconEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) //perm:read - ChainGetBlock(ctx context.Context, id cid.Cid) (*types.BlockHeader, error) //perm:read - ChainGetMessage(ctx context.Context, msgID cid.Cid) (*types.Message, error) //perm:read - ChainGetBlockMessages(ctx context.Context, bid cid.Cid) (*types.BlockMessages, error) //perm:read - ChainGetMessagesInTipset(ctx context.Context, key types.TipSetKey) ([]types.MessageCID, error) //perm:read - ChainGetReceipts(ctx context.Context, id cid.Cid) ([]types.MessageReceipt, error) //perm:read - ChainGetParentMessages(ctx context.Context, bcid cid.Cid) ([]types.MessageCID, error) //perm:read - ChainGetParentReceipts(ctx context.Context, bcid cid.Cid) ([]*types.MessageReceipt, error) //perm:read - StateVerifiedRegistryRootKey(ctx context.Context, tsk types.TipSetKey) (address.Address, error) //perm:read - StateVerifierStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) //perm:read - ChainNotify(ctx context.Context) (<-chan []*types.HeadChange, error) //perm:read - GetFullBlock(ctx context.Context, id cid.Cid) (*types.FullBlock, error) //perm:read - GetActor(ctx context.Context, addr address.Address) (*types.Actor, error) //perm:read - GetParentStateRootActor(ctx context.Context, ts *types.TipSet, addr address.Address) (*types.Actor, error) //perm:read - GetEntry(ctx context.Context, height abi.ChainEpoch, round uint64) (*types.BeaconEntry, error) //perm:read - MessageWait(ctx context.Context, msgCid cid.Cid, confidence, lookback abi.ChainEpoch) (*types.ChainMessage, error) //perm:read - ProtocolParameters(ctx context.Context) (*types.ProtocolParams, error) //perm:read - ResolveToKeyAddr(ctx context.Context, addr address.Address, ts *types.TipSet) (address.Address, error) //perm:read - StateNetworkName(ctx context.Context) (types.NetworkName, error) //perm:read + StateGetBeaconEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) //perm:read + ChainGetBlock(ctx context.Context, id cid.Cid) (*types.BlockHeader, error) //perm:read + ChainGetMessage(ctx context.Context, msgID cid.Cid) (*types.Message, error) //perm:read + ChainGetBlockMessages(ctx context.Context, bid cid.Cid) (*types.BlockMessages, error) //perm:read + ChainGetMessagesInTipset(ctx context.Context, key types.TipSetKey) ([]types.MessageCID, error) //perm:read + ChainGetReceipts(ctx context.Context, id cid.Cid) ([]types.MessageReceipt, error) //perm:read + ChainGetParentMessages(ctx context.Context, bcid cid.Cid) ([]types.MessageCID, error) //perm:read + ChainGetParentReceipts(ctx context.Context, bcid cid.Cid) ([]*types.MessageReceipt, error) //perm:read + StateVerifiedRegistryRootKey(ctx context.Context, tsk types.TipSetKey) (address.Address, error) //perm:read + StateVerifierStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) //perm:read + ChainNotify(ctx context.Context) (<-chan []*types.HeadChange, error) //perm:read + GetFullBlock(ctx context.Context, id cid.Cid) (*types.FullBlock, error) //perm:read + GetActor(ctx context.Context, addr address.Address) (*types.Actor, error) //perm:read + GetParentStateRootActor(ctx context.Context, ts *types.TipSet, addr address.Address) (*types.Actor, error) //perm:read + GetEntry(ctx context.Context, height abi.ChainEpoch, round uint64) (*types.BeaconEntry, error) //perm:read + ProtocolParameters(ctx context.Context) (*types.ProtocolParams, error) //perm:read + ResolveToKeyAddr(ctx context.Context, addr address.Address, ts *types.TipSet) (address.Address, error) //perm:read + StateNetworkName(ctx context.Context) (types.NetworkName, error) //perm:read // StateSearchMsg looks back up to limit epochs in the chain for a message, and returns its receipt and the tipset where it was executed // // NOTE: If a replacing message is found on chain, this method will return @@ -118,6 +117,39 @@ type IChainInfo interface { StateReplay(context.Context, types.TipSetKey, cid.Cid) (*types.InvocResult, error) //perm:read // ChainGetEvents returns the events under an event AMT root CID. ChainGetEvents(context.Context, cid.Cid) ([]types.Event, error) //perm:read + // 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. + // + // When called, StateCompute will: + // - Load the provided tipset, or use the current chain head if not provided + // - Compute the tipset state of the provided tipset on top of the parent state + // - (note that this step runs before vmheight is applied to the execution) + // - Execute state upgrade if any were scheduled at the epoch, or in null + // blocks preceding the tipset + // - Call the cron actor on null blocks preceding the tipset + // - For each block in the tipset + // - Apply messages in blocks in the specified + // - Award block reward by calling the reward actor + // - Call the cron actor for the current epoch + // - If the specified vmheight is higher than the current epoch, apply any + // needed state upgrades to the state + // - Apply the specified messages to the state + // + // The vmheight parameter sets VM execution epoch, and can be used to simulate + // message execution in different network versions. If the specified vmheight + // epoch is higher than the epoch of the specified tipset, any state upgrades + // until the vmheight will be executed on the state before applying messages + // specified by the user. + // + // Note that the initial tipset state computation is not affected by the + // vmheight parameter - only the messages in the `apply` set are + // + // If the caller wants to simply compute the state, vmheight should be set to + // the epoch of the specified tipset. + // + // Messages in the `apply` parameter must have the correct nonces, and gas + // values set. + StateCompute(context.Context, abi.ChainEpoch, []*types.Message, types.TipSetKey) (*types.ComputeStateOutput, error) //perm:read } type IMinerState interface { diff --git a/venus-shared/api/chain/v1/eth.go b/venus-shared/api/chain/v1/eth.go index e8f9a34d3f..ce3499a8ce 100644 --- a/venus-shared/api/chain/v1/eth.go +++ b/venus-shared/api/chain/v1/eth.go @@ -3,6 +3,7 @@ package v1 import ( "context" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-jsonrpc" "github.com/filecoin-project/venus/venus-shared/types" "github.com/ipfs/go-cid" @@ -18,6 +19,10 @@ type IETH interface { // // EthAccounts will always return [] since we don't expect Lotus to manage private keys EthAccounts(ctx context.Context) ([]types.EthAddress, error) //perm:read + // EthAddressToFilecoinAddress converts an EthAddress into an f410 Filecoin Address + EthAddressToFilecoinAddress(ctx context.Context, ethAddress types.EthAddress) (address.Address, error) //perm:read + // FilecoinAddressToEthAddress converts an f410 or f0 Filecoin Address to an EthAddress + FilecoinAddressToEthAddress(ctx context.Context, filecoinAddress address.Address) (types.EthAddress, error) //perm:read // EthBlockNumber returns the height of the latest (heaviest) TipSet EthBlockNumber(ctx context.Context) (types.EthUint64, error) //perm:read // EthGetBlockTransactionCountByNumber returns the number of messages in the TipSet diff --git a/venus-shared/api/chain/v1/method.md b/venus-shared/api/chain/v1/method.md index 04e24c0d2a..62b4e89615 100644 --- a/venus-shared/api/chain/v1/method.md +++ b/venus-shared/api/chain/v1/method.md @@ -41,12 +41,12 @@ curl http://:/rpc/v1 -X POST -H "Content-Type: application/json" -H " * [GetEntry](#getentry) * [GetFullBlock](#getfullblock) * [GetParentStateRootActor](#getparentstaterootactor) - * [MessageWait](#messagewait) * [ProtocolParameters](#protocolparameters) * [ResolveToKeyAddr](#resolvetokeyaddr) * [StateActorCodeCIDs](#stateactorcodecids) * [StateActorManifestCID](#stateactormanifestcid) * [StateCall](#statecall) + * [StateCompute](#statecompute) * [StateGetBeaconEntry](#stategetbeaconentry) * [StateGetNetworkParams](#stategetnetworkparams) * [StateGetRandomnessFromBeacon](#stategetrandomnessfrombeacon) @@ -65,6 +65,7 @@ curl http://:/rpc/v1 -X POST -H "Content-Type: application/json" -H " * [Version](#version) * [ETH](#eth) * [EthAccounts](#ethaccounts) + * [EthAddressToFilecoinAddress](#ethaddresstofilecoinaddress) * [EthBlockNumber](#ethblocknumber) * [EthCall](#ethcall) * [EthChainId](#ethchainid) @@ -88,6 +89,7 @@ curl http://:/rpc/v1 -X POST -H "Content-Type: application/json" -H " * [EthMaxPriorityFeePerGas](#ethmaxpriorityfeepergas) * [EthProtocolVersion](#ethprotocolversion) * [EthSendRawTransaction](#ethsendrawtransaction) + * [FilecoinAddressToEthAddress](#filecoinaddresstoethaddress) * [NetListening](#netlistening) * [NetVersion](#netversion) * [Web3ClientVersion](#web3clientversion) @@ -1205,105 +1207,6 @@ Response: } ``` -### MessageWait - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - 10101, - 10101 -] -``` - -Response: -```json -{ - "TS": { - "Cids": null, - "Blocks": null, - "Height": 0 - }, - "Message": { - "CID": { - "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" - }, - "Version": 42, - "To": "f01234", - "From": "f01234", - "Nonce": 42, - "Value": "0", - "GasLimit": 9, - "GasFeeCap": "0", - "GasPremium": "0", - "Method": 1, - "Params": "Ynl0ZSBhcnJheQ==" - }, - "Block": { - "Miner": "f01234", - "Ticket": { - "VRFProof": "Bw==" - }, - "ElectionProof": { - "WinCount": 9, - "VRFProof": "Bw==" - }, - "BeaconEntries": [ - { - "Round": 42, - "Data": "Ynl0ZSBhcnJheQ==" - } - ], - "WinPoStProof": [ - { - "PoStProof": 8, - "ProofBytes": "Ynl0ZSBhcnJheQ==" - } - ], - "Parents": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "ParentWeight": "0", - "Height": 10101, - "ParentStateRoot": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "ParentMessageReceipts": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Messages": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "BLSAggregate": { - "Type": 2, - "Data": "Ynl0ZSBhcnJheQ==" - }, - "Timestamp": 42, - "BlockSig": { - "Type": 2, - "Data": "Ynl0ZSBhcnJheQ==" - }, - "ForkSignaling": 42, - "ParentBaseFee": "0" - }, - "Receipt": { - "ExitCode": 0, - "Return": "Ynl0ZSBhcnJheQ==", - "GasUsed": 9, - "EventsRoot": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } -} -``` - ### ProtocolParameters @@ -1556,6 +1459,225 @@ Response: } ``` +### StateCompute +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. + +When called, StateCompute will: +- Load the provided tipset, or use the current chain head if not provided +- Compute the tipset state of the provided tipset on top of the parent state +- (note that this step runs before vmheight is applied to the execution) +- Execute state upgrade if any were scheduled at the epoch, or in null +blocks preceding the tipset +- Call the cron actor on null blocks preceding the tipset +- For each block in the tipset +- Apply messages in blocks in the specified +- Award block reward by calling the reward actor +- Call the cron actor for the current epoch +- If the specified vmheight is higher than the current epoch, apply any +needed state upgrades to the state +- Apply the specified messages to the state + +The vmheight parameter sets VM execution epoch, and can be used to simulate +message execution in different network versions. If the specified vmheight +epoch is higher than the epoch of the specified tipset, any state upgrades +until the vmheight will be executed on the state before applying messages +specified by the user. + +Note that the initial tipset state computation is not affected by the +vmheight parameter - only the messages in the `apply` set are + +If the caller wants to simply compute the state, vmheight should be set to +the epoch of the specified tipset. + +Messages in the `apply` parameter must have the correct nonces, and gas +values set. + + +Perms: read + +Inputs: +```json +[ + 10101, + [ + { + "CID": { + "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" + }, + "Version": 42, + "To": "f01234", + "From": "f01234", + "Nonce": 42, + "Value": "0", + "GasLimit": 9, + "GasFeeCap": "0", + "GasPremium": "0", + "Method": 1, + "Params": "Ynl0ZSBhcnJheQ==" + } + ], + [ + { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + { + "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" + } + ] +] +``` + +Response: +```json +{ + "Root": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "Trace": [ + { + "MsgCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "Msg": { + "CID": { + "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" + }, + "Version": 42, + "To": "f01234", + "From": "f01234", + "Nonce": 42, + "Value": "0", + "GasLimit": 9, + "GasFeeCap": "0", + "GasPremium": "0", + "Method": 1, + "Params": "Ynl0ZSBhcnJheQ==" + }, + "MsgRct": { + "ExitCode": 0, + "Return": "Ynl0ZSBhcnJheQ==", + "GasUsed": 9, + "EventsRoot": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + } + }, + "GasCost": { + "Message": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "GasUsed": "0", + "BaseFeeBurn": "0", + "OverEstimationBurn": "0", + "MinerPenalty": "0", + "MinerTip": "0", + "Refund": "0", + "TotalCost": "0" + }, + "ExecutionTrace": { + "Msg": { + "CID": { + "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" + }, + "Version": 42, + "To": "f01234", + "From": "f01234", + "Nonce": 42, + "Value": "0", + "GasLimit": 9, + "GasFeeCap": "0", + "GasPremium": "0", + "Method": 1, + "Params": "Ynl0ZSBhcnJheQ==" + }, + "MsgRct": { + "ExitCode": 0, + "Return": "Ynl0ZSBhcnJheQ==", + "GasUsed": 9, + "EventsRoot": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + } + }, + "Error": "string value", + "Duration": 60000000000, + "GasCharges": [ + { + "Name": "string value", + "loc": [ + { + "File": "string value", + "Line": 123, + "Function": "string value" + } + ], + "tg": 9, + "cg": 9, + "sg": 9, + "vtg": 9, + "vcg": 9, + "vsg": 9, + "tt": 60000000000, + "ex": {} + } + ], + "Subcalls": [ + { + "Msg": { + "CID": { + "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" + }, + "Version": 42, + "To": "f01234", + "From": "f01234", + "Nonce": 42, + "Value": "0", + "GasLimit": 9, + "GasFeeCap": "0", + "GasPremium": "0", + "Method": 1, + "Params": "Ynl0ZSBhcnJheQ==" + }, + "MsgRct": { + "ExitCode": 0, + "Return": "Ynl0ZSBhcnJheQ==", + "GasUsed": 9, + "EventsRoot": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + } + }, + "Error": "string value", + "Duration": 60000000000, + "GasCharges": [ + { + "Name": "string value", + "loc": [ + { + "File": "string value", + "Line": 123, + "Function": "string value" + } + ], + "tg": 9, + "cg": 9, + "sg": 9, + "vtg": 9, + "vcg": 9, + "vsg": 9, + "tt": 60000000000, + "ex": {} + } + ], + "Subcalls": null + } + ] + }, + "Error": "string value", + "Duration": 60000000000 + } + ] +} +``` + ### StateGetBeaconEntry StateGetBeaconEntry returns the beacon entry for the given filecoin epoch. If the entry has not yet been produced, the call will block until the entry @@ -2138,6 +2260,21 @@ Response: ] ``` +### EthAddressToFilecoinAddress +EthAddressToFilecoinAddress converts an EthAddress into an f410 Filecoin Address + + +Perms: read + +Inputs: +```json +[ + "0x0707070707070707070707070707070707070707" +] +``` + +Response: `"f01234"` + ### EthBlockNumber EthBlockNumber returns the height of the latest (heaviest) TipSet @@ -2644,6 +2781,21 @@ Inputs: Response: `"0x0707070707070707070707070707070707070707070707070707070707070707"` +### FilecoinAddressToEthAddress +FilecoinAddressToEthAddress converts an f410 or f0 Filecoin Address to an EthAddress + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `"0x0707070707070707070707070707070707070707"` + ### NetListening diff --git a/venus-shared/api/chain/v1/mock/mock_fullnode.go b/venus-shared/api/chain/v1/mock/mock_fullnode.go index 7e5fc1b050..94c25a62fd 100644 --- a/venus-shared/api/chain/v1/mock/mock_fullnode.go +++ b/venus-shared/api/chain/v1/mock/mock_fullnode.go @@ -470,6 +470,21 @@ func (mr *MockFullNodeMockRecorder) EthAccounts(arg0 interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthAccounts", reflect.TypeOf((*MockFullNode)(nil).EthAccounts), arg0) } +// EthAddressToFilecoinAddress mocks base method. +func (m *MockFullNode) EthAddressToFilecoinAddress(arg0 context.Context, arg1 types.EthAddress) (address.Address, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EthAddressToFilecoinAddress", arg0, arg1) + ret0, _ := ret[0].(address.Address) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// EthAddressToFilecoinAddress indicates an expected call of EthAddressToFilecoinAddress. +func (mr *MockFullNodeMockRecorder) EthAddressToFilecoinAddress(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthAddressToFilecoinAddress", reflect.TypeOf((*MockFullNode)(nil).EthAddressToFilecoinAddress), arg0, arg1) +} + // EthBlockNumber mocks base method. func (m *MockFullNode) EthBlockNumber(arg0 context.Context) (types.EthUint64, error) { m.ctrl.T.Helper() @@ -950,6 +965,21 @@ func (mr *MockFullNodeMockRecorder) EthUnsubscribe(arg0, arg1 interface{}) *gomo return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthUnsubscribe", reflect.TypeOf((*MockFullNode)(nil).EthUnsubscribe), arg0, arg1) } +// FilecoinAddressToEthAddress mocks base method. +func (m *MockFullNode) FilecoinAddressToEthAddress(arg0 context.Context, arg1 address.Address) (types.EthAddress, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FilecoinAddressToEthAddress", arg0, arg1) + ret0, _ := ret[0].(types.EthAddress) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// FilecoinAddressToEthAddress indicates an expected call of FilecoinAddressToEthAddress. +func (mr *MockFullNodeMockRecorder) FilecoinAddressToEthAddress(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FilecoinAddressToEthAddress", reflect.TypeOf((*MockFullNode)(nil).FilecoinAddressToEthAddress), arg0, arg1) +} + // GasBatchEstimateMessageGas mocks base method. func (m *MockFullNode) GasBatchEstimateMessageGas(arg0 context.Context, arg1 []*types0.EstimateMessage, arg2 uint64, arg3 types0.TipSetKey) ([]*types0.EstimateResult, error) { m.ctrl.T.Helper() @@ -1143,21 +1173,6 @@ func (mr *MockFullNodeMockRecorder) LockWallet(arg0 interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LockWallet", reflect.TypeOf((*MockFullNode)(nil).LockWallet), arg0) } -// MessageWait mocks base method. -func (m *MockFullNode) MessageWait(arg0 context.Context, arg1 cid.Cid, arg2, arg3 abi.ChainEpoch) (*types0.ChainMessage, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "MessageWait", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(*types0.ChainMessage) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// MessageWait indicates an expected call of MessageWait. -func (mr *MockFullNodeMockRecorder) MessageWait(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MessageWait", reflect.TypeOf((*MockFullNode)(nil).MessageWait), arg0, arg1, arg2, arg3) -} - // MinerCreateBlock mocks base method. func (m *MockFullNode) MinerCreateBlock(arg0 context.Context, arg1 *types0.BlockTemplate) (*types0.BlockMsg, error) { m.ctrl.T.Helper() @@ -2240,6 +2255,21 @@ func (mr *MockFullNodeMockRecorder) StateCirculatingSupply(arg0, arg1 interface{ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateCirculatingSupply", reflect.TypeOf((*MockFullNode)(nil).StateCirculatingSupply), arg0, arg1) } +// StateCompute mocks base method. +func (m *MockFullNode) StateCompute(arg0 context.Context, arg1 abi.ChainEpoch, arg2 []*types.Message, arg3 types0.TipSetKey) (*types0.ComputeStateOutput, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "StateCompute", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(*types0.ComputeStateOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// StateCompute indicates an expected call of StateCompute. +func (mr *MockFullNodeMockRecorder) StateCompute(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateCompute", reflect.TypeOf((*MockFullNode)(nil).StateCompute), arg0, arg1, arg2, arg3) +} + // StateComputeDataCID mocks base method. func (m *MockFullNode) StateComputeDataCID(arg0 context.Context, arg1 address.Address, arg2 abi.RegisteredSealProof, arg3 []abi.DealID, arg4 types0.TipSetKey) (cid.Cid, error) { m.ctrl.T.Helper() diff --git a/venus-shared/api/chain/v1/proxy_gen.go b/venus-shared/api/chain/v1/proxy_gen.go index aa0bc7d7f2..bf320b13fc 100644 --- a/venus-shared/api/chain/v1/proxy_gen.go +++ b/venus-shared/api/chain/v1/proxy_gen.go @@ -282,12 +282,12 @@ type IChainInfoStruct struct { GetEntry func(ctx context.Context, height abi.ChainEpoch, round uint64) (*types.BeaconEntry, error) `perm:"read"` GetFullBlock func(ctx context.Context, id cid.Cid) (*types.FullBlock, error) `perm:"read"` GetParentStateRootActor func(ctx context.Context, ts *types.TipSet, addr address.Address) (*types.Actor, error) `perm:"read"` - MessageWait func(ctx context.Context, msgCid cid.Cid, confidence, lookback abi.ChainEpoch) (*types.ChainMessage, error) `perm:"read"` ProtocolParameters func(ctx context.Context) (*types.ProtocolParams, error) `perm:"read"` ResolveToKeyAddr func(ctx context.Context, addr address.Address, ts *types.TipSet) (address.Address, error) `perm:"read"` StateActorCodeCIDs func(context.Context, network.Version) (map[string]cid.Cid, error) `perm:"read"` StateActorManifestCID func(context.Context, network.Version) (cid.Cid, error) `perm:"read"` StateCall func(ctx context.Context, msg *types.Message, tsk types.TipSetKey) (*types.InvocResult, error) `perm:"read"` + StateCompute func(context.Context, abi.ChainEpoch, []*types.Message, types.TipSetKey) (*types.ComputeStateOutput, error) `perm:"read"` StateGetBeaconEntry func(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) `perm:"read"` StateGetNetworkParams func(ctx context.Context) (*types.NetworkParams, error) `perm:"read"` StateGetRandomnessFromBeacon func(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error) `perm:"read"` @@ -372,9 +372,6 @@ func (s *IChainInfoStruct) GetFullBlock(p0 context.Context, p1 cid.Cid) (*types. func (s *IChainInfoStruct) GetParentStateRootActor(p0 context.Context, p1 *types.TipSet, p2 address.Address) (*types.Actor, error) { return s.Internal.GetParentStateRootActor(p0, p1, p2) } -func (s *IChainInfoStruct) MessageWait(p0 context.Context, p1 cid.Cid, p2, p3 abi.ChainEpoch) (*types.ChainMessage, error) { - return s.Internal.MessageWait(p0, p1, p2, p3) -} func (s *IChainInfoStruct) ProtocolParameters(p0 context.Context) (*types.ProtocolParams, error) { return s.Internal.ProtocolParameters(p0) } @@ -390,6 +387,9 @@ func (s *IChainInfoStruct) StateActorManifestCID(p0 context.Context, p1 network. func (s *IChainInfoStruct) StateCall(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*types.InvocResult, error) { return s.Internal.StateCall(p0, p1, p2) } +func (s *IChainInfoStruct) StateCompute(p0 context.Context, p1 abi.ChainEpoch, p2 []*types.Message, p3 types.TipSetKey) (*types.ComputeStateOutput, error) { + return s.Internal.StateCompute(p0, p1, p2, p3) +} func (s *IChainInfoStruct) StateGetBeaconEntry(p0 context.Context, p1 abi.ChainEpoch) (*types.BeaconEntry, error) { return s.Internal.StateGetBeaconEntry(p0, p1) } @@ -839,6 +839,7 @@ func (s *ICommonStruct) Version(p0 context.Context) (types.Version, error) { type IETHStruct struct { Internal struct { EthAccounts func(ctx context.Context) ([]types.EthAddress, error) `perm:"read"` + EthAddressToFilecoinAddress func(ctx context.Context, ethAddress types.EthAddress) (address.Address, error) `perm:"read"` EthBlockNumber func(ctx context.Context) (types.EthUint64, error) `perm:"read"` EthCall func(ctx context.Context, tx types.EthCall, blkParam string) (types.EthBytes, error) `perm:"read"` EthChainId func(ctx context.Context) (types.EthUint64, error) `perm:"read"` @@ -862,6 +863,7 @@ type IETHStruct struct { EthMaxPriorityFeePerGas func(ctx context.Context) (types.EthBigInt, error) `perm:"read"` EthProtocolVersion func(ctx context.Context) (types.EthUint64, error) `perm:"read"` EthSendRawTransaction func(ctx context.Context, rawTx types.EthBytes) (types.EthHash, error) `perm:"read"` + FilecoinAddressToEthAddress func(ctx context.Context, filecoinAddress address.Address) (types.EthAddress, error) `perm:"read"` NetListening func(ctx context.Context) (bool, error) `perm:"read"` NetVersion func(ctx context.Context) (string, error) `perm:"read"` Web3ClientVersion func(ctx context.Context) (string, error) `perm:"read"` @@ -871,6 +873,9 @@ type IETHStruct struct { func (s *IETHStruct) EthAccounts(p0 context.Context) ([]types.EthAddress, error) { return s.Internal.EthAccounts(p0) } +func (s *IETHStruct) EthAddressToFilecoinAddress(p0 context.Context, p1 types.EthAddress) (address.Address, error) { + return s.Internal.EthAddressToFilecoinAddress(p0, p1) +} func (s *IETHStruct) EthBlockNumber(p0 context.Context) (types.EthUint64, error) { return s.Internal.EthBlockNumber(p0) } @@ -940,6 +945,9 @@ func (s *IETHStruct) EthProtocolVersion(p0 context.Context) (types.EthUint64, er func (s *IETHStruct) EthSendRawTransaction(p0 context.Context, p1 types.EthBytes) (types.EthHash, error) { return s.Internal.EthSendRawTransaction(p0, p1) } +func (s *IETHStruct) FilecoinAddressToEthAddress(p0 context.Context, p1 address.Address) (types.EthAddress, error) { + return s.Internal.FilecoinAddressToEthAddress(p0, p1) +} func (s *IETHStruct) NetListening(p0 context.Context) (bool, error) { return s.Internal.NetListening(p0) } diff --git a/venus-shared/api/market/api.go b/venus-shared/api/market/v0/api.go similarity index 98% rename from venus-shared/api/market/api.go rename to venus-shared/api/market/v0/api.go index 43cd1c40e8..a7770a486b 100644 --- a/venus-shared/api/market/api.go +++ b/venus-shared/api/market/v0/api.go @@ -1,4 +1,4 @@ -package market +package v0 import ( "context" @@ -22,6 +22,8 @@ import ( ) type IMarket interface { + ActorUpsert(context.Context, market.User) (bool, error) //perm:admin + ActorDelete(context.Context, address.Address) error //perm:admin ActorList(context.Context) ([]market.User, error) //perm:read ActorExist(ctx context.Context, addr address.Address) (bool, error) //perm:read ActorSectorSize(context.Context, address.Address) (abi.SectorSize, error) //perm:read diff --git a/venus-shared/api/market/client_gen.go b/venus-shared/api/market/v0/client_gen.go similarity index 97% rename from venus-shared/api/market/client_gen.go rename to venus-shared/api/market/v0/client_gen.go index b60e3bc954..1dfda921c2 100644 --- a/venus-shared/api/market/client_gen.go +++ b/venus-shared/api/market/v0/client_gen.go @@ -1,5 +1,5 @@ // Code generated by github.com/filecoin-project/venus/venus-devtool/api-gen. DO NOT EDIT. -package market +package v0 import ( "context" @@ -12,7 +12,7 @@ import ( ) const MajorVersion = 0 -const APINamespace = "market.IMarket" +const APINamespace = "v0.IMarket" const MethodNamespace = "VENUS_MARKET" // NewIMarketRPC creates a new httpparse jsonrpc remotecli. diff --git a/venus-shared/api/market/method.md b/venus-shared/api/market/v0/method.md similarity index 99% rename from venus-shared/api/market/method.md rename to venus-shared/api/market/v0/method.md index d9f6d1f039..bfb823633b 100644 --- a/venus-shared/api/market/method.md +++ b/venus-shared/api/market/v0/method.md @@ -7,9 +7,11 @@ curl http://:/rpc/v0 -X POST -H "Content-Type: application/json" -H " # Groups * [Market](#market) + * [ActorDelete](#actordelete) * [ActorExist](#actorexist) * [ActorList](#actorlist) * [ActorSectorSize](#actorsectorsize) + * [ActorUpsert](#actorupsert) * [AddFsPieceStorage](#addfspiecestorage) * [AddS3PieceStorage](#adds3piecestorage) * [AssignUnPackedDeals](#assignunpackeddeals) @@ -100,6 +102,20 @@ curl http://:/rpc/v0 -X POST -H "Content-Type: application/json" -H " ## Market +### ActorDelete + + +Perms: admin + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `{}` + ### ActorExist @@ -145,6 +161,23 @@ Inputs: Response: `34359738368` +### ActorUpsert + + +Perms: admin + +Inputs: +```json +[ + { + "Addr": "f01234", + "Account": "string value" + } +] +``` + +Response: `true` + ### AddFsPieceStorage diff --git a/venus-shared/api/market/mock/mock_imarket.go b/venus-shared/api/market/v0/mock/mock_imarket.go similarity index 98% rename from venus-shared/api/market/mock/mock_imarket.go rename to venus-shared/api/market/v0/mock/mock_imarket.go index f058eae5cf..b57c178b36 100644 --- a/venus-shared/api/market/mock/mock_imarket.go +++ b/venus-shared/api/market/v0/mock/mock_imarket.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/filecoin-project/venus/venus-shared/api/market (interfaces: IMarket) +// Source: github.com/filecoin-project/venus/venus-shared/api/market/v0 (interfaces: IMarket) // Package mock is a generated GoMock package. package mock @@ -48,6 +48,20 @@ func (m *MockIMarket) EXPECT() *MockIMarketMockRecorder { return m.recorder } +// ActorDelete mocks base method. +func (m *MockIMarket) ActorDelete(arg0 context.Context, arg1 address.Address) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ActorDelete", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// ActorDelete indicates an expected call of ActorDelete. +func (mr *MockIMarketMockRecorder) ActorDelete(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ActorDelete", reflect.TypeOf((*MockIMarket)(nil).ActorDelete), arg0, arg1) +} + // ActorExist mocks base method. func (m *MockIMarket) ActorExist(arg0 context.Context, arg1 address.Address) (bool, error) { m.ctrl.T.Helper() @@ -93,6 +107,21 @@ func (mr *MockIMarketMockRecorder) ActorSectorSize(arg0, arg1 interface{}) *gomo return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ActorSectorSize", reflect.TypeOf((*MockIMarket)(nil).ActorSectorSize), arg0, arg1) } +// ActorUpsert mocks base method. +func (m *MockIMarket) ActorUpsert(arg0 context.Context, arg1 market.User) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ActorUpsert", arg0, arg1) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ActorUpsert indicates an expected call of ActorUpsert. +func (mr *MockIMarketMockRecorder) ActorUpsert(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ActorUpsert", reflect.TypeOf((*MockIMarket)(nil).ActorUpsert), arg0, arg1) +} + // AddFsPieceStorage mocks base method. func (m *MockIMarket) AddFsPieceStorage(arg0 context.Context, arg1, arg2 string, arg3 bool) error { m.ctrl.T.Helper() diff --git a/venus-shared/api/market/proxy_gen.go b/venus-shared/api/market/v0/proxy_gen.go similarity index 98% rename from venus-shared/api/market/proxy_gen.go rename to venus-shared/api/market/v0/proxy_gen.go index 35bef7fa84..6e178b0eb9 100644 --- a/venus-shared/api/market/proxy_gen.go +++ b/venus-shared/api/market/v0/proxy_gen.go @@ -1,5 +1,5 @@ // Code generated by github.com/filecoin-project/venus/venus-devtool/api-gen. DO NOT EDIT. -package market +package v0 import ( "context" @@ -22,9 +22,11 @@ import ( type IMarketStruct struct { Internal struct { + ActorDelete func(context.Context, address.Address) error `perm:"admin"` ActorExist func(ctx context.Context, addr address.Address) (bool, error) `perm:"read"` ActorList func(context.Context) ([]market.User, error) `perm:"read"` ActorSectorSize func(context.Context, address.Address) (abi.SectorSize, error) `perm:"read"` + ActorUpsert func(context.Context, market.User) (bool, error) `perm:"admin"` AddFsPieceStorage func(ctx context.Context, name string, path string, readonly bool) error `perm:"admin"` AddS3PieceStorage func(ctx context.Context, name, endpoit, bucket, subdir, accessKey, secretKey, token string, readonly bool) error `perm:"admin"` AssignUnPackedDeals func(ctx context.Context, sid abi.SectorID, ssize abi.SectorSize, spec *market.GetDealSpec) ([]*market.DealInfoIncludePath, error) `perm:"write"` @@ -115,6 +117,9 @@ type IMarketStruct struct { } } +func (s *IMarketStruct) ActorDelete(p0 context.Context, p1 address.Address) error { + return s.Internal.ActorDelete(p0, p1) +} func (s *IMarketStruct) ActorExist(p0 context.Context, p1 address.Address) (bool, error) { return s.Internal.ActorExist(p0, p1) } @@ -124,6 +129,9 @@ func (s *IMarketStruct) ActorList(p0 context.Context) ([]market.User, error) { func (s *IMarketStruct) ActorSectorSize(p0 context.Context, p1 address.Address) (abi.SectorSize, error) { return s.Internal.ActorSectorSize(p0, p1) } +func (s *IMarketStruct) ActorUpsert(p0 context.Context, p1 market.User) (bool, error) { + return s.Internal.ActorUpsert(p0, p1) +} func (s *IMarketStruct) AddFsPieceStorage(p0 context.Context, p1 string, p2 string, p3 bool) error { return s.Internal.AddFsPieceStorage(p0, p1, p2, p3) } diff --git a/venus-shared/api/market/v1/api.go b/venus-shared/api/market/v1/api.go new file mode 100644 index 0000000000..8d0ca3fc5e --- /dev/null +++ b/venus-shared/api/market/v1/api.go @@ -0,0 +1,184 @@ +package v1 + +import ( + "context" + "time" + + "github.com/ipfs/go-cid" + "github.com/libp2p/go-libp2p/core/peer" + + "github.com/filecoin-project/go-address" + datatransfer "github.com/filecoin-project/go-data-transfer" + "github.com/filecoin-project/go-fil-markets/piecestore" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" + "github.com/filecoin-project/go-fil-markets/storagemarket" + "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/builtin/v8/paych" + + "github.com/filecoin-project/venus/venus-shared/api" + "github.com/filecoin-project/venus/venus-shared/types" + "github.com/filecoin-project/venus/venus-shared/types/gateway" + "github.com/filecoin-project/venus/venus-shared/types/market" +) + +type IMarket interface { + ActorUpsert(context.Context, market.User) (bool, error) //perm:admin + ActorDelete(context.Context, address.Address) error //perm:admin + ActorList(context.Context) ([]market.User, error) //perm:read + ActorExist(ctx context.Context, addr address.Address) (bool, error) //perm:read + ActorSectorSize(context.Context, address.Address) (abi.SectorSize, error) //perm:read + + MarketImportDealData(ctx context.Context, propcid cid.Cid, path string) error //perm:admin + MarketImportPublishedDeal(ctx context.Context, deal market.MinerDeal) error //perm:write + MarketListDeals(ctx context.Context, addrs []address.Address) ([]*types.MarketDeal, error) //perm:read + MarketListRetrievalDeals(ctx context.Context) ([]market.ProviderDealState, error) //perm:read + MarketGetDealUpdates(ctx context.Context) (<-chan market.MinerDeal, error) //perm:admin + MarketListIncompleteDeals(ctx context.Context, mAddr address.Address) ([]market.MinerDeal, error) //perm:read + MarketSetAsk(ctx context.Context, mAddr address.Address, price types.BigInt, verifiedPrice types.BigInt, duration abi.ChainEpoch, minPieceSize abi.PaddedPieceSize, maxPieceSize abi.PaddedPieceSize) error //perm:admin + MarketGetAsk(ctx context.Context, mAddr address.Address) (*market.SignedStorageAsk, error) //perm:read + MarketListStorageAsk(ctx context.Context) ([]*market.SignedStorageAsk, error) //perm:read + MarketSetRetrievalAsk(ctx context.Context, mAddr address.Address, rask *retrievalmarket.Ask) error //perm:admin + MarketGetRetrievalAsk(ctx context.Context, mAddr address.Address) (*retrievalmarket.Ask, error) //perm:read + MarketListRetrievalAsk(ctx context.Context) ([]*market.RetrievalAsk, error) //perm:read + MarketListDataTransfers(ctx context.Context) ([]market.DataTransferChannel, error) //perm:admin + MarketDataTransferUpdates(ctx context.Context) (<-chan market.DataTransferChannel, error) //perm:admin + // MarketRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer + MarketRestartDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:admin + // MarketCancelDataTransfer cancels a data transfer with the given transfer ID and other peer + MarketCancelDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:admin + MarketPendingDeals(ctx context.Context) ([]market.PendingDealInfo, error) //perm:write + MarketPublishPendingDeals(ctx context.Context) error //perm:admin + + PiecesListPieces(ctx context.Context) ([]cid.Cid, error) //perm:read + PiecesListCidInfos(ctx context.Context) ([]cid.Cid, error) //perm:read + PiecesGetPieceInfo(ctx context.Context, pieceCid cid.Cid) (*piecestore.PieceInfo, error) //perm:read + PiecesGetCIDInfo(ctx context.Context, payloadCid cid.Cid) (*piecestore.CIDInfo, error) //perm:read + + DealsImportData(ctx context.Context, dealPropCid cid.Cid, file string) error //perm:admin + OfflineDealImport(ctx context.Context, deal market.MinerDeal) error //perm:admin + + DealsConsiderOnlineStorageDeals(context.Context, address.Address) (bool, error) //perm:read + DealsSetConsiderOnlineStorageDeals(context.Context, address.Address, bool) error //perm:write + DealsConsiderOnlineRetrievalDeals(context.Context, address.Address) (bool, error) //perm:read + DealsSetConsiderOnlineRetrievalDeals(context.Context, address.Address, bool) error //perm:write + DealsPieceCidBlocklist(context.Context, address.Address) ([]cid.Cid, error) //perm:read + DealsSetPieceCidBlocklist(context.Context, address.Address, []cid.Cid) error //perm:write + DealsConsiderOfflineStorageDeals(context.Context, address.Address) (bool, error) //perm:read + DealsSetConsiderOfflineStorageDeals(context.Context, address.Address, bool) error //perm:write + DealsConsiderOfflineRetrievalDeals(context.Context, address.Address) (bool, error) //perm:read + DealsSetConsiderOfflineRetrievalDeals(context.Context, address.Address, bool) error //perm:write + DealsConsiderVerifiedStorageDeals(context.Context, address.Address) (bool, error) //perm:read + DealsSetConsiderVerifiedStorageDeals(context.Context, address.Address, bool) error //perm:write + DealsConsiderUnverifiedStorageDeals(context.Context, address.Address) (bool, error) //perm:read + DealsSetConsiderUnverifiedStorageDeals(context.Context, address.Address, bool) error //perm:write + // SectorGetExpectedSealDuration gets the time that a newly-created sector + // waits for more deals before it starts sealing + SectorGetExpectedSealDuration(context.Context, address.Address) (time.Duration, error) //perm:read + // SectorSetExpectedSealDuration sets the expected time for a sector to seal + SectorSetExpectedSealDuration(context.Context, address.Address, time.Duration) error //perm:write + DealsMaxStartDelay(context.Context, address.Address) (time.Duration, error) //perm:read + DealsSetMaxStartDelay(context.Context, address.Address, time.Duration) error //perm:write + MarketDataTransferPath(context.Context, address.Address) (string, error) //perm:admin + MarketSetDataTransferPath(context.Context, address.Address, string) error //perm:admin + DealsPublishMsgPeriod(context.Context, address.Address) (time.Duration, error) //perm:read + DealsSetPublishMsgPeriod(context.Context, address.Address, time.Duration) error //perm:write + MarketMaxDealsPerPublishMsg(context.Context, address.Address) (uint64, error) //perm:read + MarketSetMaxDealsPerPublishMsg(context.Context, address.Address, uint64) error //perm:write + DealsMaxProviderCollateralMultiplier(context.Context, address.Address) (uint64, error) //perm:read + DealsSetMaxProviderCollateralMultiplier(context.Context, address.Address, uint64) error //perm:write + DealsMaxPublishFee(context.Context, address.Address) (types.FIL, error) //perm:read + DealsSetMaxPublishFee(context.Context, address.Address, types.FIL) error //perm:write + MarketMaxBalanceAddFee(context.Context, address.Address) (types.FIL, error) //perm:read + MarketSetMaxBalanceAddFee(context.Context, address.Address, types.FIL) error //perm:write + + // messager + MessagerWaitMessage(ctx context.Context, mid cid.Cid) (*types.MsgLookup, error) //perm:read + MessagerPushMessage(ctx context.Context, msg *types.Message, meta *types.MessageSendSpec) (cid.Cid, error) //perm:write + MessagerGetMessage(ctx context.Context, mid cid.Cid) (*types.Message, error) //perm:read + + MarketAddBalance(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error) //perm:sign + MarketGetReserved(ctx context.Context, addr address.Address) (types.BigInt, error) //perm:sign + MarketReserveFunds(ctx context.Context, wallet address.Address, addr address.Address, amt types.BigInt) (cid.Cid, error) //perm:sign + MarketReleaseFunds(ctx context.Context, addr address.Address, amt types.BigInt) error //perm:sign + MarketWithdraw(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error) //perm:sign + + NetAddrsListen(context.Context) (peer.AddrInfo, error) //perm:read + ID(context.Context) (peer.ID, error) //perm:read + + // DagstoreListShards returns information about all shards known to the + // DAG store. Only available on nodes running the markets subsystem. + DagstoreListShards(ctx context.Context) ([]market.DagstoreShardInfo, error) //perm:admin + + // DagstoreInitializeShard initializes an uninitialized shard. + // + // Initialization consists of fetching the shard's data (deal payload) from + // the storage subsystem, generating an index, and persisting the index + // to facilitate later retrievals, and/or to publish to external sources. + // + // This operation is intended to complement the initial migration. The + // migration registers a shard for every unique piece CID, with lazy + // initialization. Thus, shards are not initialized immediately to avoid + // IO activity competing with proving. Instead, shard are initialized + // when first accessed. This method forces the initialization of a shard by + // accessing it and immediately releasing it. This is useful to warm up the + // cache to facilitate subsequent retrievals, and to generate the indexes + // to publish them externally. + // + // This operation fails if the shard is not in ShardStateNew state. + // It blocks until initialization finishes. + DagstoreInitializeShard(ctx context.Context, key string) error //perm:admin + + // DagstoreRecoverShard attempts to recover a failed shard. + // + // This operation fails if the shard is not in ShardStateErrored state. + // It blocks until recovery finishes. If recovery failed, it returns the + // error. + DagstoreRecoverShard(ctx context.Context, key string) error //perm:admin + + // DagstoreInitializeAll initializes all uninitialized shards in bulk, + // according to the policy passed in the parameters. + // + // It is recommended to set a maximum concurrency to avoid extreme + // IO pressure if the storage subsystem has a large amount of deals. + // + // It returns a stream of events to report progress. + DagstoreInitializeAll(ctx context.Context, params market.DagstoreInitializeAllParams) (<-chan market.DagstoreInitializeAllEvent, error) //perm:admin + + // DagstoreInitializeStorage initializes all pieces in specify storage + DagstoreInitializeStorage(context.Context, string, market.DagstoreInitializeAllParams) (<-chan market.DagstoreInitializeAllEvent, error) //perm:admin + + // DagstoreGC runs garbage collection on the DAG store. + DagstoreGC(ctx context.Context) ([]market.DagstoreShardResult, error) //perm:admin + + MarkDealsAsPacking(ctx context.Context, miner address.Address, deals []abi.DealID) error //perm:write + UpdateDealOnPacking(ctx context.Context, miner address.Address, dealID abi.DealID, sectorid abi.SectorNumber, offset abi.PaddedPieceSize) error //perm:write + UpdateDealStatus(ctx context.Context, miner address.Address, dealID abi.DealID, pieceStatus market.PieceStatus, dealStatus storagemarket.StorageDealStatus) error //perm:write + GetDeals(ctx context.Context, miner address.Address, pageIndex, pageSize int) ([]*market.DealInfo, error) //perm:read + AssignUnPackedDeals(ctx context.Context, sid abi.SectorID, ssize abi.SectorSize, spec *market.GetDealSpec) ([]*market.DealInfoIncludePath, error) //perm:write + GetUnPackedDeals(ctx context.Context, miner address.Address, spec *market.GetDealSpec) ([]*market.DealInfoIncludePath, error) //perm:read + UpdateStorageDealStatus(ctx context.Context, dealProposalCid cid.Cid, state storagemarket.StorageDealStatus, pieceState market.PieceStatus) error //perm:write + // market event + ResponseMarketEvent(ctx context.Context, resp *gateway.ResponseEvent) error //perm:read + ListenMarketEvent(ctx context.Context, policy *gateway.MarketRegisterPolicy) (<-chan *gateway.RequestEvent, error) //perm:read + + // Paych + PaychVoucherList(ctx context.Context, pch address.Address) ([]*paych.SignedVoucher, error) //perm:read + + AddFsPieceStorage(ctx context.Context, name string, path string, readonly bool) error //perm:admin + + AddS3PieceStorage(ctx context.Context, name, endpoit, bucket, subdir, accessKey, secretKey, token string, readonly bool) error //perm:admin + + RemovePieceStorage(ctx context.Context, name string) error //perm:admin + + ListPieceStorageInfos(ctx context.Context) market.PieceStorageInfos //perm:read + + // GetStorageDealStatistic get storage deal statistic information + // if set miner address to address.Undef, return all storage deal info + GetStorageDealStatistic(ctx context.Context, miner address.Address) (*market.StorageDealStatistic, error) //perm:read + + // GetRetrievalDealStatistic get retrieval deal statistic information + // todo address undefined is invalid, it is currently not possible to directly associate an order with a miner + GetRetrievalDealStatistic(ctx context.Context, miner address.Address) (*market.RetrievalDealStatistic, error) //perm:read + + api.Version +} diff --git a/venus-shared/api/market/v1/client_gen.go b/venus-shared/api/market/v1/client_gen.go new file mode 100644 index 0000000000..a6c8bee1c6 --- /dev/null +++ b/venus-shared/api/market/v1/client_gen.go @@ -0,0 +1,54 @@ +// Code generated by github.com/filecoin-project/venus/venus-devtool/api-gen. DO NOT EDIT. +package v1 + +import ( + "context" + "fmt" + "net/http" + + "github.com/filecoin-project/go-jsonrpc" + + "github.com/filecoin-project/venus/venus-shared/api" +) + +const MajorVersion = 1 +const APINamespace = "v1.IMarket" +const MethodNamespace = "VENUS_MARKET" + +// NewIMarketRPC creates a new httpparse jsonrpc remotecli. +func NewIMarketRPC(ctx context.Context, addr string, requestHeader http.Header, opts ...jsonrpc.Option) (IMarket, jsonrpc.ClientCloser, error) { + endpoint, err := api.Endpoint(addr, MajorVersion) + if err != nil { + return nil, nil, fmt.Errorf("invalid addr %s: %w", addr, err) + } + + if requestHeader == nil { + requestHeader = http.Header{} + } + requestHeader.Set(api.VenusAPINamespaceHeader, APINamespace) + + var res IMarketStruct + closer, err := jsonrpc.NewMergeClient(ctx, endpoint, MethodNamespace, api.GetInternalStructs(&res), requestHeader, opts...) + + return &res, closer, err +} + +// DialIMarketRPC is a more convinient way of building client, as it resolves any format (url, multiaddr) of addr string. +func DialIMarketRPC(ctx context.Context, addr string, token string, requestHeader http.Header, opts ...jsonrpc.Option) (IMarket, jsonrpc.ClientCloser, error) { + ainfo := api.NewAPIInfo(addr, token) + endpoint, err := ainfo.DialArgs(api.VerString(MajorVersion)) + if err != nil { + return nil, nil, fmt.Errorf("get dial args: %w", err) + } + + if requestHeader == nil { + requestHeader = http.Header{} + } + requestHeader.Set(api.VenusAPINamespaceHeader, APINamespace) + ainfo.SetAuthHeader(requestHeader) + + var res IMarketStruct + closer, err := jsonrpc.NewMergeClient(ctx, endpoint, MethodNamespace, api.GetInternalStructs(&res), requestHeader, opts...) + + return &res, closer, err +} diff --git a/venus-shared/api/market/v1/method.md b/venus-shared/api/market/v1/method.md new file mode 100644 index 0000000000..9e5c0619bc --- /dev/null +++ b/venus-shared/api/market/v1/method.md @@ -0,0 +1,2326 @@ +# Sample code of curl + +```bash +# corresponding to the value of Inputs Tag of each API +curl http://:/rpc/v1 -X POST -H "Content-Type: application/json" -H "Authorization: Bearer " -d '{"method": "VENUS_MARKET.", "params": , "id": 0}' +``` +# Groups + +* [Market](#market) + * [ActorDelete](#actordelete) + * [ActorExist](#actorexist) + * [ActorList](#actorlist) + * [ActorSectorSize](#actorsectorsize) + * [ActorUpsert](#actorupsert) + * [AddFsPieceStorage](#addfspiecestorage) + * [AddS3PieceStorage](#adds3piecestorage) + * [AssignUnPackedDeals](#assignunpackeddeals) + * [DagstoreGC](#dagstoregc) + * [DagstoreInitializeAll](#dagstoreinitializeall) + * [DagstoreInitializeShard](#dagstoreinitializeshard) + * [DagstoreInitializeStorage](#dagstoreinitializestorage) + * [DagstoreListShards](#dagstorelistshards) + * [DagstoreRecoverShard](#dagstorerecovershard) + * [DealsConsiderOfflineRetrievalDeals](#dealsconsiderofflineretrievaldeals) + * [DealsConsiderOfflineStorageDeals](#dealsconsiderofflinestoragedeals) + * [DealsConsiderOnlineRetrievalDeals](#dealsconsideronlineretrievaldeals) + * [DealsConsiderOnlineStorageDeals](#dealsconsideronlinestoragedeals) + * [DealsConsiderUnverifiedStorageDeals](#dealsconsiderunverifiedstoragedeals) + * [DealsConsiderVerifiedStorageDeals](#dealsconsiderverifiedstoragedeals) + * [DealsImportData](#dealsimportdata) + * [DealsMaxProviderCollateralMultiplier](#dealsmaxprovidercollateralmultiplier) + * [DealsMaxPublishFee](#dealsmaxpublishfee) + * [DealsMaxStartDelay](#dealsmaxstartdelay) + * [DealsPieceCidBlocklist](#dealspiececidblocklist) + * [DealsPublishMsgPeriod](#dealspublishmsgperiod) + * [DealsSetConsiderOfflineRetrievalDeals](#dealssetconsiderofflineretrievaldeals) + * [DealsSetConsiderOfflineStorageDeals](#dealssetconsiderofflinestoragedeals) + * [DealsSetConsiderOnlineRetrievalDeals](#dealssetconsideronlineretrievaldeals) + * [DealsSetConsiderOnlineStorageDeals](#dealssetconsideronlinestoragedeals) + * [DealsSetConsiderUnverifiedStorageDeals](#dealssetconsiderunverifiedstoragedeals) + * [DealsSetConsiderVerifiedStorageDeals](#dealssetconsiderverifiedstoragedeals) + * [DealsSetMaxProviderCollateralMultiplier](#dealssetmaxprovidercollateralmultiplier) + * [DealsSetMaxPublishFee](#dealssetmaxpublishfee) + * [DealsSetMaxStartDelay](#dealssetmaxstartdelay) + * [DealsSetPieceCidBlocklist](#dealssetpiececidblocklist) + * [DealsSetPublishMsgPeriod](#dealssetpublishmsgperiod) + * [GetDeals](#getdeals) + * [GetRetrievalDealStatistic](#getretrievaldealstatistic) + * [GetStorageDealStatistic](#getstoragedealstatistic) + * [GetUnPackedDeals](#getunpackeddeals) + * [ID](#id) + * [ListPieceStorageInfos](#listpiecestorageinfos) + * [ListenMarketEvent](#listenmarketevent) + * [MarkDealsAsPacking](#markdealsaspacking) + * [MarketAddBalance](#marketaddbalance) + * [MarketCancelDataTransfer](#marketcanceldatatransfer) + * [MarketDataTransferPath](#marketdatatransferpath) + * [MarketDataTransferUpdates](#marketdatatransferupdates) + * [MarketGetAsk](#marketgetask) + * [MarketGetDealUpdates](#marketgetdealupdates) + * [MarketGetReserved](#marketgetreserved) + * [MarketGetRetrievalAsk](#marketgetretrievalask) + * [MarketImportDealData](#marketimportdealdata) + * [MarketImportPublishedDeal](#marketimportpublisheddeal) + * [MarketListDataTransfers](#marketlistdatatransfers) + * [MarketListDeals](#marketlistdeals) + * [MarketListIncompleteDeals](#marketlistincompletedeals) + * [MarketListRetrievalAsk](#marketlistretrievalask) + * [MarketListRetrievalDeals](#marketlistretrievaldeals) + * [MarketListStorageAsk](#marketliststorageask) + * [MarketMaxBalanceAddFee](#marketmaxbalanceaddfee) + * [MarketMaxDealsPerPublishMsg](#marketmaxdealsperpublishmsg) + * [MarketPendingDeals](#marketpendingdeals) + * [MarketPublishPendingDeals](#marketpublishpendingdeals) + * [MarketReleaseFunds](#marketreleasefunds) + * [MarketReserveFunds](#marketreservefunds) + * [MarketRestartDataTransfer](#marketrestartdatatransfer) + * [MarketSetAsk](#marketsetask) + * [MarketSetDataTransferPath](#marketsetdatatransferpath) + * [MarketSetMaxBalanceAddFee](#marketsetmaxbalanceaddfee) + * [MarketSetMaxDealsPerPublishMsg](#marketsetmaxdealsperpublishmsg) + * [MarketSetRetrievalAsk](#marketsetretrievalask) + * [MarketWithdraw](#marketwithdraw) + * [MessagerGetMessage](#messagergetmessage) + * [MessagerPushMessage](#messagerpushmessage) + * [MessagerWaitMessage](#messagerwaitmessage) + * [NetAddrsListen](#netaddrslisten) + * [OfflineDealImport](#offlinedealimport) + * [PaychVoucherList](#paychvoucherlist) + * [PiecesGetCIDInfo](#piecesgetcidinfo) + * [PiecesGetPieceInfo](#piecesgetpieceinfo) + * [PiecesListCidInfos](#pieceslistcidinfos) + * [PiecesListPieces](#pieceslistpieces) + * [RemovePieceStorage](#removepiecestorage) + * [ResponseMarketEvent](#responsemarketevent) + * [SectorGetExpectedSealDuration](#sectorgetexpectedsealduration) + * [SectorSetExpectedSealDuration](#sectorsetexpectedsealduration) + * [UpdateDealOnPacking](#updatedealonpacking) + * [UpdateDealStatus](#updatedealstatus) + * [UpdateStorageDealStatus](#updatestoragedealstatus) + * [Version](#version) + +## Market + +### ActorDelete + + +Perms: admin + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `{}` + +### ActorExist + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `true` + +### ActorList + + +Perms: read + +Inputs: `[]` + +Response: +```json +[ + { + "Addr": "f01234", + "Account": "string value" + } +] +``` + +### ActorSectorSize + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `34359738368` + +### ActorUpsert + + +Perms: admin + +Inputs: +```json +[ + { + "Addr": "f01234", + "Account": "string value" + } +] +``` + +Response: `true` + +### AddFsPieceStorage + + +Perms: admin + +Inputs: +```json +[ + "string value", + "string value", + true +] +``` + +Response: `{}` + +### AddS3PieceStorage + + +Perms: admin + +Inputs: +```json +[ + "string value", + "string value", + "string value", + "string value", + "string value", + "string value", + "string value", + true +] +``` + +Response: `{}` + +### AssignUnPackedDeals + + +Perms: write + +Inputs: +```json +[ + { + "Miner": 1000, + "Number": 9 + }, + 34359738368, + { + "MaxPiece": 123, + "MaxPieceSize": 42, + "MinPiece": 123, + "MinPieceSize": 42, + "MinUsedSpace": 42, + "StartEpoch": 10101, + "EndEpoch": 10101 + } +] +``` + +Response: +```json +[ + { + "PieceCID": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceSize": 1032, + "VerifiedDeal": true, + "Client": "f01234", + "Provider": "f01234", + "Label": "", + "StartEpoch": 10101, + "EndEpoch": 10101, + "StoragePricePerEpoch": "0", + "ProviderCollateral": "0", + "ClientCollateral": "0", + "Offset": 1032, + "Length": 1032, + "PayloadSize": 42, + "DealID": 5432, + "TotalStorageFee": "0", + "FastRetrieval": true, + "PublishCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + } + } +] +``` + +### DagstoreGC +DagstoreGC runs garbage collection on the DAG store. + + +Perms: admin + +Inputs: `[]` + +Response: +```json +[ + { + "Key": "string value", + "Success": true, + "Error": "string value" + } +] +``` + +### DagstoreInitializeAll +DagstoreInitializeAll initializes all uninitialized shards in bulk, +according to the policy passed in the parameters. + +It is recommended to set a maximum concurrency to avoid extreme +IO pressure if the storage subsystem has a large amount of deals. + +It returns a stream of events to report progress. + + +Perms: admin + +Inputs: +```json +[ + { + "MaxConcurrency": 123, + "IncludeSealed": true + } +] +``` + +Response: +```json +{ + "Key": "string value", + "Event": "string value", + "Success": true, + "Error": "string value", + "Total": 123, + "Current": 123 +} +``` + +### DagstoreInitializeShard +DagstoreInitializeShard initializes an uninitialized shard. + +Initialization consists of fetching the shard's data (deal payload) from +the storage subsystem, generating an index, and persisting the index +to facilitate later retrievals, and/or to publish to external sources. + +This operation is intended to complement the initial migration. The +migration registers a shard for every unique piece CID, with lazy +initialization. Thus, shards are not initialized immediately to avoid +IO activity competing with proving. Instead, shard are initialized +when first accessed. This method forces the initialization of a shard by +accessing it and immediately releasing it. This is useful to warm up the +cache to facilitate subsequent retrievals, and to generate the indexes +to publish them externally. + +This operation fails if the shard is not in ShardStateNew state. +It blocks until initialization finishes. + + +Perms: admin + +Inputs: +```json +[ + "string value" +] +``` + +Response: `{}` + +### DagstoreInitializeStorage +DagstoreInitializeStorage initializes all pieces in specify storage + + +Perms: admin + +Inputs: +```json +[ + "string value", + { + "MaxConcurrency": 123, + "IncludeSealed": true + } +] +``` + +Response: +```json +{ + "Key": "string value", + "Event": "string value", + "Success": true, + "Error": "string value", + "Total": 123, + "Current": 123 +} +``` + +### DagstoreListShards +DagstoreListShards returns information about all shards known to the +DAG store. Only available on nodes running the markets subsystem. + + +Perms: admin + +Inputs: `[]` + +Response: +```json +[ + { + "Key": "string value", + "State": "string value", + "Error": "string value" + } +] +``` + +### DagstoreRecoverShard +DagstoreRecoverShard attempts to recover a failed shard. + +This operation fails if the shard is not in ShardStateErrored state. +It blocks until recovery finishes. If recovery failed, it returns the +error. + + +Perms: admin + +Inputs: +```json +[ + "string value" +] +``` + +Response: `{}` + +### DealsConsiderOfflineRetrievalDeals + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `true` + +### DealsConsiderOfflineStorageDeals + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `true` + +### DealsConsiderOnlineRetrievalDeals + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `true` + +### DealsConsiderOnlineStorageDeals + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `true` + +### DealsConsiderUnverifiedStorageDeals + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `true` + +### DealsConsiderVerifiedStorageDeals + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `true` + +### DealsImportData + + +Perms: admin + +Inputs: +```json +[ + { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "string value" +] +``` + +Response: `{}` + +### DealsMaxProviderCollateralMultiplier + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `42` + +### DealsMaxPublishFee + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `"0 FIL"` + +### DealsMaxStartDelay + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `60000000000` + +### DealsPieceCidBlocklist + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: +```json +[ + { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + } +] +``` + +### DealsPublishMsgPeriod + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `60000000000` + +### DealsSetConsiderOfflineRetrievalDeals + + +Perms: write + +Inputs: +```json +[ + "f01234", + true +] +``` + +Response: `{}` + +### DealsSetConsiderOfflineStorageDeals + + +Perms: write + +Inputs: +```json +[ + "f01234", + true +] +``` + +Response: `{}` + +### DealsSetConsiderOnlineRetrievalDeals + + +Perms: write + +Inputs: +```json +[ + "f01234", + true +] +``` + +Response: `{}` + +### DealsSetConsiderOnlineStorageDeals + + +Perms: write + +Inputs: +```json +[ + "f01234", + true +] +``` + +Response: `{}` + +### DealsSetConsiderUnverifiedStorageDeals + + +Perms: write + +Inputs: +```json +[ + "f01234", + true +] +``` + +Response: `{}` + +### DealsSetConsiderVerifiedStorageDeals + + +Perms: write + +Inputs: +```json +[ + "f01234", + true +] +``` + +Response: `{}` + +### DealsSetMaxProviderCollateralMultiplier + + +Perms: write + +Inputs: +```json +[ + "f01234", + 42 +] +``` + +Response: `{}` + +### DealsSetMaxPublishFee + + +Perms: write + +Inputs: +```json +[ + "f01234", + "0 FIL" +] +``` + +Response: `{}` + +### DealsSetMaxStartDelay + + +Perms: write + +Inputs: +```json +[ + "f01234", + 60000000000 +] +``` + +Response: `{}` + +### DealsSetPieceCidBlocklist + + +Perms: write + +Inputs: +```json +[ + "f01234", + [ + { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + } + ] +] +``` + +Response: `{}` + +### DealsSetPublishMsgPeriod + + +Perms: write + +Inputs: +```json +[ + "f01234", + 60000000000 +] +``` + +Response: `{}` + +### GetDeals + + +Perms: read + +Inputs: +```json +[ + "f01234", + 123, + 123 +] +``` + +Response: +```json +[ + { + "DealID": 5432, + "SectorID": 9, + "Offset": 1032, + "Length": 1032, + "Proposal": { + "PieceCID": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceSize": 1032, + "VerifiedDeal": true, + "Client": "f01234", + "Provider": "f01234", + "Label": "", + "StartEpoch": 10101, + "EndEpoch": 10101, + "StoragePricePerEpoch": "0", + "ProviderCollateral": "0", + "ClientCollateral": "0" + }, + "ClientSignature": { + "Type": 2, + "Data": "Ynl0ZSBhcnJheQ==" + }, + "TransferType": "string value", + "Root": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PublishCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "FastRetrieval": true, + "Status": "Undefine" + } +] +``` + +### GetRetrievalDealStatistic +GetRetrievalDealStatistic get retrieval deal statistic information +todo address undefined is invalid, it is currently not possible to directly associate an order with a miner + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: +```json +{ + "DealsStatus": { + "0": 9 + } +} +``` + +### GetStorageDealStatistic +GetStorageDealStatistic get storage deal statistic information +if set miner address to address.Undef, return all storage deal info + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: +```json +{ + "DealsStatus": { + "42": 9 + } +} +``` + +### GetUnPackedDeals + + +Perms: read + +Inputs: +```json +[ + "f01234", + { + "MaxPiece": 123, + "MaxPieceSize": 42, + "MinPiece": 123, + "MinPieceSize": 42, + "MinUsedSpace": 42, + "StartEpoch": 10101, + "EndEpoch": 10101 + } +] +``` + +Response: +```json +[ + { + "PieceCID": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceSize": 1032, + "VerifiedDeal": true, + "Client": "f01234", + "Provider": "f01234", + "Label": "", + "StartEpoch": 10101, + "EndEpoch": 10101, + "StoragePricePerEpoch": "0", + "ProviderCollateral": "0", + "ClientCollateral": "0", + "Offset": 1032, + "Length": 1032, + "PayloadSize": 42, + "DealID": 5432, + "TotalStorageFee": "0", + "FastRetrieval": true, + "PublishCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + } + } +] +``` + +### ID + + +Perms: read + +Inputs: `[]` + +Response: `"12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"` + +### ListPieceStorageInfos + + +Perms: read + +Inputs: `[]` + +Response: +```json +{ + "FsStorage": [ + { + "Path": "string value", + "Name": "string value", + "ReadOnly": true, + "Status": { + "Capacity": 9, + "Available": 9, + "Reserved": 9 + } + } + ], + "S3Storage": [ + { + "Name": "string value", + "ReadOnly": true, + "EndPoint": "string value", + "Bucket": "string value", + "SubDir": "string value", + "Status": { + "Capacity": 9, + "Available": 9, + "Reserved": 9 + } + } + ] +} +``` + +### ListenMarketEvent + + +Perms: read + +Inputs: +```json +[ + { + "Miner": "f01234" + } +] +``` + +Response: +```json +{ + "Id": "e26f1e5c-47f7-4561-a11d-18fab6e748af", + "Method": "string value", + "Payload": "Ynl0ZSBhcnJheQ==" +} +``` + +### MarkDealsAsPacking + + +Perms: write + +Inputs: +```json +[ + "f01234", + [ + 5432 + ] +] +``` + +Response: `{}` + +### MarketAddBalance + + +Perms: sign + +Inputs: +```json +[ + "f01234", + "f01234", + "0" +] +``` + +Response: +```json +{ + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" +} +``` + +### MarketCancelDataTransfer +MarketCancelDataTransfer cancels a data transfer with the given transfer ID and other peer + + +Perms: admin + +Inputs: +```json +[ + 3, + "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + true +] +``` + +Response: `{}` + +### MarketDataTransferPath + + +Perms: admin + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `"string value"` + +### MarketDataTransferUpdates + + +Perms: admin + +Inputs: `[]` + +Response: +```json +{ + "TransferID": 3, + "Status": 1, + "BaseCID": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "IsInitiator": true, + "IsSender": true, + "Voucher": "string value", + "Message": "string value", + "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "Transferred": 42, + "Stages": { + "Stages": [ + { + "Name": "string value", + "Description": "string value", + "CreatedTime": "0001-01-01T00:00:00Z", + "UpdatedTime": "0001-01-01T00:00:00Z", + "Logs": [ + { + "Log": "string value", + "UpdatedTime": "0001-01-01T00:00:00Z" + } + ] + } + ] + } +} +``` + +### MarketGetAsk + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: +```json +{ + "Ask": { + "Price": "0", + "VerifiedPrice": "0", + "MinPieceSize": 1032, + "MaxPieceSize": 1032, + "Miner": "f01234", + "Timestamp": 10101, + "Expiry": 10101, + "SeqNo": 42 + }, + "Signature": { + "Type": 2, + "Data": "Ynl0ZSBhcnJheQ==" + }, + "CreatedAt": 42, + "UpdatedAt": 42 +} +``` + +### MarketGetDealUpdates + + +Perms: admin + +Inputs: `[]` + +Response: +```json +{ + "Proposal": { + "PieceCID": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceSize": 1032, + "VerifiedDeal": true, + "Client": "f01234", + "Provider": "f01234", + "Label": "", + "StartEpoch": 10101, + "EndEpoch": 10101, + "StoragePricePerEpoch": "0", + "ProviderCollateral": "0", + "ClientCollateral": "0" + }, + "ClientSignature": { + "Type": 2, + "Data": "Ynl0ZSBhcnJheQ==" + }, + "ProposalCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "AddFundsCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PublishCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "Miner": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "Client": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "State": 42, + "PiecePath": "/some/path", + "PayloadSize": 42, + "MetadataPath": "/some/path", + "SlashEpoch": 10101, + "FastRetrieval": true, + "Message": "string value", + "FundsReserved": "0", + "Ref": { + "TransferType": "string value", + "Root": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceSize": 1024, + "RawBlockSize": 42 + }, + "AvailableForRetrieval": true, + "DealID": 5432, + "CreationTime": "0001-01-01T00:00:00Z", + "TransferChannelId": { + "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "ID": 3 + }, + "SectorNumber": 9, + "Offset": 1032, + "PieceStatus": "Undefine", + "InboundCAR": "string value", + "CreatedAt": 42, + "UpdatedAt": 42 +} +``` + +### MarketGetReserved + + +Perms: sign + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `"0"` + +### MarketGetRetrievalAsk + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: +```json +{ + "PricePerByte": "0", + "UnsealPrice": "0", + "PaymentInterval": 42, + "PaymentIntervalIncrease": 42 +} +``` + +### MarketImportDealData + + +Perms: admin + +Inputs: +```json +[ + { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "string value" +] +``` + +Response: `{}` + +### MarketImportPublishedDeal + + +Perms: write + +Inputs: +```json +[ + { + "Proposal": { + "PieceCID": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceSize": 1032, + "VerifiedDeal": true, + "Client": "f01234", + "Provider": "f01234", + "Label": "", + "StartEpoch": 10101, + "EndEpoch": 10101, + "StoragePricePerEpoch": "0", + "ProviderCollateral": "0", + "ClientCollateral": "0" + }, + "ClientSignature": { + "Type": 2, + "Data": "Ynl0ZSBhcnJheQ==" + }, + "ProposalCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "AddFundsCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PublishCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "Miner": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "Client": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "State": 42, + "PiecePath": "/some/path", + "PayloadSize": 42, + "MetadataPath": "/some/path", + "SlashEpoch": 10101, + "FastRetrieval": true, + "Message": "string value", + "FundsReserved": "0", + "Ref": { + "TransferType": "string value", + "Root": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceSize": 1024, + "RawBlockSize": 42 + }, + "AvailableForRetrieval": true, + "DealID": 5432, + "CreationTime": "0001-01-01T00:00:00Z", + "TransferChannelId": { + "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "ID": 3 + }, + "SectorNumber": 9, + "Offset": 1032, + "PieceStatus": "Undefine", + "InboundCAR": "string value", + "CreatedAt": 42, + "UpdatedAt": 42 + } +] +``` + +Response: `{}` + +### MarketListDataTransfers + + +Perms: admin + +Inputs: `[]` + +Response: +```json +[ + { + "TransferID": 3, + "Status": 1, + "BaseCID": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "IsInitiator": true, + "IsSender": true, + "Voucher": "string value", + "Message": "string value", + "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "Transferred": 42, + "Stages": { + "Stages": [ + { + "Name": "string value", + "Description": "string value", + "CreatedTime": "0001-01-01T00:00:00Z", + "UpdatedTime": "0001-01-01T00:00:00Z", + "Logs": [ + { + "Log": "string value", + "UpdatedTime": "0001-01-01T00:00:00Z" + } + ] + } + ] + } + } +] +``` + +### MarketListDeals + + +Perms: read + +Inputs: +```json +[ + [ + "f01234" + ] +] +``` + +Response: +```json +[ + { + "Proposal": { + "PieceCID": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceSize": 1032, + "VerifiedDeal": true, + "Client": "f01234", + "Provider": "f01234", + "Label": "", + "StartEpoch": 10101, + "EndEpoch": 10101, + "StoragePricePerEpoch": "0", + "ProviderCollateral": "0", + "ClientCollateral": "0" + }, + "State": { + "SectorStartEpoch": 10101, + "LastUpdatedEpoch": 10101, + "SlashEpoch": 10101, + "VerifiedClaim": 0 + } + } +] +``` + +### MarketListIncompleteDeals + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: +```json +[ + { + "Proposal": { + "PieceCID": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceSize": 1032, + "VerifiedDeal": true, + "Client": "f01234", + "Provider": "f01234", + "Label": "", + "StartEpoch": 10101, + "EndEpoch": 10101, + "StoragePricePerEpoch": "0", + "ProviderCollateral": "0", + "ClientCollateral": "0" + }, + "ClientSignature": { + "Type": 2, + "Data": "Ynl0ZSBhcnJheQ==" + }, + "ProposalCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "AddFundsCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PublishCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "Miner": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "Client": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "State": 42, + "PiecePath": "/some/path", + "PayloadSize": 42, + "MetadataPath": "/some/path", + "SlashEpoch": 10101, + "FastRetrieval": true, + "Message": "string value", + "FundsReserved": "0", + "Ref": { + "TransferType": "string value", + "Root": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceSize": 1024, + "RawBlockSize": 42 + }, + "AvailableForRetrieval": true, + "DealID": 5432, + "CreationTime": "0001-01-01T00:00:00Z", + "TransferChannelId": { + "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "ID": 3 + }, + "SectorNumber": 9, + "Offset": 1032, + "PieceStatus": "Undefine", + "InboundCAR": "string value", + "CreatedAt": 42, + "UpdatedAt": 42 + } +] +``` + +### MarketListRetrievalAsk + + +Perms: read + +Inputs: `[]` + +Response: +```json +[ + { + "Miner": "f01234", + "PricePerByte": "0", + "UnsealPrice": "0", + "PaymentInterval": 42, + "PaymentIntervalIncrease": 42, + "CreatedAt": 42, + "UpdatedAt": 42 + } +] +``` + +### MarketListRetrievalDeals + + +Perms: read + +Inputs: `[]` + +Response: +```json +[ + { + "PayloadCID": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "ID": 5, + "Selector": { + "Raw": "Ynl0ZSBhcnJheQ==" + }, + "PieceCID": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PricePerByte": "0", + "PaymentInterval": 42, + "PaymentIntervalIncrease": 42, + "UnsealPrice": "0", + "StoreID": 42, + "SelStorageProposalCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "ChannelID": { + "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "ID": 3 + }, + "Status": 0, + "Receiver": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "TotalSent": 42, + "FundsReceived": "0", + "Message": "string value", + "CurrentInterval": 42, + "LegacyProtocol": true, + "CreatedAt": 42, + "UpdatedAt": 42 + } +] +``` + +### MarketListStorageAsk + + +Perms: read + +Inputs: `[]` + +Response: +```json +[ + { + "Ask": { + "Price": "0", + "VerifiedPrice": "0", + "MinPieceSize": 1032, + "MaxPieceSize": 1032, + "Miner": "f01234", + "Timestamp": 10101, + "Expiry": 10101, + "SeqNo": 42 + }, + "Signature": { + "Type": 2, + "Data": "Ynl0ZSBhcnJheQ==" + }, + "CreatedAt": 42, + "UpdatedAt": 42 + } +] +``` + +### MarketMaxBalanceAddFee + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `"0 FIL"` + +### MarketMaxDealsPerPublishMsg + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `42` + +### MarketPendingDeals + + +Perms: write + +Inputs: `[]` + +Response: +```json +[ + { + "Deals": [ + { + "Proposal": { + "PieceCID": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceSize": 1032, + "VerifiedDeal": true, + "Client": "f01234", + "Provider": "f01234", + "Label": "", + "StartEpoch": 10101, + "EndEpoch": 10101, + "StoragePricePerEpoch": "0", + "ProviderCollateral": "0", + "ClientCollateral": "0" + }, + "ClientSignature": { + "Type": 2, + "Data": "Ynl0ZSBhcnJheQ==" + } + } + ], + "PublishPeriodStart": "0001-01-01T00:00:00Z", + "PublishPeriod": 60000000000 + } +] +``` + +### MarketPublishPendingDeals + + +Perms: admin + +Inputs: `[]` + +Response: `{}` + +### MarketReleaseFunds + + +Perms: sign + +Inputs: +```json +[ + "f01234", + "0" +] +``` + +Response: `{}` + +### MarketReserveFunds + + +Perms: sign + +Inputs: +```json +[ + "f01234", + "f01234", + "0" +] +``` + +Response: +```json +{ + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" +} +``` + +### MarketRestartDataTransfer +MarketRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer + + +Perms: admin + +Inputs: +```json +[ + 3, + "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + true +] +``` + +Response: `{}` + +### MarketSetAsk + + +Perms: admin + +Inputs: +```json +[ + "f01234", + "0", + "0", + 10101, + 1032, + 1032 +] +``` + +Response: `{}` + +### MarketSetDataTransferPath + + +Perms: admin + +Inputs: +```json +[ + "f01234", + "string value" +] +``` + +Response: `{}` + +### MarketSetMaxBalanceAddFee + + +Perms: write + +Inputs: +```json +[ + "f01234", + "0 FIL" +] +``` + +Response: `{}` + +### MarketSetMaxDealsPerPublishMsg + + +Perms: write + +Inputs: +```json +[ + "f01234", + 42 +] +``` + +Response: `{}` + +### MarketSetRetrievalAsk + + +Perms: admin + +Inputs: +```json +[ + "f01234", + { + "PricePerByte": "0", + "UnsealPrice": "0", + "PaymentInterval": 42, + "PaymentIntervalIncrease": 42 + } +] +``` + +Response: `{}` + +### MarketWithdraw + + +Perms: sign + +Inputs: +```json +[ + "f01234", + "f01234", + "0" +] +``` + +Response: +```json +{ + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" +} +``` + +### MessagerGetMessage + + +Perms: read + +Inputs: +```json +[ + { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + } +] +``` + +Response: +```json +{ + "CID": { + "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" + }, + "Version": 42, + "To": "f01234", + "From": "f01234", + "Nonce": 42, + "Value": "0", + "GasLimit": 9, + "GasFeeCap": "0", + "GasPremium": "0", + "Method": 1, + "Params": "Ynl0ZSBhcnJheQ==" +} +``` + +### MessagerPushMessage + + +Perms: write + +Inputs: +```json +[ + { + "CID": { + "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" + }, + "Version": 42, + "To": "f01234", + "From": "f01234", + "Nonce": 42, + "Value": "0", + "GasLimit": 9, + "GasFeeCap": "0", + "GasPremium": "0", + "Method": 1, + "Params": "Ynl0ZSBhcnJheQ==" + }, + { + "MaxFee": "0", + "GasOverEstimation": 12.3, + "GasOverPremium": 12.3 + } +] +``` + +Response: +```json +{ + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" +} +``` + +### MessagerWaitMessage +messager + + +Perms: read + +Inputs: +```json +[ + { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + } +] +``` + +Response: +```json +{ + "Message": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "Receipt": { + "ExitCode": 0, + "Return": "Ynl0ZSBhcnJheQ==", + "GasUsed": 9, + "EventsRoot": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + } + }, + "ReturnDec": {}, + "TipSet": [ + { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + { + "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" + } + ], + "Height": 10101 +} +``` + +### NetAddrsListen + + +Perms: read + +Inputs: `[]` + +Response: +```json +{ + "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "Addrs": [ + "/ip4/52.36.61.156/tcp/1347/p2p/12D3KooWFETiESTf1v4PGUvtnxMAcEFMzLZbJGg4tjWfGEimYior" + ] +} +``` + +### OfflineDealImport + + +Perms: admin + +Inputs: +```json +[ + { + "Proposal": { + "PieceCID": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceSize": 1032, + "VerifiedDeal": true, + "Client": "f01234", + "Provider": "f01234", + "Label": "", + "StartEpoch": 10101, + "EndEpoch": 10101, + "StoragePricePerEpoch": "0", + "ProviderCollateral": "0", + "ClientCollateral": "0" + }, + "ClientSignature": { + "Type": 2, + "Data": "Ynl0ZSBhcnJheQ==" + }, + "ProposalCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "AddFundsCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PublishCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "Miner": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "Client": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "State": 42, + "PiecePath": "/some/path", + "PayloadSize": 42, + "MetadataPath": "/some/path", + "SlashEpoch": 10101, + "FastRetrieval": true, + "Message": "string value", + "FundsReserved": "0", + "Ref": { + "TransferType": "string value", + "Root": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceCid": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceSize": 1024, + "RawBlockSize": 42 + }, + "AvailableForRetrieval": true, + "DealID": 5432, + "CreationTime": "0001-01-01T00:00:00Z", + "TransferChannelId": { + "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", + "ID": 3 + }, + "SectorNumber": 9, + "Offset": 1032, + "PieceStatus": "Undefine", + "InboundCAR": "string value", + "CreatedAt": 42, + "UpdatedAt": 42 + } +] +``` + +Response: `{}` + +### PaychVoucherList +Paych + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: +```json +[ + { + "ChannelAddr": "f01234", + "TimeLockMin": 10101, + "TimeLockMax": 10101, + "SecretHash": "Ynl0ZSBhcnJheQ==", + "Extra": { + "Actor": "f01234", + "Method": 1, + "Data": "Ynl0ZSBhcnJheQ==" + }, + "Lane": 42, + "Nonce": 42, + "Amount": "0", + "MinSettleHeight": 10101, + "Merges": [ + { + "Lane": 42, + "Nonce": 42 + } + ], + "Signature": { + "Type": 2, + "Data": "Ynl0ZSBhcnJheQ==" + } + } +] +``` + +### PiecesGetCIDInfo + + +Perms: read + +Inputs: +```json +[ + { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + } +] +``` + +Response: +```json +{ + "CID": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceBlockLocations": [ + { + "RelOffset": 42, + "BlockSize": 42, + "PieceCID": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + } + } + ] +} +``` + +### PiecesGetPieceInfo + + +Perms: read + +Inputs: +```json +[ + { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + } +] +``` + +Response: +```json +{ + "PieceCID": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "Deals": [ + { + "DealID": 5432, + "SectorID": 9, + "Offset": 1032, + "Length": 1032 + } + ] +} +``` + +### PiecesListCidInfos + + +Perms: read + +Inputs: `[]` + +Response: +```json +[ + { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + } +] +``` + +### PiecesListPieces + + +Perms: read + +Inputs: `[]` + +Response: +```json +[ + { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + } +] +``` + +### RemovePieceStorage + + +Perms: admin + +Inputs: +```json +[ + "string value" +] +``` + +Response: `{}` + +### ResponseMarketEvent +market event + + +Perms: read + +Inputs: +```json +[ + { + "Id": "e26f1e5c-47f7-4561-a11d-18fab6e748af", + "Payload": "Ynl0ZSBhcnJheQ==", + "Error": "string value" + } +] +``` + +Response: `{}` + +### SectorGetExpectedSealDuration +SectorGetExpectedSealDuration gets the time that a newly-created sector +waits for more deals before it starts sealing + + +Perms: read + +Inputs: +```json +[ + "f01234" +] +``` + +Response: `60000000000` + +### SectorSetExpectedSealDuration +SectorSetExpectedSealDuration sets the expected time for a sector to seal + + +Perms: write + +Inputs: +```json +[ + "f01234", + 60000000000 +] +``` + +Response: `{}` + +### UpdateDealOnPacking + + +Perms: write + +Inputs: +```json +[ + "f01234", + 5432, + 9, + 1032 +] +``` + +Response: `{}` + +### UpdateDealStatus + + +Perms: write + +Inputs: +```json +[ + "f01234", + 5432, + "Undefine", + 42 +] +``` + +Response: `{}` + +### UpdateStorageDealStatus + + +Perms: write + +Inputs: +```json +[ + { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + 42, + "Undefine" +] +``` + +Response: `{}` + +### Version +Version provides information about API provider + + +Perms: read + +Inputs: `[]` + +Response: +```json +{ + "Version": "string value", + "APIVersion": 131840 +} +``` + diff --git a/venus-shared/api/market/v1/mock/mock_imarket.go b/venus-shared/api/market/v1/mock/mock_imarket.go new file mode 100644 index 0000000000..b5564d9591 --- /dev/null +++ b/venus-shared/api/market/v1/mock/mock_imarket.go @@ -0,0 +1,1392 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/filecoin-project/venus/venus-shared/api/market/v1 (interfaces: IMarket) + +// Package mock is a generated GoMock package. +package mock + +import ( + context "context" + reflect "reflect" + time "time" + + address "github.com/filecoin-project/go-address" + datatransfer "github.com/filecoin-project/go-data-transfer" + piecestore "github.com/filecoin-project/go-fil-markets/piecestore" + retrievalmarket "github.com/filecoin-project/go-fil-markets/retrievalmarket" + abi "github.com/filecoin-project/go-state-types/abi" + big "github.com/filecoin-project/go-state-types/big" + paych "github.com/filecoin-project/go-state-types/builtin/v8/paych" + types "github.com/filecoin-project/venus/venus-shared/actors/types" + types0 "github.com/filecoin-project/venus/venus-shared/types" + gateway "github.com/filecoin-project/venus/venus-shared/types/gateway" + market "github.com/filecoin-project/venus/venus-shared/types/market" + gomock "github.com/golang/mock/gomock" + cid "github.com/ipfs/go-cid" + peer "github.com/libp2p/go-libp2p/core/peer" +) + +// MockIMarket is a mock of IMarket interface. +type MockIMarket struct { + ctrl *gomock.Controller + recorder *MockIMarketMockRecorder +} + +// MockIMarketMockRecorder is the mock recorder for MockIMarket. +type MockIMarketMockRecorder struct { + mock *MockIMarket +} + +// NewMockIMarket creates a new mock instance. +func NewMockIMarket(ctrl *gomock.Controller) *MockIMarket { + mock := &MockIMarket{ctrl: ctrl} + mock.recorder = &MockIMarketMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockIMarket) EXPECT() *MockIMarketMockRecorder { + return m.recorder +} + +// ActorDelete mocks base method. +func (m *MockIMarket) ActorDelete(arg0 context.Context, arg1 address.Address) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ActorDelete", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// ActorDelete indicates an expected call of ActorDelete. +func (mr *MockIMarketMockRecorder) ActorDelete(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ActorDelete", reflect.TypeOf((*MockIMarket)(nil).ActorDelete), arg0, arg1) +} + +// ActorExist mocks base method. +func (m *MockIMarket) ActorExist(arg0 context.Context, arg1 address.Address) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ActorExist", arg0, arg1) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ActorExist indicates an expected call of ActorExist. +func (mr *MockIMarketMockRecorder) ActorExist(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ActorExist", reflect.TypeOf((*MockIMarket)(nil).ActorExist), arg0, arg1) +} + +// ActorList mocks base method. +func (m *MockIMarket) ActorList(arg0 context.Context) ([]market.User, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ActorList", arg0) + ret0, _ := ret[0].([]market.User) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ActorList indicates an expected call of ActorList. +func (mr *MockIMarketMockRecorder) ActorList(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ActorList", reflect.TypeOf((*MockIMarket)(nil).ActorList), arg0) +} + +// ActorSectorSize mocks base method. +func (m *MockIMarket) ActorSectorSize(arg0 context.Context, arg1 address.Address) (abi.SectorSize, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ActorSectorSize", arg0, arg1) + ret0, _ := ret[0].(abi.SectorSize) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ActorSectorSize indicates an expected call of ActorSectorSize. +func (mr *MockIMarketMockRecorder) ActorSectorSize(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ActorSectorSize", reflect.TypeOf((*MockIMarket)(nil).ActorSectorSize), arg0, arg1) +} + +// ActorUpsert mocks base method. +func (m *MockIMarket) ActorUpsert(arg0 context.Context, arg1 market.User) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ActorUpsert", arg0, arg1) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ActorUpsert indicates an expected call of ActorUpsert. +func (mr *MockIMarketMockRecorder) ActorUpsert(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ActorUpsert", reflect.TypeOf((*MockIMarket)(nil).ActorUpsert), arg0, arg1) +} + +// AddFsPieceStorage mocks base method. +func (m *MockIMarket) AddFsPieceStorage(arg0 context.Context, arg1, arg2 string, arg3 bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AddFsPieceStorage", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(error) + return ret0 +} + +// AddFsPieceStorage indicates an expected call of AddFsPieceStorage. +func (mr *MockIMarketMockRecorder) AddFsPieceStorage(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddFsPieceStorage", reflect.TypeOf((*MockIMarket)(nil).AddFsPieceStorage), arg0, arg1, arg2, arg3) +} + +// AddS3PieceStorage mocks base method. +func (m *MockIMarket) AddS3PieceStorage(arg0 context.Context, arg1, arg2, arg3, arg4, arg5, arg6, arg7 string, arg8 bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AddS3PieceStorage", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) + ret0, _ := ret[0].(error) + return ret0 +} + +// AddS3PieceStorage indicates an expected call of AddS3PieceStorage. +func (mr *MockIMarketMockRecorder) AddS3PieceStorage(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddS3PieceStorage", reflect.TypeOf((*MockIMarket)(nil).AddS3PieceStorage), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) +} + +// AssignUnPackedDeals mocks base method. +func (m *MockIMarket) AssignUnPackedDeals(arg0 context.Context, arg1 abi.SectorID, arg2 abi.SectorSize, arg3 *market.GetDealSpec) ([]*market.DealInfoIncludePath, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AssignUnPackedDeals", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].([]*market.DealInfoIncludePath) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AssignUnPackedDeals indicates an expected call of AssignUnPackedDeals. +func (mr *MockIMarketMockRecorder) AssignUnPackedDeals(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AssignUnPackedDeals", reflect.TypeOf((*MockIMarket)(nil).AssignUnPackedDeals), arg0, arg1, arg2, arg3) +} + +// DagstoreGC mocks base method. +func (m *MockIMarket) DagstoreGC(arg0 context.Context) ([]market.DagstoreShardResult, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DagstoreGC", arg0) + ret0, _ := ret[0].([]market.DagstoreShardResult) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DagstoreGC indicates an expected call of DagstoreGC. +func (mr *MockIMarketMockRecorder) DagstoreGC(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DagstoreGC", reflect.TypeOf((*MockIMarket)(nil).DagstoreGC), arg0) +} + +// DagstoreInitializeAll mocks base method. +func (m *MockIMarket) DagstoreInitializeAll(arg0 context.Context, arg1 market.DagstoreInitializeAllParams) (<-chan market.DagstoreInitializeAllEvent, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DagstoreInitializeAll", arg0, arg1) + ret0, _ := ret[0].(<-chan market.DagstoreInitializeAllEvent) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DagstoreInitializeAll indicates an expected call of DagstoreInitializeAll. +func (mr *MockIMarketMockRecorder) DagstoreInitializeAll(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DagstoreInitializeAll", reflect.TypeOf((*MockIMarket)(nil).DagstoreInitializeAll), arg0, arg1) +} + +// DagstoreInitializeShard mocks base method. +func (m *MockIMarket) DagstoreInitializeShard(arg0 context.Context, arg1 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DagstoreInitializeShard", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DagstoreInitializeShard indicates an expected call of DagstoreInitializeShard. +func (mr *MockIMarketMockRecorder) DagstoreInitializeShard(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DagstoreInitializeShard", reflect.TypeOf((*MockIMarket)(nil).DagstoreInitializeShard), arg0, arg1) +} + +// DagstoreInitializeStorage mocks base method. +func (m *MockIMarket) DagstoreInitializeStorage(arg0 context.Context, arg1 string, arg2 market.DagstoreInitializeAllParams) (<-chan market.DagstoreInitializeAllEvent, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DagstoreInitializeStorage", arg0, arg1, arg2) + ret0, _ := ret[0].(<-chan market.DagstoreInitializeAllEvent) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DagstoreInitializeStorage indicates an expected call of DagstoreInitializeStorage. +func (mr *MockIMarketMockRecorder) DagstoreInitializeStorage(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DagstoreInitializeStorage", reflect.TypeOf((*MockIMarket)(nil).DagstoreInitializeStorage), arg0, arg1, arg2) +} + +// DagstoreListShards mocks base method. +func (m *MockIMarket) DagstoreListShards(arg0 context.Context) ([]market.DagstoreShardInfo, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DagstoreListShards", arg0) + ret0, _ := ret[0].([]market.DagstoreShardInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DagstoreListShards indicates an expected call of DagstoreListShards. +func (mr *MockIMarketMockRecorder) DagstoreListShards(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DagstoreListShards", reflect.TypeOf((*MockIMarket)(nil).DagstoreListShards), arg0) +} + +// DagstoreRecoverShard mocks base method. +func (m *MockIMarket) DagstoreRecoverShard(arg0 context.Context, arg1 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DagstoreRecoverShard", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DagstoreRecoverShard indicates an expected call of DagstoreRecoverShard. +func (mr *MockIMarketMockRecorder) DagstoreRecoverShard(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DagstoreRecoverShard", reflect.TypeOf((*MockIMarket)(nil).DagstoreRecoverShard), arg0, arg1) +} + +// DealsConsiderOfflineRetrievalDeals mocks base method. +func (m *MockIMarket) DealsConsiderOfflineRetrievalDeals(arg0 context.Context, arg1 address.Address) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsConsiderOfflineRetrievalDeals", arg0, arg1) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DealsConsiderOfflineRetrievalDeals indicates an expected call of DealsConsiderOfflineRetrievalDeals. +func (mr *MockIMarketMockRecorder) DealsConsiderOfflineRetrievalDeals(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsConsiderOfflineRetrievalDeals", reflect.TypeOf((*MockIMarket)(nil).DealsConsiderOfflineRetrievalDeals), arg0, arg1) +} + +// DealsConsiderOfflineStorageDeals mocks base method. +func (m *MockIMarket) DealsConsiderOfflineStorageDeals(arg0 context.Context, arg1 address.Address) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsConsiderOfflineStorageDeals", arg0, arg1) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DealsConsiderOfflineStorageDeals indicates an expected call of DealsConsiderOfflineStorageDeals. +func (mr *MockIMarketMockRecorder) DealsConsiderOfflineStorageDeals(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsConsiderOfflineStorageDeals", reflect.TypeOf((*MockIMarket)(nil).DealsConsiderOfflineStorageDeals), arg0, arg1) +} + +// DealsConsiderOnlineRetrievalDeals mocks base method. +func (m *MockIMarket) DealsConsiderOnlineRetrievalDeals(arg0 context.Context, arg1 address.Address) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsConsiderOnlineRetrievalDeals", arg0, arg1) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DealsConsiderOnlineRetrievalDeals indicates an expected call of DealsConsiderOnlineRetrievalDeals. +func (mr *MockIMarketMockRecorder) DealsConsiderOnlineRetrievalDeals(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsConsiderOnlineRetrievalDeals", reflect.TypeOf((*MockIMarket)(nil).DealsConsiderOnlineRetrievalDeals), arg0, arg1) +} + +// DealsConsiderOnlineStorageDeals mocks base method. +func (m *MockIMarket) DealsConsiderOnlineStorageDeals(arg0 context.Context, arg1 address.Address) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsConsiderOnlineStorageDeals", arg0, arg1) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DealsConsiderOnlineStorageDeals indicates an expected call of DealsConsiderOnlineStorageDeals. +func (mr *MockIMarketMockRecorder) DealsConsiderOnlineStorageDeals(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsConsiderOnlineStorageDeals", reflect.TypeOf((*MockIMarket)(nil).DealsConsiderOnlineStorageDeals), arg0, arg1) +} + +// DealsConsiderUnverifiedStorageDeals mocks base method. +func (m *MockIMarket) DealsConsiderUnverifiedStorageDeals(arg0 context.Context, arg1 address.Address) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsConsiderUnverifiedStorageDeals", arg0, arg1) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DealsConsiderUnverifiedStorageDeals indicates an expected call of DealsConsiderUnverifiedStorageDeals. +func (mr *MockIMarketMockRecorder) DealsConsiderUnverifiedStorageDeals(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsConsiderUnverifiedStorageDeals", reflect.TypeOf((*MockIMarket)(nil).DealsConsiderUnverifiedStorageDeals), arg0, arg1) +} + +// DealsConsiderVerifiedStorageDeals mocks base method. +func (m *MockIMarket) DealsConsiderVerifiedStorageDeals(arg0 context.Context, arg1 address.Address) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsConsiderVerifiedStorageDeals", arg0, arg1) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DealsConsiderVerifiedStorageDeals indicates an expected call of DealsConsiderVerifiedStorageDeals. +func (mr *MockIMarketMockRecorder) DealsConsiderVerifiedStorageDeals(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsConsiderVerifiedStorageDeals", reflect.TypeOf((*MockIMarket)(nil).DealsConsiderVerifiedStorageDeals), arg0, arg1) +} + +// DealsImportData mocks base method. +func (m *MockIMarket) DealsImportData(arg0 context.Context, arg1 cid.Cid, arg2 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsImportData", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// DealsImportData indicates an expected call of DealsImportData. +func (mr *MockIMarketMockRecorder) DealsImportData(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsImportData", reflect.TypeOf((*MockIMarket)(nil).DealsImportData), arg0, arg1, arg2) +} + +// DealsMaxProviderCollateralMultiplier mocks base method. +func (m *MockIMarket) DealsMaxProviderCollateralMultiplier(arg0 context.Context, arg1 address.Address) (uint64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsMaxProviderCollateralMultiplier", arg0, arg1) + ret0, _ := ret[0].(uint64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DealsMaxProviderCollateralMultiplier indicates an expected call of DealsMaxProviderCollateralMultiplier. +func (mr *MockIMarketMockRecorder) DealsMaxProviderCollateralMultiplier(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsMaxProviderCollateralMultiplier", reflect.TypeOf((*MockIMarket)(nil).DealsMaxProviderCollateralMultiplier), arg0, arg1) +} + +// DealsMaxPublishFee mocks base method. +func (m *MockIMarket) DealsMaxPublishFee(arg0 context.Context, arg1 address.Address) (types.FIL, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsMaxPublishFee", arg0, arg1) + ret0, _ := ret[0].(types.FIL) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DealsMaxPublishFee indicates an expected call of DealsMaxPublishFee. +func (mr *MockIMarketMockRecorder) DealsMaxPublishFee(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsMaxPublishFee", reflect.TypeOf((*MockIMarket)(nil).DealsMaxPublishFee), arg0, arg1) +} + +// DealsMaxStartDelay mocks base method. +func (m *MockIMarket) DealsMaxStartDelay(arg0 context.Context, arg1 address.Address) (time.Duration, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsMaxStartDelay", arg0, arg1) + ret0, _ := ret[0].(time.Duration) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DealsMaxStartDelay indicates an expected call of DealsMaxStartDelay. +func (mr *MockIMarketMockRecorder) DealsMaxStartDelay(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsMaxStartDelay", reflect.TypeOf((*MockIMarket)(nil).DealsMaxStartDelay), arg0, arg1) +} + +// DealsPieceCidBlocklist mocks base method. +func (m *MockIMarket) DealsPieceCidBlocklist(arg0 context.Context, arg1 address.Address) ([]cid.Cid, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsPieceCidBlocklist", arg0, arg1) + ret0, _ := ret[0].([]cid.Cid) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DealsPieceCidBlocklist indicates an expected call of DealsPieceCidBlocklist. +func (mr *MockIMarketMockRecorder) DealsPieceCidBlocklist(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsPieceCidBlocklist", reflect.TypeOf((*MockIMarket)(nil).DealsPieceCidBlocklist), arg0, arg1) +} + +// DealsPublishMsgPeriod mocks base method. +func (m *MockIMarket) DealsPublishMsgPeriod(arg0 context.Context, arg1 address.Address) (time.Duration, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsPublishMsgPeriod", arg0, arg1) + ret0, _ := ret[0].(time.Duration) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DealsPublishMsgPeriod indicates an expected call of DealsPublishMsgPeriod. +func (mr *MockIMarketMockRecorder) DealsPublishMsgPeriod(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsPublishMsgPeriod", reflect.TypeOf((*MockIMarket)(nil).DealsPublishMsgPeriod), arg0, arg1) +} + +// DealsSetConsiderOfflineRetrievalDeals mocks base method. +func (m *MockIMarket) DealsSetConsiderOfflineRetrievalDeals(arg0 context.Context, arg1 address.Address, arg2 bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsSetConsiderOfflineRetrievalDeals", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// DealsSetConsiderOfflineRetrievalDeals indicates an expected call of DealsSetConsiderOfflineRetrievalDeals. +func (mr *MockIMarketMockRecorder) DealsSetConsiderOfflineRetrievalDeals(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsSetConsiderOfflineRetrievalDeals", reflect.TypeOf((*MockIMarket)(nil).DealsSetConsiderOfflineRetrievalDeals), arg0, arg1, arg2) +} + +// DealsSetConsiderOfflineStorageDeals mocks base method. +func (m *MockIMarket) DealsSetConsiderOfflineStorageDeals(arg0 context.Context, arg1 address.Address, arg2 bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsSetConsiderOfflineStorageDeals", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// DealsSetConsiderOfflineStorageDeals indicates an expected call of DealsSetConsiderOfflineStorageDeals. +func (mr *MockIMarketMockRecorder) DealsSetConsiderOfflineStorageDeals(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsSetConsiderOfflineStorageDeals", reflect.TypeOf((*MockIMarket)(nil).DealsSetConsiderOfflineStorageDeals), arg0, arg1, arg2) +} + +// DealsSetConsiderOnlineRetrievalDeals mocks base method. +func (m *MockIMarket) DealsSetConsiderOnlineRetrievalDeals(arg0 context.Context, arg1 address.Address, arg2 bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsSetConsiderOnlineRetrievalDeals", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// DealsSetConsiderOnlineRetrievalDeals indicates an expected call of DealsSetConsiderOnlineRetrievalDeals. +func (mr *MockIMarketMockRecorder) DealsSetConsiderOnlineRetrievalDeals(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsSetConsiderOnlineRetrievalDeals", reflect.TypeOf((*MockIMarket)(nil).DealsSetConsiderOnlineRetrievalDeals), arg0, arg1, arg2) +} + +// DealsSetConsiderOnlineStorageDeals mocks base method. +func (m *MockIMarket) DealsSetConsiderOnlineStorageDeals(arg0 context.Context, arg1 address.Address, arg2 bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsSetConsiderOnlineStorageDeals", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// DealsSetConsiderOnlineStorageDeals indicates an expected call of DealsSetConsiderOnlineStorageDeals. +func (mr *MockIMarketMockRecorder) DealsSetConsiderOnlineStorageDeals(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsSetConsiderOnlineStorageDeals", reflect.TypeOf((*MockIMarket)(nil).DealsSetConsiderOnlineStorageDeals), arg0, arg1, arg2) +} + +// DealsSetConsiderUnverifiedStorageDeals mocks base method. +func (m *MockIMarket) DealsSetConsiderUnverifiedStorageDeals(arg0 context.Context, arg1 address.Address, arg2 bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsSetConsiderUnverifiedStorageDeals", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// DealsSetConsiderUnverifiedStorageDeals indicates an expected call of DealsSetConsiderUnverifiedStorageDeals. +func (mr *MockIMarketMockRecorder) DealsSetConsiderUnverifiedStorageDeals(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsSetConsiderUnverifiedStorageDeals", reflect.TypeOf((*MockIMarket)(nil).DealsSetConsiderUnverifiedStorageDeals), arg0, arg1, arg2) +} + +// DealsSetConsiderVerifiedStorageDeals mocks base method. +func (m *MockIMarket) DealsSetConsiderVerifiedStorageDeals(arg0 context.Context, arg1 address.Address, arg2 bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsSetConsiderVerifiedStorageDeals", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// DealsSetConsiderVerifiedStorageDeals indicates an expected call of DealsSetConsiderVerifiedStorageDeals. +func (mr *MockIMarketMockRecorder) DealsSetConsiderVerifiedStorageDeals(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsSetConsiderVerifiedStorageDeals", reflect.TypeOf((*MockIMarket)(nil).DealsSetConsiderVerifiedStorageDeals), arg0, arg1, arg2) +} + +// DealsSetMaxProviderCollateralMultiplier mocks base method. +func (m *MockIMarket) DealsSetMaxProviderCollateralMultiplier(arg0 context.Context, arg1 address.Address, arg2 uint64) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsSetMaxProviderCollateralMultiplier", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// DealsSetMaxProviderCollateralMultiplier indicates an expected call of DealsSetMaxProviderCollateralMultiplier. +func (mr *MockIMarketMockRecorder) DealsSetMaxProviderCollateralMultiplier(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsSetMaxProviderCollateralMultiplier", reflect.TypeOf((*MockIMarket)(nil).DealsSetMaxProviderCollateralMultiplier), arg0, arg1, arg2) +} + +// DealsSetMaxPublishFee mocks base method. +func (m *MockIMarket) DealsSetMaxPublishFee(arg0 context.Context, arg1 address.Address, arg2 types.FIL) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsSetMaxPublishFee", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// DealsSetMaxPublishFee indicates an expected call of DealsSetMaxPublishFee. +func (mr *MockIMarketMockRecorder) DealsSetMaxPublishFee(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsSetMaxPublishFee", reflect.TypeOf((*MockIMarket)(nil).DealsSetMaxPublishFee), arg0, arg1, arg2) +} + +// DealsSetMaxStartDelay mocks base method. +func (m *MockIMarket) DealsSetMaxStartDelay(arg0 context.Context, arg1 address.Address, arg2 time.Duration) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsSetMaxStartDelay", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// DealsSetMaxStartDelay indicates an expected call of DealsSetMaxStartDelay. +func (mr *MockIMarketMockRecorder) DealsSetMaxStartDelay(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsSetMaxStartDelay", reflect.TypeOf((*MockIMarket)(nil).DealsSetMaxStartDelay), arg0, arg1, arg2) +} + +// DealsSetPieceCidBlocklist mocks base method. +func (m *MockIMarket) DealsSetPieceCidBlocklist(arg0 context.Context, arg1 address.Address, arg2 []cid.Cid) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsSetPieceCidBlocklist", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// DealsSetPieceCidBlocklist indicates an expected call of DealsSetPieceCidBlocklist. +func (mr *MockIMarketMockRecorder) DealsSetPieceCidBlocklist(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsSetPieceCidBlocklist", reflect.TypeOf((*MockIMarket)(nil).DealsSetPieceCidBlocklist), arg0, arg1, arg2) +} + +// DealsSetPublishMsgPeriod mocks base method. +func (m *MockIMarket) DealsSetPublishMsgPeriod(arg0 context.Context, arg1 address.Address, arg2 time.Duration) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DealsSetPublishMsgPeriod", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// DealsSetPublishMsgPeriod indicates an expected call of DealsSetPublishMsgPeriod. +func (mr *MockIMarketMockRecorder) DealsSetPublishMsgPeriod(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DealsSetPublishMsgPeriod", reflect.TypeOf((*MockIMarket)(nil).DealsSetPublishMsgPeriod), arg0, arg1, arg2) +} + +// GetDeals mocks base method. +func (m *MockIMarket) GetDeals(arg0 context.Context, arg1 address.Address, arg2, arg3 int) ([]*market.DealInfo, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDeals", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].([]*market.DealInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetDeals indicates an expected call of GetDeals. +func (mr *MockIMarketMockRecorder) GetDeals(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDeals", reflect.TypeOf((*MockIMarket)(nil).GetDeals), arg0, arg1, arg2, arg3) +} + +// GetRetrievalDealStatistic mocks base method. +func (m *MockIMarket) GetRetrievalDealStatistic(arg0 context.Context, arg1 address.Address) (*market.RetrievalDealStatistic, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRetrievalDealStatistic", arg0, arg1) + ret0, _ := ret[0].(*market.RetrievalDealStatistic) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRetrievalDealStatistic indicates an expected call of GetRetrievalDealStatistic. +func (mr *MockIMarketMockRecorder) GetRetrievalDealStatistic(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRetrievalDealStatistic", reflect.TypeOf((*MockIMarket)(nil).GetRetrievalDealStatistic), arg0, arg1) +} + +// GetStorageDealStatistic mocks base method. +func (m *MockIMarket) GetStorageDealStatistic(arg0 context.Context, arg1 address.Address) (*market.StorageDealStatistic, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetStorageDealStatistic", arg0, arg1) + ret0, _ := ret[0].(*market.StorageDealStatistic) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetStorageDealStatistic indicates an expected call of GetStorageDealStatistic. +func (mr *MockIMarketMockRecorder) GetStorageDealStatistic(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageDealStatistic", reflect.TypeOf((*MockIMarket)(nil).GetStorageDealStatistic), arg0, arg1) +} + +// GetUnPackedDeals mocks base method. +func (m *MockIMarket) GetUnPackedDeals(arg0 context.Context, arg1 address.Address, arg2 *market.GetDealSpec) ([]*market.DealInfoIncludePath, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetUnPackedDeals", arg0, arg1, arg2) + ret0, _ := ret[0].([]*market.DealInfoIncludePath) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetUnPackedDeals indicates an expected call of GetUnPackedDeals. +func (mr *MockIMarketMockRecorder) GetUnPackedDeals(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUnPackedDeals", reflect.TypeOf((*MockIMarket)(nil).GetUnPackedDeals), arg0, arg1, arg2) +} + +// ID mocks base method. +func (m *MockIMarket) ID(arg0 context.Context) (peer.ID, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ID", arg0) + ret0, _ := ret[0].(peer.ID) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ID indicates an expected call of ID. +func (mr *MockIMarketMockRecorder) ID(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ID", reflect.TypeOf((*MockIMarket)(nil).ID), arg0) +} + +// ListPieceStorageInfos mocks base method. +func (m *MockIMarket) ListPieceStorageInfos(arg0 context.Context) market.PieceStorageInfos { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListPieceStorageInfos", arg0) + ret0, _ := ret[0].(market.PieceStorageInfos) + return ret0 +} + +// ListPieceStorageInfos indicates an expected call of ListPieceStorageInfos. +func (mr *MockIMarketMockRecorder) ListPieceStorageInfos(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPieceStorageInfos", reflect.TypeOf((*MockIMarket)(nil).ListPieceStorageInfos), arg0) +} + +// ListenMarketEvent mocks base method. +func (m *MockIMarket) ListenMarketEvent(arg0 context.Context, arg1 *gateway.MarketRegisterPolicy) (<-chan *gateway.RequestEvent, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListenMarketEvent", arg0, arg1) + ret0, _ := ret[0].(<-chan *gateway.RequestEvent) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListenMarketEvent indicates an expected call of ListenMarketEvent. +func (mr *MockIMarketMockRecorder) ListenMarketEvent(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListenMarketEvent", reflect.TypeOf((*MockIMarket)(nil).ListenMarketEvent), arg0, arg1) +} + +// MarkDealsAsPacking mocks base method. +func (m *MockIMarket) 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 *MockIMarketMockRecorder) MarkDealsAsPacking(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkDealsAsPacking", reflect.TypeOf((*MockIMarket)(nil).MarkDealsAsPacking), arg0, arg1, arg2) +} + +// MarketAddBalance mocks base method. +func (m *MockIMarket) MarketAddBalance(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int) (cid.Cid, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketAddBalance", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(cid.Cid) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarketAddBalance indicates an expected call of MarketAddBalance. +func (mr *MockIMarketMockRecorder) MarketAddBalance(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketAddBalance", reflect.TypeOf((*MockIMarket)(nil).MarketAddBalance), arg0, arg1, arg2, arg3) +} + +// MarketCancelDataTransfer mocks base method. +func (m *MockIMarket) MarketCancelDataTransfer(arg0 context.Context, arg1 datatransfer.TransferID, arg2 peer.ID, arg3 bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketCancelDataTransfer", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(error) + return ret0 +} + +// MarketCancelDataTransfer indicates an expected call of MarketCancelDataTransfer. +func (mr *MockIMarketMockRecorder) MarketCancelDataTransfer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketCancelDataTransfer", reflect.TypeOf((*MockIMarket)(nil).MarketCancelDataTransfer), arg0, arg1, arg2, arg3) +} + +// MarketDataTransferPath mocks base method. +func (m *MockIMarket) MarketDataTransferPath(arg0 context.Context, arg1 address.Address) (string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketDataTransferPath", arg0, arg1) + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarketDataTransferPath indicates an expected call of MarketDataTransferPath. +func (mr *MockIMarketMockRecorder) MarketDataTransferPath(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketDataTransferPath", reflect.TypeOf((*MockIMarket)(nil).MarketDataTransferPath), arg0, arg1) +} + +// MarketDataTransferUpdates mocks base method. +func (m *MockIMarket) MarketDataTransferUpdates(arg0 context.Context) (<-chan market.DataTransferChannel, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketDataTransferUpdates", arg0) + ret0, _ := ret[0].(<-chan market.DataTransferChannel) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarketDataTransferUpdates indicates an expected call of MarketDataTransferUpdates. +func (mr *MockIMarketMockRecorder) MarketDataTransferUpdates(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketDataTransferUpdates", reflect.TypeOf((*MockIMarket)(nil).MarketDataTransferUpdates), arg0) +} + +// MarketGetAsk mocks base method. +func (m *MockIMarket) MarketGetAsk(arg0 context.Context, arg1 address.Address) (*market.SignedStorageAsk, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketGetAsk", arg0, arg1) + ret0, _ := ret[0].(*market.SignedStorageAsk) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarketGetAsk indicates an expected call of MarketGetAsk. +func (mr *MockIMarketMockRecorder) MarketGetAsk(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketGetAsk", reflect.TypeOf((*MockIMarket)(nil).MarketGetAsk), arg0, arg1) +} + +// MarketGetDealUpdates mocks base method. +func (m *MockIMarket) MarketGetDealUpdates(arg0 context.Context) (<-chan market.MinerDeal, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketGetDealUpdates", arg0) + ret0, _ := ret[0].(<-chan market.MinerDeal) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarketGetDealUpdates indicates an expected call of MarketGetDealUpdates. +func (mr *MockIMarketMockRecorder) MarketGetDealUpdates(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketGetDealUpdates", reflect.TypeOf((*MockIMarket)(nil).MarketGetDealUpdates), arg0) +} + +// MarketGetReserved mocks base method. +func (m *MockIMarket) MarketGetReserved(arg0 context.Context, arg1 address.Address) (big.Int, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketGetReserved", arg0, arg1) + ret0, _ := ret[0].(big.Int) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarketGetReserved indicates an expected call of MarketGetReserved. +func (mr *MockIMarketMockRecorder) MarketGetReserved(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketGetReserved", reflect.TypeOf((*MockIMarket)(nil).MarketGetReserved), arg0, arg1) +} + +// MarketGetRetrievalAsk mocks base method. +func (m *MockIMarket) MarketGetRetrievalAsk(arg0 context.Context, arg1 address.Address) (*retrievalmarket.Ask, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketGetRetrievalAsk", arg0, arg1) + ret0, _ := ret[0].(*retrievalmarket.Ask) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarketGetRetrievalAsk indicates an expected call of MarketGetRetrievalAsk. +func (mr *MockIMarketMockRecorder) MarketGetRetrievalAsk(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketGetRetrievalAsk", reflect.TypeOf((*MockIMarket)(nil).MarketGetRetrievalAsk), arg0, arg1) +} + +// MarketImportDealData mocks base method. +func (m *MockIMarket) MarketImportDealData(arg0 context.Context, arg1 cid.Cid, arg2 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketImportDealData", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// MarketImportDealData indicates an expected call of MarketImportDealData. +func (mr *MockIMarketMockRecorder) MarketImportDealData(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketImportDealData", reflect.TypeOf((*MockIMarket)(nil).MarketImportDealData), arg0, arg1, arg2) +} + +// MarketImportPublishedDeal mocks base method. +func (m *MockIMarket) MarketImportPublishedDeal(arg0 context.Context, arg1 market.MinerDeal) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketImportPublishedDeal", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// MarketImportPublishedDeal indicates an expected call of MarketImportPublishedDeal. +func (mr *MockIMarketMockRecorder) MarketImportPublishedDeal(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketImportPublishedDeal", reflect.TypeOf((*MockIMarket)(nil).MarketImportPublishedDeal), arg0, arg1) +} + +// MarketListDataTransfers mocks base method. +func (m *MockIMarket) MarketListDataTransfers(arg0 context.Context) ([]market.DataTransferChannel, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketListDataTransfers", arg0) + ret0, _ := ret[0].([]market.DataTransferChannel) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarketListDataTransfers indicates an expected call of MarketListDataTransfers. +func (mr *MockIMarketMockRecorder) MarketListDataTransfers(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketListDataTransfers", reflect.TypeOf((*MockIMarket)(nil).MarketListDataTransfers), arg0) +} + +// MarketListDeals mocks base method. +func (m *MockIMarket) MarketListDeals(arg0 context.Context, arg1 []address.Address) ([]*types0.MarketDeal, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketListDeals", arg0, arg1) + ret0, _ := ret[0].([]*types0.MarketDeal) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarketListDeals indicates an expected call of MarketListDeals. +func (mr *MockIMarketMockRecorder) MarketListDeals(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketListDeals", reflect.TypeOf((*MockIMarket)(nil).MarketListDeals), arg0, arg1) +} + +// MarketListIncompleteDeals mocks base method. +func (m *MockIMarket) MarketListIncompleteDeals(arg0 context.Context, arg1 address.Address) ([]market.MinerDeal, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketListIncompleteDeals", arg0, arg1) + ret0, _ := ret[0].([]market.MinerDeal) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarketListIncompleteDeals indicates an expected call of MarketListIncompleteDeals. +func (mr *MockIMarketMockRecorder) MarketListIncompleteDeals(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketListIncompleteDeals", reflect.TypeOf((*MockIMarket)(nil).MarketListIncompleteDeals), arg0, arg1) +} + +// MarketListRetrievalAsk mocks base method. +func (m *MockIMarket) MarketListRetrievalAsk(arg0 context.Context) ([]*market.RetrievalAsk, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketListRetrievalAsk", arg0) + ret0, _ := ret[0].([]*market.RetrievalAsk) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarketListRetrievalAsk indicates an expected call of MarketListRetrievalAsk. +func (mr *MockIMarketMockRecorder) MarketListRetrievalAsk(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketListRetrievalAsk", reflect.TypeOf((*MockIMarket)(nil).MarketListRetrievalAsk), arg0) +} + +// MarketListRetrievalDeals mocks base method. +func (m *MockIMarket) MarketListRetrievalDeals(arg0 context.Context) ([]market.ProviderDealState, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketListRetrievalDeals", arg0) + ret0, _ := ret[0].([]market.ProviderDealState) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarketListRetrievalDeals indicates an expected call of MarketListRetrievalDeals. +func (mr *MockIMarketMockRecorder) MarketListRetrievalDeals(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketListRetrievalDeals", reflect.TypeOf((*MockIMarket)(nil).MarketListRetrievalDeals), arg0) +} + +// MarketListStorageAsk mocks base method. +func (m *MockIMarket) MarketListStorageAsk(arg0 context.Context) ([]*market.SignedStorageAsk, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketListStorageAsk", arg0) + ret0, _ := ret[0].([]*market.SignedStorageAsk) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarketListStorageAsk indicates an expected call of MarketListStorageAsk. +func (mr *MockIMarketMockRecorder) MarketListStorageAsk(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketListStorageAsk", reflect.TypeOf((*MockIMarket)(nil).MarketListStorageAsk), arg0) +} + +// MarketMaxBalanceAddFee mocks base method. +func (m *MockIMarket) MarketMaxBalanceAddFee(arg0 context.Context, arg1 address.Address) (types.FIL, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketMaxBalanceAddFee", arg0, arg1) + ret0, _ := ret[0].(types.FIL) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarketMaxBalanceAddFee indicates an expected call of MarketMaxBalanceAddFee. +func (mr *MockIMarketMockRecorder) MarketMaxBalanceAddFee(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketMaxBalanceAddFee", reflect.TypeOf((*MockIMarket)(nil).MarketMaxBalanceAddFee), arg0, arg1) +} + +// MarketMaxDealsPerPublishMsg mocks base method. +func (m *MockIMarket) MarketMaxDealsPerPublishMsg(arg0 context.Context, arg1 address.Address) (uint64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketMaxDealsPerPublishMsg", arg0, arg1) + ret0, _ := ret[0].(uint64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarketMaxDealsPerPublishMsg indicates an expected call of MarketMaxDealsPerPublishMsg. +func (mr *MockIMarketMockRecorder) MarketMaxDealsPerPublishMsg(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketMaxDealsPerPublishMsg", reflect.TypeOf((*MockIMarket)(nil).MarketMaxDealsPerPublishMsg), arg0, arg1) +} + +// MarketPendingDeals mocks base method. +func (m *MockIMarket) MarketPendingDeals(arg0 context.Context) ([]market.PendingDealInfo, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketPendingDeals", arg0) + ret0, _ := ret[0].([]market.PendingDealInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarketPendingDeals indicates an expected call of MarketPendingDeals. +func (mr *MockIMarketMockRecorder) MarketPendingDeals(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketPendingDeals", reflect.TypeOf((*MockIMarket)(nil).MarketPendingDeals), arg0) +} + +// MarketPublishPendingDeals mocks base method. +func (m *MockIMarket) MarketPublishPendingDeals(arg0 context.Context) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketPublishPendingDeals", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// MarketPublishPendingDeals indicates an expected call of MarketPublishPendingDeals. +func (mr *MockIMarketMockRecorder) MarketPublishPendingDeals(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketPublishPendingDeals", reflect.TypeOf((*MockIMarket)(nil).MarketPublishPendingDeals), arg0) +} + +// MarketReleaseFunds mocks base method. +func (m *MockIMarket) MarketReleaseFunds(arg0 context.Context, arg1 address.Address, arg2 big.Int) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketReleaseFunds", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// MarketReleaseFunds indicates an expected call of MarketReleaseFunds. +func (mr *MockIMarketMockRecorder) MarketReleaseFunds(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketReleaseFunds", reflect.TypeOf((*MockIMarket)(nil).MarketReleaseFunds), arg0, arg1, arg2) +} + +// MarketReserveFunds mocks base method. +func (m *MockIMarket) MarketReserveFunds(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int) (cid.Cid, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketReserveFunds", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(cid.Cid) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarketReserveFunds indicates an expected call of MarketReserveFunds. +func (mr *MockIMarketMockRecorder) MarketReserveFunds(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketReserveFunds", reflect.TypeOf((*MockIMarket)(nil).MarketReserveFunds), arg0, arg1, arg2, arg3) +} + +// MarketRestartDataTransfer mocks base method. +func (m *MockIMarket) MarketRestartDataTransfer(arg0 context.Context, arg1 datatransfer.TransferID, arg2 peer.ID, arg3 bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketRestartDataTransfer", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(error) + return ret0 +} + +// MarketRestartDataTransfer indicates an expected call of MarketRestartDataTransfer. +func (mr *MockIMarketMockRecorder) MarketRestartDataTransfer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketRestartDataTransfer", reflect.TypeOf((*MockIMarket)(nil).MarketRestartDataTransfer), arg0, arg1, arg2, arg3) +} + +// MarketSetAsk mocks base method. +func (m *MockIMarket) MarketSetAsk(arg0 context.Context, arg1 address.Address, arg2, arg3 big.Int, arg4 abi.ChainEpoch, arg5, arg6 abi.PaddedPieceSize) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketSetAsk", arg0, arg1, arg2, arg3, arg4, arg5, arg6) + ret0, _ := ret[0].(error) + return ret0 +} + +// MarketSetAsk indicates an expected call of MarketSetAsk. +func (mr *MockIMarketMockRecorder) MarketSetAsk(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketSetAsk", reflect.TypeOf((*MockIMarket)(nil).MarketSetAsk), arg0, arg1, arg2, arg3, arg4, arg5, arg6) +} + +// MarketSetDataTransferPath mocks base method. +func (m *MockIMarket) MarketSetDataTransferPath(arg0 context.Context, arg1 address.Address, arg2 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketSetDataTransferPath", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// MarketSetDataTransferPath indicates an expected call of MarketSetDataTransferPath. +func (mr *MockIMarketMockRecorder) MarketSetDataTransferPath(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketSetDataTransferPath", reflect.TypeOf((*MockIMarket)(nil).MarketSetDataTransferPath), arg0, arg1, arg2) +} + +// MarketSetMaxBalanceAddFee mocks base method. +func (m *MockIMarket) MarketSetMaxBalanceAddFee(arg0 context.Context, arg1 address.Address, arg2 types.FIL) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketSetMaxBalanceAddFee", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// MarketSetMaxBalanceAddFee indicates an expected call of MarketSetMaxBalanceAddFee. +func (mr *MockIMarketMockRecorder) MarketSetMaxBalanceAddFee(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketSetMaxBalanceAddFee", reflect.TypeOf((*MockIMarket)(nil).MarketSetMaxBalanceAddFee), arg0, arg1, arg2) +} + +// MarketSetMaxDealsPerPublishMsg mocks base method. +func (m *MockIMarket) MarketSetMaxDealsPerPublishMsg(arg0 context.Context, arg1 address.Address, arg2 uint64) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketSetMaxDealsPerPublishMsg", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// MarketSetMaxDealsPerPublishMsg indicates an expected call of MarketSetMaxDealsPerPublishMsg. +func (mr *MockIMarketMockRecorder) MarketSetMaxDealsPerPublishMsg(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketSetMaxDealsPerPublishMsg", reflect.TypeOf((*MockIMarket)(nil).MarketSetMaxDealsPerPublishMsg), arg0, arg1, arg2) +} + +// MarketSetRetrievalAsk mocks base method. +func (m *MockIMarket) MarketSetRetrievalAsk(arg0 context.Context, arg1 address.Address, arg2 *retrievalmarket.Ask) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketSetRetrievalAsk", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// MarketSetRetrievalAsk indicates an expected call of MarketSetRetrievalAsk. +func (mr *MockIMarketMockRecorder) MarketSetRetrievalAsk(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketSetRetrievalAsk", reflect.TypeOf((*MockIMarket)(nil).MarketSetRetrievalAsk), arg0, arg1, arg2) +} + +// MarketWithdraw mocks base method. +func (m *MockIMarket) MarketWithdraw(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int) (cid.Cid, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarketWithdraw", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(cid.Cid) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarketWithdraw indicates an expected call of MarketWithdraw. +func (mr *MockIMarketMockRecorder) MarketWithdraw(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarketWithdraw", reflect.TypeOf((*MockIMarket)(nil).MarketWithdraw), arg0, arg1, arg2, arg3) +} + +// MessagerGetMessage mocks base method. +func (m *MockIMarket) MessagerGetMessage(arg0 context.Context, arg1 cid.Cid) (*types.Message, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MessagerGetMessage", arg0, arg1) + ret0, _ := ret[0].(*types.Message) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MessagerGetMessage indicates an expected call of MessagerGetMessage. +func (mr *MockIMarketMockRecorder) MessagerGetMessage(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MessagerGetMessage", reflect.TypeOf((*MockIMarket)(nil).MessagerGetMessage), arg0, arg1) +} + +// MessagerPushMessage mocks base method. +func (m *MockIMarket) MessagerPushMessage(arg0 context.Context, arg1 *types.Message, arg2 *types0.MessageSendSpec) (cid.Cid, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MessagerPushMessage", arg0, arg1, arg2) + ret0, _ := ret[0].(cid.Cid) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MessagerPushMessage indicates an expected call of MessagerPushMessage. +func (mr *MockIMarketMockRecorder) MessagerPushMessage(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MessagerPushMessage", reflect.TypeOf((*MockIMarket)(nil).MessagerPushMessage), arg0, arg1, arg2) +} + +// MessagerWaitMessage mocks base method. +func (m *MockIMarket) MessagerWaitMessage(arg0 context.Context, arg1 cid.Cid) (*types0.MsgLookup, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MessagerWaitMessage", arg0, arg1) + ret0, _ := ret[0].(*types0.MsgLookup) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MessagerWaitMessage indicates an expected call of MessagerWaitMessage. +func (mr *MockIMarketMockRecorder) MessagerWaitMessage(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MessagerWaitMessage", reflect.TypeOf((*MockIMarket)(nil).MessagerWaitMessage), arg0, arg1) +} + +// NetAddrsListen mocks base method. +func (m *MockIMarket) NetAddrsListen(arg0 context.Context) (peer.AddrInfo, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NetAddrsListen", arg0) + ret0, _ := ret[0].(peer.AddrInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// NetAddrsListen indicates an expected call of NetAddrsListen. +func (mr *MockIMarketMockRecorder) NetAddrsListen(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetAddrsListen", reflect.TypeOf((*MockIMarket)(nil).NetAddrsListen), arg0) +} + +// OfflineDealImport mocks base method. +func (m *MockIMarket) OfflineDealImport(arg0 context.Context, arg1 market.MinerDeal) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OfflineDealImport", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// OfflineDealImport indicates an expected call of OfflineDealImport. +func (mr *MockIMarketMockRecorder) OfflineDealImport(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OfflineDealImport", reflect.TypeOf((*MockIMarket)(nil).OfflineDealImport), arg0, arg1) +} + +// PaychVoucherList mocks base method. +func (m *MockIMarket) PaychVoucherList(arg0 context.Context, arg1 address.Address) ([]*paych.SignedVoucher, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "PaychVoucherList", arg0, arg1) + ret0, _ := ret[0].([]*paych.SignedVoucher) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// PaychVoucherList indicates an expected call of PaychVoucherList. +func (mr *MockIMarketMockRecorder) PaychVoucherList(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychVoucherList", reflect.TypeOf((*MockIMarket)(nil).PaychVoucherList), arg0, arg1) +} + +// PiecesGetCIDInfo mocks base method. +func (m *MockIMarket) PiecesGetCIDInfo(arg0 context.Context, arg1 cid.Cid) (*piecestore.CIDInfo, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "PiecesGetCIDInfo", arg0, arg1) + ret0, _ := ret[0].(*piecestore.CIDInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// PiecesGetCIDInfo indicates an expected call of PiecesGetCIDInfo. +func (mr *MockIMarketMockRecorder) PiecesGetCIDInfo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PiecesGetCIDInfo", reflect.TypeOf((*MockIMarket)(nil).PiecesGetCIDInfo), arg0, arg1) +} + +// PiecesGetPieceInfo mocks base method. +func (m *MockIMarket) PiecesGetPieceInfo(arg0 context.Context, arg1 cid.Cid) (*piecestore.PieceInfo, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "PiecesGetPieceInfo", arg0, arg1) + ret0, _ := ret[0].(*piecestore.PieceInfo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// PiecesGetPieceInfo indicates an expected call of PiecesGetPieceInfo. +func (mr *MockIMarketMockRecorder) PiecesGetPieceInfo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PiecesGetPieceInfo", reflect.TypeOf((*MockIMarket)(nil).PiecesGetPieceInfo), arg0, arg1) +} + +// PiecesListCidInfos mocks base method. +func (m *MockIMarket) PiecesListCidInfos(arg0 context.Context) ([]cid.Cid, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "PiecesListCidInfos", arg0) + ret0, _ := ret[0].([]cid.Cid) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// PiecesListCidInfos indicates an expected call of PiecesListCidInfos. +func (mr *MockIMarketMockRecorder) PiecesListCidInfos(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PiecesListCidInfos", reflect.TypeOf((*MockIMarket)(nil).PiecesListCidInfos), arg0) +} + +// PiecesListPieces mocks base method. +func (m *MockIMarket) PiecesListPieces(arg0 context.Context) ([]cid.Cid, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "PiecesListPieces", arg0) + ret0, _ := ret[0].([]cid.Cid) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// PiecesListPieces indicates an expected call of PiecesListPieces. +func (mr *MockIMarketMockRecorder) PiecesListPieces(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PiecesListPieces", reflect.TypeOf((*MockIMarket)(nil).PiecesListPieces), arg0) +} + +// RemovePieceStorage mocks base method. +func (m *MockIMarket) RemovePieceStorage(arg0 context.Context, arg1 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RemovePieceStorage", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// RemovePieceStorage indicates an expected call of RemovePieceStorage. +func (mr *MockIMarketMockRecorder) RemovePieceStorage(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemovePieceStorage", reflect.TypeOf((*MockIMarket)(nil).RemovePieceStorage), arg0, arg1) +} + +// ResponseMarketEvent mocks base method. +func (m *MockIMarket) ResponseMarketEvent(arg0 context.Context, arg1 *gateway.ResponseEvent) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ResponseMarketEvent", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// ResponseMarketEvent indicates an expected call of ResponseMarketEvent. +func (mr *MockIMarketMockRecorder) ResponseMarketEvent(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResponseMarketEvent", reflect.TypeOf((*MockIMarket)(nil).ResponseMarketEvent), arg0, arg1) +} + +// SectorGetExpectedSealDuration mocks base method. +func (m *MockIMarket) SectorGetExpectedSealDuration(arg0 context.Context, arg1 address.Address) (time.Duration, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SectorGetExpectedSealDuration", arg0, arg1) + ret0, _ := ret[0].(time.Duration) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SectorGetExpectedSealDuration indicates an expected call of SectorGetExpectedSealDuration. +func (mr *MockIMarketMockRecorder) SectorGetExpectedSealDuration(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SectorGetExpectedSealDuration", reflect.TypeOf((*MockIMarket)(nil).SectorGetExpectedSealDuration), arg0, arg1) +} + +// SectorSetExpectedSealDuration mocks base method. +func (m *MockIMarket) SectorSetExpectedSealDuration(arg0 context.Context, arg1 address.Address, arg2 time.Duration) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SectorSetExpectedSealDuration", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// SectorSetExpectedSealDuration indicates an expected call of SectorSetExpectedSealDuration. +func (mr *MockIMarketMockRecorder) SectorSetExpectedSealDuration(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SectorSetExpectedSealDuration", reflect.TypeOf((*MockIMarket)(nil).SectorSetExpectedSealDuration), arg0, arg1, arg2) +} + +// UpdateDealOnPacking mocks base method. +func (m *MockIMarket) 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 *MockIMarketMockRecorder) UpdateDealOnPacking(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDealOnPacking", reflect.TypeOf((*MockIMarket)(nil).UpdateDealOnPacking), arg0, arg1, arg2, arg3, arg4) +} + +// UpdateDealStatus mocks base method. +func (m *MockIMarket) UpdateDealStatus(arg0 context.Context, arg1 address.Address, arg2 abi.DealID, arg3 market.PieceStatus, arg4 uint64) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateDealStatus", arg0, arg1, arg2, arg3, arg4) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateDealStatus indicates an expected call of UpdateDealStatus. +func (mr *MockIMarketMockRecorder) UpdateDealStatus(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDealStatus", reflect.TypeOf((*MockIMarket)(nil).UpdateDealStatus), arg0, arg1, arg2, arg3, arg4) +} + +// UpdateStorageDealStatus mocks base method. +func (m *MockIMarket) UpdateStorageDealStatus(arg0 context.Context, arg1 cid.Cid, arg2 uint64, arg3 market.PieceStatus) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateStorageDealStatus", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateStorageDealStatus indicates an expected call of UpdateStorageDealStatus. +func (mr *MockIMarketMockRecorder) UpdateStorageDealStatus(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateStorageDealStatus", reflect.TypeOf((*MockIMarket)(nil).UpdateStorageDealStatus), arg0, arg1, arg2, arg3) +} + +// Version mocks base method. +func (m *MockIMarket) Version(arg0 context.Context) (types0.Version, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Version", arg0) + ret0, _ := ret[0].(types0.Version) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Version indicates an expected call of Version. +func (mr *MockIMarketMockRecorder) Version(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Version", reflect.TypeOf((*MockIMarket)(nil).Version), arg0) +} diff --git a/venus-shared/api/market/v1/proxy_gen.go b/venus-shared/api/market/v1/proxy_gen.go new file mode 100644 index 0000000000..827caa03cc --- /dev/null +++ b/venus-shared/api/market/v1/proxy_gen.go @@ -0,0 +1,393 @@ +// Code generated by github.com/filecoin-project/venus/venus-devtool/api-gen. DO NOT EDIT. +package v1 + +import ( + "context" + "time" + + address "github.com/filecoin-project/go-address" + datatransfer "github.com/filecoin-project/go-data-transfer" + "github.com/filecoin-project/go-fil-markets/piecestore" + "github.com/filecoin-project/go-fil-markets/retrievalmarket" + "github.com/filecoin-project/go-fil-markets/storagemarket" + "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/builtin/v8/paych" + cid "github.com/ipfs/go-cid" + "github.com/libp2p/go-libp2p/core/peer" + + "github.com/filecoin-project/venus/venus-shared/types" + "github.com/filecoin-project/venus/venus-shared/types/gateway" + "github.com/filecoin-project/venus/venus-shared/types/market" +) + +type IMarketStruct struct { + Internal struct { + ActorDelete func(context.Context, address.Address) error `perm:"admin"` + ActorExist func(ctx context.Context, addr address.Address) (bool, error) `perm:"read"` + ActorList func(context.Context) ([]market.User, error) `perm:"read"` + ActorSectorSize func(context.Context, address.Address) (abi.SectorSize, error) `perm:"read"` + ActorUpsert func(context.Context, market.User) (bool, error) `perm:"admin"` + AddFsPieceStorage func(ctx context.Context, name string, path string, readonly bool) error `perm:"admin"` + AddS3PieceStorage func(ctx context.Context, name, endpoit, bucket, subdir, accessKey, secretKey, token string, readonly bool) error `perm:"admin"` + AssignUnPackedDeals func(ctx context.Context, sid abi.SectorID, ssize abi.SectorSize, spec *market.GetDealSpec) ([]*market.DealInfoIncludePath, error) `perm:"write"` + DagstoreGC func(ctx context.Context) ([]market.DagstoreShardResult, error) `perm:"admin"` + DagstoreInitializeAll func(ctx context.Context, params market.DagstoreInitializeAllParams) (<-chan market.DagstoreInitializeAllEvent, error) `perm:"admin"` + DagstoreInitializeShard func(ctx context.Context, key string) error `perm:"admin"` + DagstoreInitializeStorage func(context.Context, string, market.DagstoreInitializeAllParams) (<-chan market.DagstoreInitializeAllEvent, error) `perm:"admin"` + DagstoreListShards func(ctx context.Context) ([]market.DagstoreShardInfo, error) `perm:"admin"` + DagstoreRecoverShard func(ctx context.Context, key string) error `perm:"admin"` + DealsConsiderOfflineRetrievalDeals func(context.Context, address.Address) (bool, error) `perm:"read"` + DealsConsiderOfflineStorageDeals func(context.Context, address.Address) (bool, error) `perm:"read"` + DealsConsiderOnlineRetrievalDeals func(context.Context, address.Address) (bool, error) `perm:"read"` + DealsConsiderOnlineStorageDeals func(context.Context, address.Address) (bool, error) `perm:"read"` + DealsConsiderUnverifiedStorageDeals func(context.Context, address.Address) (bool, error) `perm:"read"` + DealsConsiderVerifiedStorageDeals func(context.Context, address.Address) (bool, error) `perm:"read"` + DealsImportData func(ctx context.Context, dealPropCid cid.Cid, file string) error `perm:"admin"` + DealsMaxProviderCollateralMultiplier func(context.Context, address.Address) (uint64, error) `perm:"read"` + DealsMaxPublishFee func(context.Context, address.Address) (types.FIL, error) `perm:"read"` + DealsMaxStartDelay func(context.Context, address.Address) (time.Duration, error) `perm:"read"` + DealsPieceCidBlocklist func(context.Context, address.Address) ([]cid.Cid, error) `perm:"read"` + DealsPublishMsgPeriod func(context.Context, address.Address) (time.Duration, error) `perm:"read"` + DealsSetConsiderOfflineRetrievalDeals func(context.Context, address.Address, bool) error `perm:"write"` + DealsSetConsiderOfflineStorageDeals func(context.Context, address.Address, bool) error `perm:"write"` + DealsSetConsiderOnlineRetrievalDeals func(context.Context, address.Address, bool) error `perm:"write"` + DealsSetConsiderOnlineStorageDeals func(context.Context, address.Address, bool) error `perm:"write"` + DealsSetConsiderUnverifiedStorageDeals func(context.Context, address.Address, bool) error `perm:"write"` + DealsSetConsiderVerifiedStorageDeals func(context.Context, address.Address, bool) error `perm:"write"` + DealsSetMaxProviderCollateralMultiplier func(context.Context, address.Address, uint64) error `perm:"write"` + DealsSetMaxPublishFee func(context.Context, address.Address, types.FIL) error `perm:"write"` + DealsSetMaxStartDelay func(context.Context, address.Address, time.Duration) error `perm:"write"` + DealsSetPieceCidBlocklist func(context.Context, address.Address, []cid.Cid) error `perm:"write"` + DealsSetPublishMsgPeriod func(context.Context, address.Address, time.Duration) error `perm:"write"` + GetDeals func(ctx context.Context, miner address.Address, pageIndex, pageSize int) ([]*market.DealInfo, error) `perm:"read"` + GetRetrievalDealStatistic func(ctx context.Context, miner address.Address) (*market.RetrievalDealStatistic, error) `perm:"read"` + GetStorageDealStatistic func(ctx context.Context, miner address.Address) (*market.StorageDealStatistic, error) `perm:"read"` + GetUnPackedDeals func(ctx context.Context, miner address.Address, spec *market.GetDealSpec) ([]*market.DealInfoIncludePath, error) `perm:"read"` + ID func(context.Context) (peer.ID, error) `perm:"read"` + ListPieceStorageInfos func(ctx context.Context) market.PieceStorageInfos `perm:"read"` + ListenMarketEvent func(ctx context.Context, policy *gateway.MarketRegisterPolicy) (<-chan *gateway.RequestEvent, error) `perm:"read"` + MarkDealsAsPacking func(ctx context.Context, miner address.Address, deals []abi.DealID) error `perm:"write"` + MarketAddBalance func(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error) `perm:"sign"` + MarketCancelDataTransfer func(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error `perm:"admin"` + MarketDataTransferPath func(context.Context, address.Address) (string, error) `perm:"admin"` + MarketDataTransferUpdates func(ctx context.Context) (<-chan market.DataTransferChannel, error) `perm:"admin"` + MarketGetAsk func(ctx context.Context, mAddr address.Address) (*market.SignedStorageAsk, error) `perm:"read"` + MarketGetDealUpdates func(ctx context.Context) (<-chan market.MinerDeal, error) `perm:"admin"` + MarketGetReserved func(ctx context.Context, addr address.Address) (types.BigInt, error) `perm:"sign"` + MarketGetRetrievalAsk func(ctx context.Context, mAddr address.Address) (*retrievalmarket.Ask, error) `perm:"read"` + MarketImportDealData func(ctx context.Context, propcid cid.Cid, path string) error `perm:"admin"` + MarketImportPublishedDeal func(ctx context.Context, deal market.MinerDeal) error `perm:"write"` + MarketListDataTransfers func(ctx context.Context) ([]market.DataTransferChannel, error) `perm:"admin"` + MarketListDeals func(ctx context.Context, addrs []address.Address) ([]*types.MarketDeal, error) `perm:"read"` + MarketListIncompleteDeals func(ctx context.Context, mAddr address.Address) ([]market.MinerDeal, error) `perm:"read"` + MarketListRetrievalAsk func(ctx context.Context) ([]*market.RetrievalAsk, error) `perm:"read"` + MarketListRetrievalDeals func(ctx context.Context) ([]market.ProviderDealState, error) `perm:"read"` + MarketListStorageAsk func(ctx context.Context) ([]*market.SignedStorageAsk, error) `perm:"read"` + MarketMaxBalanceAddFee func(context.Context, address.Address) (types.FIL, error) `perm:"read"` + MarketMaxDealsPerPublishMsg func(context.Context, address.Address) (uint64, error) `perm:"read"` + MarketPendingDeals func(ctx context.Context) ([]market.PendingDealInfo, error) `perm:"write"` + MarketPublishPendingDeals func(ctx context.Context) error `perm:"admin"` + MarketReleaseFunds func(ctx context.Context, addr address.Address, amt types.BigInt) error `perm:"sign"` + MarketReserveFunds func(ctx context.Context, wallet address.Address, addr address.Address, amt types.BigInt) (cid.Cid, error) `perm:"sign"` + MarketRestartDataTransfer func(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error `perm:"admin"` + MarketSetAsk func(ctx context.Context, mAddr address.Address, price types.BigInt, verifiedPrice types.BigInt, duration abi.ChainEpoch, minPieceSize abi.PaddedPieceSize, maxPieceSize abi.PaddedPieceSize) error `perm:"admin"` + MarketSetDataTransferPath func(context.Context, address.Address, string) error `perm:"admin"` + MarketSetMaxBalanceAddFee func(context.Context, address.Address, types.FIL) error `perm:"write"` + MarketSetMaxDealsPerPublishMsg func(context.Context, address.Address, uint64) error `perm:"write"` + MarketSetRetrievalAsk func(ctx context.Context, mAddr address.Address, rask *retrievalmarket.Ask) error `perm:"admin"` + MarketWithdraw func(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error) `perm:"sign"` + MessagerGetMessage func(ctx context.Context, mid cid.Cid) (*types.Message, error) `perm:"read"` + MessagerPushMessage func(ctx context.Context, msg *types.Message, meta *types.MessageSendSpec) (cid.Cid, error) `perm:"write"` + MessagerWaitMessage func(ctx context.Context, mid cid.Cid) (*types.MsgLookup, error) `perm:"read"` + NetAddrsListen func(context.Context) (peer.AddrInfo, error) `perm:"read"` + OfflineDealImport func(ctx context.Context, deal market.MinerDeal) error `perm:"admin"` + PaychVoucherList func(ctx context.Context, pch address.Address) ([]*paych.SignedVoucher, error) `perm:"read"` + PiecesGetCIDInfo func(ctx context.Context, payloadCid cid.Cid) (*piecestore.CIDInfo, error) `perm:"read"` + PiecesGetPieceInfo func(ctx context.Context, pieceCid cid.Cid) (*piecestore.PieceInfo, error) `perm:"read"` + PiecesListCidInfos func(ctx context.Context) ([]cid.Cid, error) `perm:"read"` + PiecesListPieces func(ctx context.Context) ([]cid.Cid, error) `perm:"read"` + RemovePieceStorage func(ctx context.Context, name string) error `perm:"admin"` + ResponseMarketEvent func(ctx context.Context, resp *gateway.ResponseEvent) error `perm:"read"` + SectorGetExpectedSealDuration func(context.Context, address.Address) (time.Duration, error) `perm:"read"` + SectorSetExpectedSealDuration func(context.Context, address.Address, time.Duration) error `perm:"write"` + UpdateDealOnPacking func(ctx context.Context, miner address.Address, dealID abi.DealID, sectorid abi.SectorNumber, offset abi.PaddedPieceSize) error `perm:"write"` + UpdateDealStatus func(ctx context.Context, miner address.Address, dealID abi.DealID, pieceStatus market.PieceStatus, dealStatus storagemarket.StorageDealStatus) error `perm:"write"` + UpdateStorageDealStatus func(ctx context.Context, dealProposalCid cid.Cid, state storagemarket.StorageDealStatus, pieceState market.PieceStatus) error `perm:"write"` + Version func(ctx context.Context) (types.Version, error) `perm:"read"` + } +} + +func (s *IMarketStruct) ActorDelete(p0 context.Context, p1 address.Address) error { + return s.Internal.ActorDelete(p0, p1) +} +func (s *IMarketStruct) ActorExist(p0 context.Context, p1 address.Address) (bool, error) { + return s.Internal.ActorExist(p0, p1) +} +func (s *IMarketStruct) ActorList(p0 context.Context) ([]market.User, error) { + return s.Internal.ActorList(p0) +} +func (s *IMarketStruct) ActorSectorSize(p0 context.Context, p1 address.Address) (abi.SectorSize, error) { + return s.Internal.ActorSectorSize(p0, p1) +} +func (s *IMarketStruct) ActorUpsert(p0 context.Context, p1 market.User) (bool, error) { + return s.Internal.ActorUpsert(p0, p1) +} +func (s *IMarketStruct) AddFsPieceStorage(p0 context.Context, p1 string, p2 string, p3 bool) error { + return s.Internal.AddFsPieceStorage(p0, p1, p2, p3) +} +func (s *IMarketStruct) AddS3PieceStorage(p0 context.Context, p1, p2, p3, p4, p5, p6, p7 string, p8 bool) error { + return s.Internal.AddS3PieceStorage(p0, p1, p2, p3, p4, p5, p6, p7, p8) +} +func (s *IMarketStruct) AssignUnPackedDeals(p0 context.Context, p1 abi.SectorID, p2 abi.SectorSize, p3 *market.GetDealSpec) ([]*market.DealInfoIncludePath, error) { + return s.Internal.AssignUnPackedDeals(p0, p1, p2, p3) +} +func (s *IMarketStruct) DagstoreGC(p0 context.Context) ([]market.DagstoreShardResult, error) { + return s.Internal.DagstoreGC(p0) +} +func (s *IMarketStruct) DagstoreInitializeAll(p0 context.Context, p1 market.DagstoreInitializeAllParams) (<-chan market.DagstoreInitializeAllEvent, error) { + return s.Internal.DagstoreInitializeAll(p0, p1) +} +func (s *IMarketStruct) DagstoreInitializeShard(p0 context.Context, p1 string) error { + return s.Internal.DagstoreInitializeShard(p0, p1) +} +func (s *IMarketStruct) DagstoreInitializeStorage(p0 context.Context, p1 string, p2 market.DagstoreInitializeAllParams) (<-chan market.DagstoreInitializeAllEvent, error) { + return s.Internal.DagstoreInitializeStorage(p0, p1, p2) +} +func (s *IMarketStruct) DagstoreListShards(p0 context.Context) ([]market.DagstoreShardInfo, error) { + return s.Internal.DagstoreListShards(p0) +} +func (s *IMarketStruct) DagstoreRecoverShard(p0 context.Context, p1 string) error { + return s.Internal.DagstoreRecoverShard(p0, p1) +} +func (s *IMarketStruct) DealsConsiderOfflineRetrievalDeals(p0 context.Context, p1 address.Address) (bool, error) { + return s.Internal.DealsConsiderOfflineRetrievalDeals(p0, p1) +} +func (s *IMarketStruct) DealsConsiderOfflineStorageDeals(p0 context.Context, p1 address.Address) (bool, error) { + return s.Internal.DealsConsiderOfflineStorageDeals(p0, p1) +} +func (s *IMarketStruct) DealsConsiderOnlineRetrievalDeals(p0 context.Context, p1 address.Address) (bool, error) { + return s.Internal.DealsConsiderOnlineRetrievalDeals(p0, p1) +} +func (s *IMarketStruct) DealsConsiderOnlineStorageDeals(p0 context.Context, p1 address.Address) (bool, error) { + return s.Internal.DealsConsiderOnlineStorageDeals(p0, p1) +} +func (s *IMarketStruct) DealsConsiderUnverifiedStorageDeals(p0 context.Context, p1 address.Address) (bool, error) { + return s.Internal.DealsConsiderUnverifiedStorageDeals(p0, p1) +} +func (s *IMarketStruct) DealsConsiderVerifiedStorageDeals(p0 context.Context, p1 address.Address) (bool, error) { + return s.Internal.DealsConsiderVerifiedStorageDeals(p0, p1) +} +func (s *IMarketStruct) DealsImportData(p0 context.Context, p1 cid.Cid, p2 string) error { + return s.Internal.DealsImportData(p0, p1, p2) +} +func (s *IMarketStruct) DealsMaxProviderCollateralMultiplier(p0 context.Context, p1 address.Address) (uint64, error) { + return s.Internal.DealsMaxProviderCollateralMultiplier(p0, p1) +} +func (s *IMarketStruct) DealsMaxPublishFee(p0 context.Context, p1 address.Address) (types.FIL, error) { + return s.Internal.DealsMaxPublishFee(p0, p1) +} +func (s *IMarketStruct) DealsMaxStartDelay(p0 context.Context, p1 address.Address) (time.Duration, error) { + return s.Internal.DealsMaxStartDelay(p0, p1) +} +func (s *IMarketStruct) DealsPieceCidBlocklist(p0 context.Context, p1 address.Address) ([]cid.Cid, error) { + return s.Internal.DealsPieceCidBlocklist(p0, p1) +} +func (s *IMarketStruct) DealsPublishMsgPeriod(p0 context.Context, p1 address.Address) (time.Duration, error) { + return s.Internal.DealsPublishMsgPeriod(p0, p1) +} +func (s *IMarketStruct) DealsSetConsiderOfflineRetrievalDeals(p0 context.Context, p1 address.Address, p2 bool) error { + return s.Internal.DealsSetConsiderOfflineRetrievalDeals(p0, p1, p2) +} +func (s *IMarketStruct) DealsSetConsiderOfflineStorageDeals(p0 context.Context, p1 address.Address, p2 bool) error { + return s.Internal.DealsSetConsiderOfflineStorageDeals(p0, p1, p2) +} +func (s *IMarketStruct) DealsSetConsiderOnlineRetrievalDeals(p0 context.Context, p1 address.Address, p2 bool) error { + return s.Internal.DealsSetConsiderOnlineRetrievalDeals(p0, p1, p2) +} +func (s *IMarketStruct) DealsSetConsiderOnlineStorageDeals(p0 context.Context, p1 address.Address, p2 bool) error { + return s.Internal.DealsSetConsiderOnlineStorageDeals(p0, p1, p2) +} +func (s *IMarketStruct) DealsSetConsiderUnverifiedStorageDeals(p0 context.Context, p1 address.Address, p2 bool) error { + return s.Internal.DealsSetConsiderUnverifiedStorageDeals(p0, p1, p2) +} +func (s *IMarketStruct) DealsSetConsiderVerifiedStorageDeals(p0 context.Context, p1 address.Address, p2 bool) error { + return s.Internal.DealsSetConsiderVerifiedStorageDeals(p0, p1, p2) +} +func (s *IMarketStruct) DealsSetMaxProviderCollateralMultiplier(p0 context.Context, p1 address.Address, p2 uint64) error { + return s.Internal.DealsSetMaxProviderCollateralMultiplier(p0, p1, p2) +} +func (s *IMarketStruct) DealsSetMaxPublishFee(p0 context.Context, p1 address.Address, p2 types.FIL) error { + return s.Internal.DealsSetMaxPublishFee(p0, p1, p2) +} +func (s *IMarketStruct) DealsSetMaxStartDelay(p0 context.Context, p1 address.Address, p2 time.Duration) error { + return s.Internal.DealsSetMaxStartDelay(p0, p1, p2) +} +func (s *IMarketStruct) DealsSetPieceCidBlocklist(p0 context.Context, p1 address.Address, p2 []cid.Cid) error { + return s.Internal.DealsSetPieceCidBlocklist(p0, p1, p2) +} +func (s *IMarketStruct) DealsSetPublishMsgPeriod(p0 context.Context, p1 address.Address, p2 time.Duration) error { + return s.Internal.DealsSetPublishMsgPeriod(p0, p1, p2) +} +func (s *IMarketStruct) GetDeals(p0 context.Context, p1 address.Address, p2, p3 int) ([]*market.DealInfo, error) { + return s.Internal.GetDeals(p0, p1, p2, p3) +} +func (s *IMarketStruct) GetRetrievalDealStatistic(p0 context.Context, p1 address.Address) (*market.RetrievalDealStatistic, error) { + return s.Internal.GetRetrievalDealStatistic(p0, p1) +} +func (s *IMarketStruct) GetStorageDealStatistic(p0 context.Context, p1 address.Address) (*market.StorageDealStatistic, error) { + return s.Internal.GetStorageDealStatistic(p0, p1) +} +func (s *IMarketStruct) GetUnPackedDeals(p0 context.Context, p1 address.Address, p2 *market.GetDealSpec) ([]*market.DealInfoIncludePath, error) { + return s.Internal.GetUnPackedDeals(p0, p1, p2) +} +func (s *IMarketStruct) ID(p0 context.Context) (peer.ID, error) { return s.Internal.ID(p0) } +func (s *IMarketStruct) ListPieceStorageInfos(p0 context.Context) market.PieceStorageInfos { + return s.Internal.ListPieceStorageInfos(p0) +} +func (s *IMarketStruct) ListenMarketEvent(p0 context.Context, p1 *gateway.MarketRegisterPolicy) (<-chan *gateway.RequestEvent, error) { + return s.Internal.ListenMarketEvent(p0, p1) +} +func (s *IMarketStruct) MarkDealsAsPacking(p0 context.Context, p1 address.Address, p2 []abi.DealID) error { + return s.Internal.MarkDealsAsPacking(p0, p1, p2) +} +func (s *IMarketStruct) MarketAddBalance(p0 context.Context, p1, p2 address.Address, p3 types.BigInt) (cid.Cid, error) { + return s.Internal.MarketAddBalance(p0, p1, p2, p3) +} +func (s *IMarketStruct) MarketCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { + return s.Internal.MarketCancelDataTransfer(p0, p1, p2, p3) +} +func (s *IMarketStruct) MarketDataTransferPath(p0 context.Context, p1 address.Address) (string, error) { + return s.Internal.MarketDataTransferPath(p0, p1) +} +func (s *IMarketStruct) MarketDataTransferUpdates(p0 context.Context) (<-chan market.DataTransferChannel, error) { + return s.Internal.MarketDataTransferUpdates(p0) +} +func (s *IMarketStruct) MarketGetAsk(p0 context.Context, p1 address.Address) (*market.SignedStorageAsk, error) { + return s.Internal.MarketGetAsk(p0, p1) +} +func (s *IMarketStruct) MarketGetDealUpdates(p0 context.Context) (<-chan market.MinerDeal, error) { + return s.Internal.MarketGetDealUpdates(p0) +} +func (s *IMarketStruct) MarketGetReserved(p0 context.Context, p1 address.Address) (types.BigInt, error) { + return s.Internal.MarketGetReserved(p0, p1) +} +func (s *IMarketStruct) MarketGetRetrievalAsk(p0 context.Context, p1 address.Address) (*retrievalmarket.Ask, error) { + return s.Internal.MarketGetRetrievalAsk(p0, p1) +} +func (s *IMarketStruct) MarketImportDealData(p0 context.Context, p1 cid.Cid, p2 string) error { + return s.Internal.MarketImportDealData(p0, p1, p2) +} +func (s *IMarketStruct) MarketImportPublishedDeal(p0 context.Context, p1 market.MinerDeal) error { + return s.Internal.MarketImportPublishedDeal(p0, p1) +} +func (s *IMarketStruct) MarketListDataTransfers(p0 context.Context) ([]market.DataTransferChannel, error) { + return s.Internal.MarketListDataTransfers(p0) +} +func (s *IMarketStruct) MarketListDeals(p0 context.Context, p1 []address.Address) ([]*types.MarketDeal, error) { + return s.Internal.MarketListDeals(p0, p1) +} +func (s *IMarketStruct) MarketListIncompleteDeals(p0 context.Context, p1 address.Address) ([]market.MinerDeal, error) { + return s.Internal.MarketListIncompleteDeals(p0, p1) +} +func (s *IMarketStruct) MarketListRetrievalAsk(p0 context.Context) ([]*market.RetrievalAsk, error) { + return s.Internal.MarketListRetrievalAsk(p0) +} +func (s *IMarketStruct) MarketListRetrievalDeals(p0 context.Context) ([]market.ProviderDealState, error) { + return s.Internal.MarketListRetrievalDeals(p0) +} +func (s *IMarketStruct) MarketListStorageAsk(p0 context.Context) ([]*market.SignedStorageAsk, error) { + return s.Internal.MarketListStorageAsk(p0) +} +func (s *IMarketStruct) MarketMaxBalanceAddFee(p0 context.Context, p1 address.Address) (types.FIL, error) { + return s.Internal.MarketMaxBalanceAddFee(p0, p1) +} +func (s *IMarketStruct) MarketMaxDealsPerPublishMsg(p0 context.Context, p1 address.Address) (uint64, error) { + return s.Internal.MarketMaxDealsPerPublishMsg(p0, p1) +} +func (s *IMarketStruct) MarketPendingDeals(p0 context.Context) ([]market.PendingDealInfo, error) { + return s.Internal.MarketPendingDeals(p0) +} +func (s *IMarketStruct) MarketPublishPendingDeals(p0 context.Context) error { + return s.Internal.MarketPublishPendingDeals(p0) +} +func (s *IMarketStruct) MarketReleaseFunds(p0 context.Context, p1 address.Address, p2 types.BigInt) error { + return s.Internal.MarketReleaseFunds(p0, p1, p2) +} +func (s *IMarketStruct) MarketReserveFunds(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) { + return s.Internal.MarketReserveFunds(p0, p1, p2, p3) +} +func (s *IMarketStruct) MarketRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { + return s.Internal.MarketRestartDataTransfer(p0, p1, p2, p3) +} +func (s *IMarketStruct) MarketSetAsk(p0 context.Context, p1 address.Address, p2 types.BigInt, p3 types.BigInt, p4 abi.ChainEpoch, p5 abi.PaddedPieceSize, p6 abi.PaddedPieceSize) error { + return s.Internal.MarketSetAsk(p0, p1, p2, p3, p4, p5, p6) +} +func (s *IMarketStruct) MarketSetDataTransferPath(p0 context.Context, p1 address.Address, p2 string) error { + return s.Internal.MarketSetDataTransferPath(p0, p1, p2) +} +func (s *IMarketStruct) MarketSetMaxBalanceAddFee(p0 context.Context, p1 address.Address, p2 types.FIL) error { + return s.Internal.MarketSetMaxBalanceAddFee(p0, p1, p2) +} +func (s *IMarketStruct) MarketSetMaxDealsPerPublishMsg(p0 context.Context, p1 address.Address, p2 uint64) error { + return s.Internal.MarketSetMaxDealsPerPublishMsg(p0, p1, p2) +} +func (s *IMarketStruct) MarketSetRetrievalAsk(p0 context.Context, p1 address.Address, p2 *retrievalmarket.Ask) error { + return s.Internal.MarketSetRetrievalAsk(p0, p1, p2) +} +func (s *IMarketStruct) MarketWithdraw(p0 context.Context, p1, p2 address.Address, p3 types.BigInt) (cid.Cid, error) { + return s.Internal.MarketWithdraw(p0, p1, p2, p3) +} +func (s *IMarketStruct) MessagerGetMessage(p0 context.Context, p1 cid.Cid) (*types.Message, error) { + return s.Internal.MessagerGetMessage(p0, p1) +} +func (s *IMarketStruct) MessagerPushMessage(p0 context.Context, p1 *types.Message, p2 *types.MessageSendSpec) (cid.Cid, error) { + return s.Internal.MessagerPushMessage(p0, p1, p2) +} +func (s *IMarketStruct) MessagerWaitMessage(p0 context.Context, p1 cid.Cid) (*types.MsgLookup, error) { + return s.Internal.MessagerWaitMessage(p0, p1) +} +func (s *IMarketStruct) NetAddrsListen(p0 context.Context) (peer.AddrInfo, error) { + return s.Internal.NetAddrsListen(p0) +} +func (s *IMarketStruct) OfflineDealImport(p0 context.Context, p1 market.MinerDeal) error { + return s.Internal.OfflineDealImport(p0, p1) +} +func (s *IMarketStruct) PaychVoucherList(p0 context.Context, p1 address.Address) ([]*paych.SignedVoucher, error) { + return s.Internal.PaychVoucherList(p0, p1) +} +func (s *IMarketStruct) PiecesGetCIDInfo(p0 context.Context, p1 cid.Cid) (*piecestore.CIDInfo, error) { + return s.Internal.PiecesGetCIDInfo(p0, p1) +} +func (s *IMarketStruct) PiecesGetPieceInfo(p0 context.Context, p1 cid.Cid) (*piecestore.PieceInfo, error) { + return s.Internal.PiecesGetPieceInfo(p0, p1) +} +func (s *IMarketStruct) PiecesListCidInfos(p0 context.Context) ([]cid.Cid, error) { + return s.Internal.PiecesListCidInfos(p0) +} +func (s *IMarketStruct) PiecesListPieces(p0 context.Context) ([]cid.Cid, error) { + return s.Internal.PiecesListPieces(p0) +} +func (s *IMarketStruct) RemovePieceStorage(p0 context.Context, p1 string) error { + return s.Internal.RemovePieceStorage(p0, p1) +} +func (s *IMarketStruct) ResponseMarketEvent(p0 context.Context, p1 *gateway.ResponseEvent) error { + return s.Internal.ResponseMarketEvent(p0, p1) +} +func (s *IMarketStruct) SectorGetExpectedSealDuration(p0 context.Context, p1 address.Address) (time.Duration, error) { + return s.Internal.SectorGetExpectedSealDuration(p0, p1) +} +func (s *IMarketStruct) SectorSetExpectedSealDuration(p0 context.Context, p1 address.Address, p2 time.Duration) error { + return s.Internal.SectorSetExpectedSealDuration(p0, p1, p2) +} +func (s *IMarketStruct) UpdateDealOnPacking(p0 context.Context, p1 address.Address, p2 abi.DealID, p3 abi.SectorNumber, p4 abi.PaddedPieceSize) error { + return s.Internal.UpdateDealOnPacking(p0, p1, p2, p3, p4) +} +func (s *IMarketStruct) UpdateDealStatus(p0 context.Context, p1 address.Address, p2 abi.DealID, p3 market.PieceStatus, p4 storagemarket.StorageDealStatus) error { + return s.Internal.UpdateDealStatus(p0, p1, p2, p3, p4) +} +func (s *IMarketStruct) UpdateStorageDealStatus(p0 context.Context, p1 cid.Cid, p2 storagemarket.StorageDealStatus, p3 market.PieceStatus) error { + return s.Internal.UpdateStorageDealStatus(p0, p1, p2, p3) +} +func (s *IMarketStruct) Version(p0 context.Context) (types.Version, error) { + return s.Internal.Version(p0) +} diff --git a/venus-shared/compatible-checks/api-checksum.txt b/venus-shared/compatible-checks/api-checksum.txt index fb21d2eb6c..3f1b82f610 100644 --- a/venus-shared/compatible-checks/api-checksum.txt +++ b/venus-shared/compatible-checks/api-checksum.txt @@ -284,6 +284,7 @@ api.FullNode: CreateBackup: In=2, Out=1, CheckSum=7b0679c2c73ab9606a7da21c5251ad19 Discover: In=1, Out=2, CheckSum=09640e20c6d71c3e96c7a56c8698acc9 EthAccounts: In=1, Out=2, CheckSum=d2d1b2a1ffc7dc9b28e8c64c79147670 + EthAddressToFilecoinAddress: In=2, Out=2, CheckSum=d1ca5904502264aa05b428089d46d660 EthBlockNumber: In=1, Out=2, CheckSum=442f3dc12ea5a22b7b8fea633069692a EthCall: In=3, Out=2, CheckSum=64610416ed5674a0c717908d51904008 EthChainId: In=1, Out=2, CheckSum=442f3dc12ea5a22b7b8fea633069692a @@ -316,6 +317,7 @@ api.FullNode: EthSubscribe: In=2, Out=2, CheckSum=f63e0b205164d628bc8022b6d5a496f5 EthUninstallFilter: In=2, Out=2, CheckSum=eaa6a477ffaae115413457bbdb11e339 EthUnsubscribe: In=2, Out=2, CheckSum=eaa6a477ffaae115413457bbdb11e339 + FilecoinAddressToEthAddress: In=2, Out=2, CheckSum=13a0b5ce8f82604e17803a00c4086c4c GasEstimateFeeCap: In=4, Out=2, CheckSum=0fcac02de1d21c9ac6e10696a6499eba GasEstimateGasLimit: In=3, Out=2, CheckSum=4d1bd57eef0ee90d4c2e89f097d0604d GasEstimateGasPremium: In=5, Out=2, CheckSum=550724ed37e2fdaa64e55147e82214b1 diff --git a/venus-shared/compatible-checks/api-diff.txt b/venus-shared/compatible-checks/api-diff.txt index 7dcdf06f5f..1618742131 100644 --- a/venus-shared/compatible-checks/api-diff.txt +++ b/venus-shared/compatible-checks/api-diff.txt @@ -54,7 +54,6 @@ github.com/filecoin-project/venus/venus-shared/api/chain/v0.FullNode <> github.c - MarketReleaseFunds - MarketReserveFunds - MarketWithdraw - + MessageWait > MpoolBatchPushMessage {[func(context.Context, []*types.Message, *types.MessageSendSpec) ([]*types.SignedMessage, error) <> func(context.Context, []*types.Message, *api.MessageSendSpec) ([]*types.SignedMessage, error)] base=func in type: #2 input; nested={[*types.MessageSendSpec <> *api.MessageSendSpec] base=pointed type; nested={[types.MessageSendSpec <> api.MessageSendSpec] base=struct field; nested={[types.MessageSendSpec <> api.MessageSendSpec] base=exported fields count: 3 != 2; nested=nil}}}} + MpoolDeleteByAdress + MpoolPublishByAddr @@ -93,7 +92,6 @@ github.com/filecoin-project/venus/venus-shared/api/chain/v0.FullNode <> github.c - Shutdown - StateAllMinerFaults - StateChangedActors - - StateCompute - StateDecodeParams > 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: 22 != 23; nested=nil}}}}}} - StateGetRandomnessFromBeacon @@ -183,7 +181,6 @@ github.com/filecoin-project/venus/venus-shared/api/chain/v1.FullNode <> github.c - MarketReleaseFunds - MarketReserveFunds - MarketWithdraw - + MessageWait > MpoolBatchPushMessage {[func(context.Context, []*types.Message, *types.MessageSendSpec) ([]*types.SignedMessage, error) <> func(context.Context, []*types.Message, *api.MessageSendSpec) ([]*types.SignedMessage, error)] base=func in type: #2 input; nested={[*types.MessageSendSpec <> *api.MessageSendSpec] base=pointed type; nested={[types.MessageSendSpec <> api.MessageSendSpec] base=struct field; nested={[types.MessageSendSpec <> api.MessageSendSpec] base=exported fields count: 3 != 2; nested=nil}}}} + MpoolDeleteByAdress + MpoolPublishByAddr @@ -223,7 +220,6 @@ github.com/filecoin-project/venus/venus-shared/api/chain/v1.FullNode <> github.c + SetConcurrent + SetPassword - Shutdown - - StateCompute > 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: 22 != 23; nested=nil}}}}}} + StateMinerSectorSize + StateMinerWorkerAddress diff --git a/venus-shared/compatible-checks/api-perm.txt b/venus-shared/compatible-checks/api-perm.txt index 2da634626e..1abfaa8248 100644 --- a/venus-shared/compatible-checks/api-perm.txt +++ b/venus-shared/compatible-checks/api-perm.txt @@ -8,7 +8,6 @@ v0: github.com/filecoin-project/venus/venus-shared/api/chain/v0 <> github.com/fi - IChainInfo.GetEntry - IChainInfo.GetFullBlock - IChainInfo.GetParentStateRootActor - - IChainInfo.MessageWait - IChainInfo.ProtocolParameters - IChainInfo.ResolveToKeyAddr - IChainInfo.VerifyEntry @@ -62,7 +61,6 @@ v1: github.com/filecoin-project/venus/venus-shared/api/chain/v1 <> github.com/fi - IChainInfo.GetEntry - IChainInfo.GetFullBlock - IChainInfo.GetParentStateRootActor - - IChainInfo.MessageWait - IChainInfo.ProtocolParameters - IChainInfo.ResolveToKeyAddr - IChainInfo.VerifyEntry diff --git a/venus-shared/types/api_types.go b/venus-shared/types/api_types.go index 58ecaecca0..eeb3c05b81 100644 --- a/venus-shared/types/api_types.go +++ b/venus-shared/types/api_types.go @@ -45,7 +45,7 @@ type ObjStat struct { // ChainMessage is an on-chain message with its block and receipt. type ChainMessage struct { //nolint TS *TipSet - Message *Message + Message ChainMsg Block *BlockHeader Receipt *MessageReceipt } diff --git a/venus-shared/types/eth.go b/venus-shared/types/eth.go index 5e96a9a238..f19e73df8a 100644 --- a/venus-shared/types/eth.go +++ b/venus-shared/types/eth.go @@ -57,8 +57,10 @@ var ( EthBloomSet = types.EthBloomSet EthHashFromCid = types.EthHashFromCid EthHashFromTxBytes = types.EthHashFromTxBytes + EthUint64FromBytes = types.EthUint64FromBytes EthUint64FromHex = types.EthUint64FromHex GetContractEthAddressFromCode = types.GetContractEthAddressFromCode + IsEthAddress = types.IsEthAddress NewEthBlock = types.NewEthBlock ParseEthAddress = types.ParseEthAddress ParseEthHash = types.ParseEthHash