From 1682eca1a099bfed5bf8714e53a370ebe44d12b8 Mon Sep 17 00:00:00 2001 From: tom <69969590+simlecode@users.noreply.github.com> Date: Fri, 23 Sep 2022 13:13:17 +0800 Subject: [PATCH] feat: add api `StateComputeDataCID` and refactor api `StateSectorPreCommitInfo` (#5318) --- app/submodule/chain/chaininfo_api.go | 27 ++ app/submodule/chain/miner_api.go | 80 +++- app/submodule/chain/v0api/chaininfo_v0api.go | 15 + app/submodule/syncer/syncer_api.go | 34 +- cmd/dispute.go | 6 +- venus-shared/api/chain/v0/chain.go | 3 +- venus-shared/api/chain/v0/method.md | 340 ++++++++-------- venus-shared/api/chain/v0/proxy_gen.go | 22 +- venus-shared/api/chain/v0/syncer.go | 15 +- venus-shared/api/chain/v1/chain.go | 63 +-- venus-shared/api/chain/v1/method.md | 379 ++++++++++-------- .../api/chain/v1/mock/mock_fullnode.go | 19 +- venus-shared/api/chain/v1/proxy_gen.go | 102 ++--- venus-shared/api/chain/v1/syncer.go | 15 +- venus-shared/api/chain/version.go | 2 +- venus-shared/api/gateway/v0/method.md | 2 +- venus-shared/api/gateway/v1/method.md | 2 +- venus-shared/api/market/client/method.md | 2 +- venus-shared/api/market/method.md | 2 +- venus-shared/api/messager/method.md | 2 +- venus-shared/api/wallet/method.md | 2 +- venus-shared/compatible-checks/api-diff.txt | 2 - 22 files changed, 636 insertions(+), 500 deletions(-) diff --git a/app/submodule/chain/chaininfo_api.go b/app/submodule/chain/chaininfo_api.go index e9098d24f2..50b4dadb17 100644 --- a/app/submodule/chain/chaininfo_api.go +++ b/app/submodule/chain/chaininfo_api.go @@ -719,3 +719,30 @@ func (cia *chainInfoAPI) StateActorManifestCID(ctx context.Context, nv network.V return c, nil } + +// StateCall runs the given message and returns its result without any persisted changes. +// +// StateCall applies the message to the tipset's parent state. The +// message is not applied on-top-of the messages in the passed-in +// tipset. +func (cia *chainInfoAPI) StateCall(ctx context.Context, msg *types.Message, tsk types.TipSetKey) (*types.InvocResult, error) { + start := time.Now() + ts, err := cia.chain.ChainReader.GetTipSet(ctx, tsk) + if err != nil { + return nil, fmt.Errorf("loading tipset %s: %v", tsk, err) + } + ret, err := cia.chain.Stmgr.Call(ctx, msg, ts) + if err != nil { + return nil, err + } + duration := time.Since(start) + + mcid := msg.Cid() + return &types.InvocResult{ + MsgCid: mcid, + Msg: msg, + MsgRct: &ret.Receipt, + ExecutionTrace: types.ExecutionTrace{}, + Duration: duration, + }, nil +} diff --git a/app/submodule/chain/miner_api.go b/app/submodule/chain/miner_api.go index 89600f9fbe..9a1f9dbfb5 100644 --- a/app/submodule/chain/miner_api.go +++ b/app/submodule/chain/miner_api.go @@ -14,14 +14,18 @@ import ( "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/cbor" "github.com/filecoin-project/go-state-types/dline" + "github.com/filecoin-project/go-state-types/network" "github.com/ipfs/go-cid" cbornode "github.com/ipfs/go-ipld-cbor" "github.com/libp2p/go-libp2p-core/peer" cbg "github.com/whyrusleeping/cbor-gen" "github.com/filecoin-project/go-state-types/builtin/v8/miner" + market2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/market" + market5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/market" "github.com/filecoin-project/venus/pkg/state/tree" "github.com/filecoin-project/venus/pkg/vm/register" + "github.com/filecoin-project/venus/venus-shared/actors" "github.com/filecoin-project/venus/venus-shared/actors/adt" "github.com/filecoin-project/venus/venus-shared/actors/builtin" _init "github.com/filecoin-project/venus/venus-shared/actors/builtin/init" @@ -60,19 +64,13 @@ func (msa *minerStateAPI) StateMinerSectorAllocated(ctx context.Context, maddr a } // StateSectorPreCommitInfo returns the PreCommit info for the specified miner's sector -func (msa *minerStateAPI) StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) { +func (msa *minerStateAPI) StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorPreCommitOnChainInfo, error) { _, view, err := msa.Stmgr.ParentStateViewTsk(ctx, tsk) if err != nil { - return miner.SectorPreCommitOnChainInfo{}, fmt.Errorf("loading tipset:%s parent state view: %v", tsk, err) + return nil, fmt.Errorf("loading tipset:%s parent state view: %v", tsk, err) } - pci, err := view.SectorPreCommitInfo(ctx, maddr, n) - if err != nil { - return miner.SectorPreCommitOnChainInfo{}, err - } else if pci == nil { - return miner.SectorPreCommitOnChainInfo{}, fmt.Errorf("precommit info is not exists") - } - return *pci, nil + return view.SectorPreCommitInfo(ctx, maddr, n) } // StateSectorGetInfo returns the on-chain info for the specified miner's sector. Returns null in case the sector info isn't found @@ -373,6 +371,70 @@ func (msa *minerStateAPI) StateMarketStorageDeal(ctx context.Context, dealID abi }, nil } +// StateComputeDataCID computes DataCID from a set of on-chain deals +func (msa *minerStateAPI) StateComputeDataCID(ctx context.Context, maddr address.Address, sectorType abi.RegisteredSealProof, deals []abi.DealID, tsk types.TipSetKey) (cid.Cid, error) { + nv, err := msa.API().StateNetworkVersion(ctx, tsk) + if err != nil { + return cid.Cid{}, err + } + + var ccparams []byte + if nv < network.Version13 { + ccparams, err = actors.SerializeParams(&market2.ComputeDataCommitmentParams{ + DealIDs: deals, + SectorType: sectorType, + }) + } else { + ccparams, err = actors.SerializeParams(&market5.ComputeDataCommitmentParams{ + Inputs: []*market5.SectorDataSpec{ + { + DealIDs: deals, + SectorType: sectorType, + }, + }, + }) + } + + if err != nil { + return cid.Undef, fmt.Errorf("computing params for ComputeDataCommitment: %w", err) + } + + ccmt := &types.Message{ + To: market.Address, + From: maddr, + Value: types.NewInt(0), + Method: market.Methods.ComputeDataCommitment, + Params: ccparams, + } + r, err := msa.API().StateCall(ctx, ccmt, tsk) + if err != nil { + return cid.Undef, fmt.Errorf("calling ComputeDataCommitment: %w", err) + } + if r.MsgRct.ExitCode != 0 { + return cid.Undef, fmt.Errorf("receipt for ComputeDataCommitment had exit code %d", r.MsgRct.ExitCode) + } + + if nv < network.Version13 { + var c cbg.CborCid + if err := c.UnmarshalCBOR(bytes.NewReader(r.MsgRct.Return)); err != nil { + return cid.Undef, fmt.Errorf("failed to unmarshal CBOR to CborCid: %w", err) + } + + return cid.Cid(c), nil + } + + var cr market5.ComputeDataCommitmentReturn + if err := cr.UnmarshalCBOR(bytes.NewReader(r.MsgRct.Return)); err != nil { + return cid.Undef, fmt.Errorf("failed to unmarshal CBOR to CborCid: %w", err) + } + + if len(cr.CommDs) != 1 { + return cid.Undef, fmt.Errorf("CommD output must have 1 entry") + } + + return cid.Cid(cr.CommDs[0]), nil +} + var initialPledgeNum = big.NewInt(110) var initialPledgeDen = big.NewInt(100) diff --git a/app/submodule/chain/v0api/chaininfo_v0api.go b/app/submodule/chain/v0api/chaininfo_v0api.go index 0377c371ef..9b07c0414f 100644 --- a/app/submodule/chain/v0api/chaininfo_v0api.go +++ b/app/submodule/chain/v0api/chaininfo_v0api.go @@ -2,11 +2,14 @@ package v0api import ( "context" + "fmt" + "github.com/filecoin-project/go-address" v0api "github.com/filecoin-project/venus/venus-shared/api/chain/v0" v1api "github.com/filecoin-project/venus/venus-shared/api/chain/v1" "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/builtin/v8/miner" "github.com/filecoin-project/go-state-types/crypto" "github.com/ipfs/go-cid" @@ -60,3 +63,15 @@ func (a *WrapperV1IChain) ChainGetRandomnessFromBeacon(ctx context.Context, key func (a *WrapperV1IChain) ChainGetRandomnessFromTickets(ctx context.Context, key types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) { return a.StateGetRandomnessFromTickets(ctx, personalization, randEpoch, entropy, key) } + +func (a *WrapperV1IChain) StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) { + pi, err := a.IChain.StateSectorPreCommitInfo(ctx, maddr, n, tsk) + if err != nil { + return miner.SectorPreCommitOnChainInfo{}, err + } + if pi == nil { + return miner.SectorPreCommitOnChainInfo{}, fmt.Errorf("precommit info does not exist") + } + + return *pi, nil +} diff --git a/app/submodule/syncer/syncer_api.go b/app/submodule/syncer/syncer_api.go index e7e0dda7f0..b175865290 100644 --- a/app/submodule/syncer/syncer_api.go +++ b/app/submodule/syncer/syncer_api.go @@ -155,39 +155,7 @@ func (sa *syncerAPI) SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) e return nil } -// MethodGroup: State -// The State methods are used to query, inspect, and interact with chain state. -// Most methods take a TipSetKey as a parameter. The state looked up is the parent state of the tipset. -// A nil TipSetKey can be provided as a param, this will cause the heaviest tipset in the chain to be used. - -// StateCall runs the given message and returns its result without any persisted changes. -// -// StateCall applies the message to the tipset's parent state. The -// message is not applied on-top-of the messages in the passed-in -// tipset. -func (sa *syncerAPI) StateCall(ctx context.Context, msg *types.Message, tsk types.TipSetKey) (*types.InvocResult, error) { - start := time.Now() - ts, err := sa.syncer.ChainModule.ChainReader.GetTipSet(ctx, tsk) - if err != nil { - return nil, fmt.Errorf("loading tipset %s: %v", tsk, err) - } - ret, err := sa.syncer.Stmgr.Call(ctx, msg, ts) - if err != nil { - return nil, err - } - duration := time.Since(start) - - mcid := msg.Cid() - return &types.InvocResult{ - MsgCid: mcid, - Msg: msg, - MsgRct: &ret.Receipt, - ExecutionTrace: types.ExecutionTrace{}, - Duration: duration, - }, nil -} - -//SyncState just compatible code lotus +// SyncState just compatible code lotus func (sa *syncerAPI) SyncState(ctx context.Context) (*types.SyncState, error) { tracker := sa.syncer.ChainSyncManager.BlockProposer().SyncTracker() tracker.History() diff --git a/cmd/dispute.go b/cmd/dispute.go index 5580c3a2fa..91e5f6c79a 100644 --- a/cmd/dispute.go +++ b/cmd/dispute.go @@ -101,7 +101,7 @@ var disputerMsgCmd = &cmds.Command{ Params: dpp, } - rslt, err := env.(*node.Env).SyncerAPI.StateCall(req.Context, dmsg, types.EmptyTSK) + rslt, err := env.(*node.Env).ChainAPI.StateCall(req.Context, dmsg, types.EmptyTSK) if err != nil { return fmt.Errorf("failed to simulate dispute: %w", err) } @@ -239,7 +239,7 @@ var disputerStartCmd = &cmds.Command{ disputableProofs := fullDeadlines[dl.index].DisputableProofCount proofsChecked += disputableProofs - ms, err := makeDisputeWindowedPosts(ctx, env.(*node.Env).SyncerAPI, dl, disputableProofs, fromAddr) + ms, err := makeDisputeWindowedPosts(ctx, env.(*node.Env).ChainAPI, dl, disputableProofs, fromAddr) if err != nil { return fmt.Errorf("failed to check for disputes: %w", err) } @@ -349,7 +349,7 @@ var disputerStartCmd = &cmds.Command{ // for a given miner, index, and maxPostIndex, tries to dispute posts from 0...postsSnapshotted-1 // returns a list of DisputeWindowedPoSt msgs that are expected to succeed if sent -func makeDisputeWindowedPosts(ctx context.Context, api v1api.ISyncer, dl minerDeadline, postsSnapshotted uint64, sender address.Address) ([]*types.Message, error) { +func makeDisputeWindowedPosts(ctx context.Context, api v1api.IChain, dl minerDeadline, postsSnapshotted uint64, sender address.Address) ([]*types.Message, error) { disputes := make([]*types.Message, 0) for i := uint64(0); i < postsSnapshotted; i++ { diff --git a/venus-shared/api/chain/v0/chain.go b/venus-shared/api/chain/v0/chain.go index 2ebc1a8ee3..f79cd1b0f1 100644 --- a/venus-shared/api/chain/v0/chain.go +++ b/venus-shared/api/chain/v0/chain.go @@ -82,7 +82,8 @@ type IChainInfo interface { // ChainGetGenesis returns the genesis tipset. ChainGetGenesis(context.Context) (*types.TipSet, error) //perm:read // StateActorManifestCID returns the CID of the builtin actors manifest for the given network version - StateActorManifestCID(context.Context, network.Version) (cid.Cid, error) //perm:read + 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 } type IMinerState interface { diff --git a/venus-shared/api/chain/v0/method.md b/venus-shared/api/chain/v0/method.md index 789d306521..f71f2e4a9c 100644 --- a/venus-shared/api/chain/v0/method.md +++ b/venus-shared/api/chain/v0/method.md @@ -42,6 +42,7 @@ * [ResolveToKeyAddr](#ResolveToKeyAddr) * [StateActorCodeCIDs](#StateActorCodeCIDs) * [StateActorManifestCID](#StateActorManifestCID) + * [StateCall](#StateCall) * [StateGetNetworkParams](#StateGetNetworkParams) * [StateGetReceipt](#StateGetReceipt) * [StateNetworkName](#StateNetworkName) @@ -172,7 +173,6 @@ * [ChainTipSetWeight](#ChainTipSetWeight) * [Concurrent](#Concurrent) * [SetConcurrent](#SetConcurrent) - * [StateCall](#StateCall) * [SyncState](#SyncState) * [SyncSubmitBlock](#SyncSubmitBlock) * [SyncerTracker](#SyncerTracker) @@ -1328,6 +1328,174 @@ Response: } ``` +### StateCall + + +Perms: read + +Inputs: +```json +[ + { + "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 +{ + "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 + }, + "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 + }, + "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 + }, + "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 @@ -1667,7 +1835,7 @@ Response: ```json { "Version": "string value", - "APIVersion": 131584 + "APIVersion": 131840 } ``` @@ -5072,174 +5240,6 @@ Inputs: Response: `{}` -### StateCall - - -Perms: read - -Inputs: -```json -[ - { - "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 -{ - "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 - }, - "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 - }, - "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 - }, - "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 -} -``` - ### SyncState diff --git a/venus-shared/api/chain/v0/proxy_gen.go b/venus-shared/api/chain/v0/proxy_gen.go index 3c3199e92f..4bcf17ee83 100644 --- a/venus-shared/api/chain/v0/proxy_gen.go +++ b/venus-shared/api/chain/v0/proxy_gen.go @@ -240,6 +240,7 @@ type IChainInfoStruct struct { 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"` 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"` @@ -338,6 +339,9 @@ func (s *IChainInfoStruct) StateActorCodeCIDs(p0 context.Context, p1 network.Ver func (s *IChainInfoStruct) StateActorManifestCID(p0 context.Context, p1 network.Version) (cid.Cid, error) { return s.Internal.StateActorManifestCID(p0, p1) } +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) StateGetNetworkParams(p0 context.Context) (*types.NetworkParams, error) { return s.Internal.StateGetNetworkParams(p0) } @@ -716,14 +720,13 @@ func (s *IPaychanStruct) PaychVoucherSubmit(p0 context.Context, p1 address.Addre type ISyncerStruct struct { Internal struct { - ChainSyncHandleNewTipSet func(ctx context.Context, ci *types.ChainInfo) error `perm:"write"` - ChainTipSetWeight func(ctx context.Context, tsk types.TipSetKey) (big.Int, error) `perm:"read"` - Concurrent func(ctx context.Context) int64 `perm:"read"` - SetConcurrent func(ctx context.Context, concurrent int64) error `perm:"admin"` - StateCall func(ctx context.Context, msg *types.Message, tsk types.TipSetKey) (*types.InvocResult, error) `perm:"read"` - SyncState func(ctx context.Context) (*types.SyncState, error) `perm:"read"` - SyncSubmitBlock func(ctx context.Context, blk *types.BlockMsg) error `perm:"write"` - SyncerTracker func(ctx context.Context) *types.TargetTracker `perm:"read"` + ChainSyncHandleNewTipSet func(ctx context.Context, ci *types.ChainInfo) error `perm:"write"` + ChainTipSetWeight func(ctx context.Context, tsk types.TipSetKey) (big.Int, error) `perm:"read"` + Concurrent func(ctx context.Context) int64 `perm:"read"` + SetConcurrent func(ctx context.Context, concurrent int64) error `perm:"admin"` + SyncState func(ctx context.Context) (*types.SyncState, error) `perm:"read"` + SyncSubmitBlock func(ctx context.Context, blk *types.BlockMsg) error `perm:"write"` + SyncerTracker func(ctx context.Context) *types.TargetTracker `perm:"read"` } } @@ -737,9 +740,6 @@ func (s *ISyncerStruct) Concurrent(p0 context.Context) int64 { return s.Internal func (s *ISyncerStruct) SetConcurrent(p0 context.Context, p1 int64) error { return s.Internal.SetConcurrent(p0, p1) } -func (s *ISyncerStruct) StateCall(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*types.InvocResult, error) { - return s.Internal.StateCall(p0, p1, p2) -} func (s *ISyncerStruct) SyncState(p0 context.Context) (*types.SyncState, error) { return s.Internal.SyncState(p0) } diff --git a/venus-shared/api/chain/v0/syncer.go b/venus-shared/api/chain/v0/syncer.go index 75224c2795..beaa649387 100644 --- a/venus-shared/api/chain/v0/syncer.go +++ b/venus-shared/api/chain/v0/syncer.go @@ -9,12 +9,11 @@ import ( ) type ISyncer interface { - ChainSyncHandleNewTipSet(ctx context.Context, ci *types.ChainInfo) error //perm:write - SetConcurrent(ctx context.Context, concurrent int64) error //perm:admin - SyncerTracker(ctx context.Context) *types.TargetTracker //perm:read - Concurrent(ctx context.Context) int64 //perm:read - ChainTipSetWeight(ctx context.Context, tsk types.TipSetKey) (big.Int, error) //perm:read - SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) error //perm:write - StateCall(ctx context.Context, msg *types.Message, tsk types.TipSetKey) (*types.InvocResult, error) //perm:read - SyncState(ctx context.Context) (*types.SyncState, error) //perm:read + ChainSyncHandleNewTipSet(ctx context.Context, ci *types.ChainInfo) error //perm:write + SetConcurrent(ctx context.Context, concurrent int64) error //perm:admin + SyncerTracker(ctx context.Context) *types.TargetTracker //perm:read + Concurrent(ctx context.Context) int64 //perm:read + ChainTipSetWeight(ctx context.Context, tsk types.TipSetKey) (big.Int, error) //perm:read + SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) error //perm:write + SyncState(ctx context.Context) (*types.SyncState, error) //perm:read } diff --git a/venus-shared/api/chain/v1/chain.go b/venus-shared/api/chain/v1/chain.go index b593a06752..2ee5333e59 100644 --- a/venus-shared/api/chain/v1/chain.go +++ b/venus-shared/api/chain/v1/chain.go @@ -114,36 +114,45 @@ type IChainInfo interface { // ChainGetGenesis returns the genesis tipset. ChainGetGenesis(context.Context) (*types.TipSet, error) //perm:read // StateActorManifestCID returns the CID of the builtin actors manifest for the given network version - StateActorManifestCID(context.Context, network.Version) (cid.Cid, error) //perm:read + 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 } type IMinerState interface { - StateReadState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.ActorState, error) //perm:read - StateListMessages(ctx context.Context, match *types.MessageMatch, tsk types.TipSetKey, toht abi.ChainEpoch) ([]cid.Cid, error) //perm:read - StateDecodeParams(ctx context.Context, toAddr address.Address, method abi.MethodNum, params []byte, tsk types.TipSetKey) (interface{}, error) //perm:read - StateEncodeParams(ctx context.Context, toActCode cid.Cid, method abi.MethodNum, params json.RawMessage) ([]byte, error) //perm:read - StateMinerSectorAllocated(ctx context.Context, maddr address.Address, s abi.SectorNumber, tsk types.TipSetKey) (bool, error) //perm:read - StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) //perm:read - StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error) //perm:read - StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tsk types.TipSetKey) (*lminer.SectorLocation, error) //perm:read - StateMinerSectorSize(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (abi.SectorSize, error) //perm:read - StateMinerInfo(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (types.MinerInfo, error) //perm:read - StateMinerWorkerAddress(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (address.Address, error) //perm:read - StateMinerFaults(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (bitfield.BitField, error) //perm:read - StateAllMinerFaults(ctx context.Context, lookback abi.ChainEpoch, ts types.TipSetKey) ([]*types.Fault, error) //perm:read - StateMinerRecoveries(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (bitfield.BitField, error) //perm:read - StateMinerProvingDeadline(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (*dline.Info, error) //perm:read - StateMinerPartitions(ctx context.Context, maddr address.Address, dlIdx uint64, tsk types.TipSetKey) ([]types.Partition, error) //perm:read - StateMinerDeadlines(ctx context.Context, maddr address.Address, tsk types.TipSetKey) ([]types.Deadline, error) //perm:read - StateMinerSectors(ctx context.Context, maddr address.Address, sectorNos *bitfield.BitField, tsk types.TipSetKey) ([]*miner.SectorOnChainInfo, error) //perm:read - StateMarketStorageDeal(ctx context.Context, dealID abi.DealID, tsk types.TipSetKey) (*types.MarketDeal, error) //perm:read - StateMinerPreCommitDepositForPower(ctx context.Context, maddr address.Address, pci miner.SectorPreCommitInfo, tsk types.TipSetKey) (big.Int, error) //perm:read - StateMinerInitialPledgeCollateral(ctx context.Context, maddr address.Address, pci miner.SectorPreCommitInfo, tsk types.TipSetKey) (big.Int, error) //perm:read - StateVMCirculatingSupplyInternal(ctx context.Context, tsk types.TipSetKey) (types.CirculatingSupply, error) //perm:read - StateCirculatingSupply(ctx context.Context, tsk types.TipSetKey) (abi.TokenAmount, error) //perm:read - StateMarketDeals(ctx context.Context, tsk types.TipSetKey) (map[string]*types.MarketDeal, error) //perm:read - StateMinerActiveSectors(ctx context.Context, maddr address.Address, tsk types.TipSetKey) ([]*miner.SectorOnChainInfo, error) //perm:read - StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) //perm:read + StateReadState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.ActorState, error) //perm:read + StateListMessages(ctx context.Context, match *types.MessageMatch, tsk types.TipSetKey, toht abi.ChainEpoch) ([]cid.Cid, error) //perm:read + StateDecodeParams(ctx context.Context, toAddr address.Address, method abi.MethodNum, params []byte, tsk types.TipSetKey) (interface{}, error) //perm:read + StateEncodeParams(ctx context.Context, toActCode cid.Cid, method abi.MethodNum, params json.RawMessage) ([]byte, error) //perm:read + StateMinerSectorAllocated(ctx context.Context, maddr address.Address, s abi.SectorNumber, tsk types.TipSetKey) (bool, error) //perm:read + // StateSectorPreCommitInfo returns the PreCommit info for the specified miner's sector. + // Returns nil and no error if the sector isn't precommitted. + // + // Note that the sector number may be allocated while PreCommitInfo is nil. This means that either allocated sector + // numbers were compacted, and the sector number was marked as allocated in order to reduce size of the allocated + // sectors bitfield, or that the sector was precommitted, but the precommit has expired. + StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorPreCommitOnChainInfo, error) //perm:read + StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error) //perm:read + StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tsk types.TipSetKey) (*lminer.SectorLocation, error) //perm:read + StateMinerSectorSize(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (abi.SectorSize, error) //perm:read + StateMinerInfo(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (types.MinerInfo, error) //perm:read + StateMinerWorkerAddress(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (address.Address, error) //perm:read + StateMinerFaults(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (bitfield.BitField, error) //perm:read + StateAllMinerFaults(ctx context.Context, lookback abi.ChainEpoch, ts types.TipSetKey) ([]*types.Fault, error) //perm:read + StateMinerRecoveries(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (bitfield.BitField, error) //perm:read + StateMinerProvingDeadline(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (*dline.Info, error) //perm:read + StateMinerPartitions(ctx context.Context, maddr address.Address, dlIdx uint64, tsk types.TipSetKey) ([]types.Partition, error) //perm:read + StateMinerDeadlines(ctx context.Context, maddr address.Address, tsk types.TipSetKey) ([]types.Deadline, error) //perm:read + StateMinerSectors(ctx context.Context, maddr address.Address, sectorNos *bitfield.BitField, tsk types.TipSetKey) ([]*miner.SectorOnChainInfo, error) //perm:read + StateMarketStorageDeal(ctx context.Context, dealID abi.DealID, tsk types.TipSetKey) (*types.MarketDeal, error) //perm:read + // StateComputeDataCID computes DataCID from a set of on-chain deals + StateComputeDataCID(ctx context.Context, maddr address.Address, sectorType abi.RegisteredSealProof, deals []abi.DealID, tsk types.TipSetKey) (cid.Cid, error) //perm:read + StateMinerPreCommitDepositForPower(ctx context.Context, maddr address.Address, pci miner.SectorPreCommitInfo, tsk types.TipSetKey) (big.Int, error) //perm:read + StateMinerInitialPledgeCollateral(ctx context.Context, maddr address.Address, pci miner.SectorPreCommitInfo, tsk types.TipSetKey) (big.Int, error) //perm:read + StateVMCirculatingSupplyInternal(ctx context.Context, tsk types.TipSetKey) (types.CirculatingSupply, error) //perm:read + StateCirculatingSupply(ctx context.Context, tsk types.TipSetKey) (abi.TokenAmount, error) //perm:read + StateMarketDeals(ctx context.Context, tsk types.TipSetKey) (map[string]*types.MarketDeal, error) //perm:read + StateMinerActiveSectors(ctx context.Context, maddr address.Address, tsk types.TipSetKey) ([]*miner.SectorOnChainInfo, error) //perm:read + StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) //perm:read // StateLookupRobustAddress returns the public key address of the given ID address for non-account addresses (multisig, miners etc) StateLookupRobustAddress(context.Context, address.Address, types.TipSetKey) (address.Address, error) //perm:read StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error) //perm:read diff --git a/venus-shared/api/chain/v1/method.md b/venus-shared/api/chain/v1/method.md index d0adca560a..0d0682d4b4 100644 --- a/venus-shared/api/chain/v1/method.md +++ b/venus-shared/api/chain/v1/method.md @@ -39,6 +39,7 @@ * [ResolveToKeyAddr](#ResolveToKeyAddr) * [StateActorCodeCIDs](#StateActorCodeCIDs) * [StateActorManifestCID](#StateActorManifestCID) + * [StateCall](#StateCall) * [StateGetBeaconEntry](#StateGetBeaconEntry) * [StateGetNetworkParams](#StateGetNetworkParams) * [StateGetRandomnessFromBeacon](#StateGetRandomnessFromBeacon) @@ -84,6 +85,7 @@ * [StateAllMinerFaults](#StateAllMinerFaults) * [StateChangedActors](#StateChangedActors) * [StateCirculatingSupply](#StateCirculatingSupply) + * [StateComputeDataCID](#StateComputeDataCID) * [StateDealProviderCollateralBounds](#StateDealProviderCollateralBounds) * [StateDecodeParams](#StateDecodeParams) * [StateEncodeParams](#StateEncodeParams) @@ -180,7 +182,6 @@ * [ChainTipSetWeight](#ChainTipSetWeight) * [Concurrent](#Concurrent) * [SetConcurrent](#SetConcurrent) - * [StateCall](#StateCall) * [SyncState](#SyncState) * [SyncSubmitBlock](#SyncSubmitBlock) * [SyncerTracker](#SyncerTracker) @@ -1295,6 +1296,174 @@ Response: } ``` +### StateCall + + +Perms: read + +Inputs: +```json +[ + { + "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 +{ + "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 + }, + "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 + }, + "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 + }, + "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 @@ -1641,7 +1810,7 @@ Response: ```json { "Version": "string value", - "APIVersion": 131584 + "APIVersion": 131840 } ``` @@ -2744,6 +2913,38 @@ Inputs: Response: `"0"` +### StateComputeDataCID +StateComputeDataCID computes DataCID from a set of on-chain deals + + +Perms: read + +Inputs: +```json +[ + "f01234", + 8, + [ + 5432 + ], + [ + { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + { + "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" + } + ] +] +``` + +Response: +```json +{ + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" +} +``` + ### StateDealProviderCollateralBounds @@ -3742,6 +3943,12 @@ Response: ``` ### StateSectorPreCommitInfo +StateSectorPreCommitInfo returns the PreCommit info for the specified miner's sector. +Returns nil and no error if the sector isn't precommitted. + +Note that the sector number may be allocated while PreCommitInfo is nil. This means that either allocated sector +numbers were compacted, and the sector number was marked as allocated in order to reduce size of the allocated +sectors bitfield, or that the sector was precommitted, but the precommit has expired. Perms: read @@ -5593,174 +5800,6 @@ Inputs: Response: `{}` -### StateCall - - -Perms: read - -Inputs: -```json -[ - { - "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 -{ - "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 - }, - "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 - }, - "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 - }, - "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 -} -``` - ### SyncState diff --git a/venus-shared/api/chain/v1/mock/mock_fullnode.go b/venus-shared/api/chain/v1/mock/mock_fullnode.go index 58d413058a..5699617392 100644 --- a/venus-shared/api/chain/v1/mock/mock_fullnode.go +++ b/venus-shared/api/chain/v1/mock/mock_fullnode.go @@ -1878,6 +1878,21 @@ func (mr *MockFullNodeMockRecorder) StateCirculatingSupply(arg0, arg1 interface{ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateCirculatingSupply", reflect.TypeOf((*MockFullNode)(nil).StateCirculatingSupply), arg0, arg1) } +// StateComputeDataCID mocks base method. +func (m *MockFullNode) StateComputeDataCID(arg0 context.Context, arg1 address.Address, arg2 abi.RegisteredSealProof, arg3 []abi.DealID, arg4 types.TipSetKey) (cid.Cid, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "StateComputeDataCID", arg0, arg1, arg2, arg3, arg4) + ret0, _ := ret[0].(cid.Cid) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// StateComputeDataCID indicates an expected call of StateComputeDataCID. +func (mr *MockFullNodeMockRecorder) StateComputeDataCID(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateComputeDataCID", reflect.TypeOf((*MockFullNode)(nil).StateComputeDataCID), arg0, arg1, arg2, arg3, arg4) +} + // StateDealProviderCollateralBounds mocks base method. func (m *MockFullNode) StateDealProviderCollateralBounds(arg0 context.Context, arg1 abi.PaddedPieceSize, arg2 bool, arg3 types.TipSetKey) (types.DealCollateralBounds, error) { m.ctrl.T.Helper() @@ -2479,10 +2494,10 @@ func (mr *MockFullNodeMockRecorder) StateSectorPartition(arg0, arg1, arg2, arg3 } // StateSectorPreCommitInfo mocks base method. -func (m *MockFullNode) StateSectorPreCommitInfo(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) { +func (m *MockFullNode) StateSectorPreCommitInfo(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (*miner.SectorPreCommitOnChainInfo, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StateSectorPreCommitInfo", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(miner.SectorPreCommitOnChainInfo) + ret0, _ := ret[0].(*miner.SectorPreCommitOnChainInfo) ret1, _ := ret[1].(error) return ret0, ret1 } diff --git a/venus-shared/api/chain/v1/proxy_gen.go b/venus-shared/api/chain/v1/proxy_gen.go index 87bc9d4cce..6b086293f3 100644 --- a/venus-shared/api/chain/v1/proxy_gen.go +++ b/venus-shared/api/chain/v1/proxy_gen.go @@ -77,43 +77,44 @@ func (s *IActorStruct) StateGetActor(p0 context.Context, p1 address.Address, p2 type IMinerStateStruct struct { Internal struct { - StateAllMinerFaults func(ctx context.Context, lookback abi.ChainEpoch, ts types.TipSetKey) ([]*types.Fault, error) `perm:"read"` - StateChangedActors func(context.Context, cid.Cid, cid.Cid) (map[string]types.Actor, error) `perm:"read"` - StateCirculatingSupply func(ctx context.Context, tsk types.TipSetKey) (abi.TokenAmount, error) `perm:"read"` - StateDealProviderCollateralBounds func(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (types.DealCollateralBounds, error) `perm:"read"` - StateDecodeParams func(ctx context.Context, toAddr address.Address, method abi.MethodNum, params []byte, tsk types.TipSetKey) (interface{}, error) `perm:"read"` - StateEncodeParams func(ctx context.Context, toActCode cid.Cid, method abi.MethodNum, params json.RawMessage) ([]byte, error) `perm:"read"` - StateListActors func(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error) `perm:"read"` - StateListMessages func(ctx context.Context, match *types.MessageMatch, tsk types.TipSetKey, toht abi.ChainEpoch) ([]cid.Cid, error) `perm:"read"` - StateListMiners func(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error) `perm:"read"` - StateLookupID func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) `perm:"read"` - StateLookupRobustAddress func(context.Context, address.Address, types.TipSetKey) (address.Address, error) `perm:"read"` - StateMarketBalance func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.MarketBalance, error) `perm:"read"` - StateMarketDeals func(ctx context.Context, tsk types.TipSetKey) (map[string]*types.MarketDeal, error) `perm:"read"` - StateMarketStorageDeal func(ctx context.Context, dealID abi.DealID, tsk types.TipSetKey) (*types.MarketDeal, error) `perm:"read"` - StateMinerActiveSectors func(ctx context.Context, maddr address.Address, tsk types.TipSetKey) ([]*miner.SectorOnChainInfo, error) `perm:"read"` - StateMinerAvailableBalance func(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (big.Int, error) `perm:"read"` - StateMinerDeadlines func(ctx context.Context, maddr address.Address, tsk types.TipSetKey) ([]types.Deadline, error) `perm:"read"` - StateMinerFaults func(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (bitfield.BitField, error) `perm:"read"` - StateMinerInfo func(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (types.MinerInfo, error) `perm:"read"` - StateMinerInitialPledgeCollateral func(ctx context.Context, maddr address.Address, pci miner.SectorPreCommitInfo, tsk types.TipSetKey) (big.Int, error) `perm:"read"` - StateMinerPartitions func(ctx context.Context, maddr address.Address, dlIdx uint64, tsk types.TipSetKey) ([]types.Partition, error) `perm:"read"` - StateMinerPower func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*types.MinerPower, error) `perm:"read"` - StateMinerPreCommitDepositForPower func(ctx context.Context, maddr address.Address, pci miner.SectorPreCommitInfo, tsk types.TipSetKey) (big.Int, error) `perm:"read"` - StateMinerProvingDeadline func(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (*dline.Info, error) `perm:"read"` - StateMinerRecoveries func(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (bitfield.BitField, error) `perm:"read"` - StateMinerSectorAllocated func(ctx context.Context, maddr address.Address, s abi.SectorNumber, tsk types.TipSetKey) (bool, error) `perm:"read"` - StateMinerSectorCount func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.MinerSectors, error) `perm:"read"` - StateMinerSectorSize func(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (abi.SectorSize, error) `perm:"read"` - StateMinerSectors func(ctx context.Context, maddr address.Address, sectorNos *bitfield.BitField, tsk types.TipSetKey) ([]*miner.SectorOnChainInfo, error) `perm:"read"` - StateMinerWorkerAddress func(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (address.Address, error) `perm:"read"` - StateReadState func(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.ActorState, error) `perm:"read"` - StateSectorExpiration func(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tsk types.TipSetKey) (*lminer.SectorExpiration, error) `perm:"read"` - StateSectorGetInfo func(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error) `perm:"read"` - StateSectorPartition func(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tsk types.TipSetKey) (*lminer.SectorLocation, error) `perm:"read"` - StateSectorPreCommitInfo func(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) `perm:"read"` - StateVMCirculatingSupplyInternal func(ctx context.Context, tsk types.TipSetKey) (types.CirculatingSupply, error) `perm:"read"` - StateVerifiedClientStatus func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) `perm:"read"` + StateAllMinerFaults func(ctx context.Context, lookback abi.ChainEpoch, ts types.TipSetKey) ([]*types.Fault, error) `perm:"read"` + StateChangedActors func(context.Context, cid.Cid, cid.Cid) (map[string]types.Actor, error) `perm:"read"` + StateCirculatingSupply func(ctx context.Context, tsk types.TipSetKey) (abi.TokenAmount, error) `perm:"read"` + StateComputeDataCID func(ctx context.Context, maddr address.Address, sectorType abi.RegisteredSealProof, deals []abi.DealID, tsk types.TipSetKey) (cid.Cid, error) `perm:"read"` + StateDealProviderCollateralBounds func(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (types.DealCollateralBounds, error) `perm:"read"` + StateDecodeParams func(ctx context.Context, toAddr address.Address, method abi.MethodNum, params []byte, tsk types.TipSetKey) (interface{}, error) `perm:"read"` + StateEncodeParams func(ctx context.Context, toActCode cid.Cid, method abi.MethodNum, params json.RawMessage) ([]byte, error) `perm:"read"` + StateListActors func(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error) `perm:"read"` + StateListMessages func(ctx context.Context, match *types.MessageMatch, tsk types.TipSetKey, toht abi.ChainEpoch) ([]cid.Cid, error) `perm:"read"` + StateListMiners func(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error) `perm:"read"` + StateLookupID func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) `perm:"read"` + StateLookupRobustAddress func(context.Context, address.Address, types.TipSetKey) (address.Address, error) `perm:"read"` + StateMarketBalance func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.MarketBalance, error) `perm:"read"` + StateMarketDeals func(ctx context.Context, tsk types.TipSetKey) (map[string]*types.MarketDeal, error) `perm:"read"` + StateMarketStorageDeal func(ctx context.Context, dealID abi.DealID, tsk types.TipSetKey) (*types.MarketDeal, error) `perm:"read"` + StateMinerActiveSectors func(ctx context.Context, maddr address.Address, tsk types.TipSetKey) ([]*miner.SectorOnChainInfo, error) `perm:"read"` + StateMinerAvailableBalance func(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (big.Int, error) `perm:"read"` + StateMinerDeadlines func(ctx context.Context, maddr address.Address, tsk types.TipSetKey) ([]types.Deadline, error) `perm:"read"` + StateMinerFaults func(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (bitfield.BitField, error) `perm:"read"` + StateMinerInfo func(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (types.MinerInfo, error) `perm:"read"` + StateMinerInitialPledgeCollateral func(ctx context.Context, maddr address.Address, pci miner.SectorPreCommitInfo, tsk types.TipSetKey) (big.Int, error) `perm:"read"` + StateMinerPartitions func(ctx context.Context, maddr address.Address, dlIdx uint64, tsk types.TipSetKey) ([]types.Partition, error) `perm:"read"` + StateMinerPower func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*types.MinerPower, error) `perm:"read"` + StateMinerPreCommitDepositForPower func(ctx context.Context, maddr address.Address, pci miner.SectorPreCommitInfo, tsk types.TipSetKey) (big.Int, error) `perm:"read"` + StateMinerProvingDeadline func(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (*dline.Info, error) `perm:"read"` + StateMinerRecoveries func(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (bitfield.BitField, error) `perm:"read"` + StateMinerSectorAllocated func(ctx context.Context, maddr address.Address, s abi.SectorNumber, tsk types.TipSetKey) (bool, error) `perm:"read"` + StateMinerSectorCount func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.MinerSectors, error) `perm:"read"` + StateMinerSectorSize func(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (abi.SectorSize, error) `perm:"read"` + StateMinerSectors func(ctx context.Context, maddr address.Address, sectorNos *bitfield.BitField, tsk types.TipSetKey) ([]*miner.SectorOnChainInfo, error) `perm:"read"` + StateMinerWorkerAddress func(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (address.Address, error) `perm:"read"` + StateReadState func(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.ActorState, error) `perm:"read"` + StateSectorExpiration func(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tsk types.TipSetKey) (*lminer.SectorExpiration, error) `perm:"read"` + StateSectorGetInfo func(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error) `perm:"read"` + StateSectorPartition func(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tsk types.TipSetKey) (*lminer.SectorLocation, error) `perm:"read"` + StateSectorPreCommitInfo func(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorPreCommitOnChainInfo, error) `perm:"read"` + StateVMCirculatingSupplyInternal func(ctx context.Context, tsk types.TipSetKey) (types.CirculatingSupply, error) `perm:"read"` + StateVerifiedClientStatus func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) `perm:"read"` } } @@ -126,6 +127,9 @@ func (s *IMinerStateStruct) StateChangedActors(p0 context.Context, p1 cid.Cid, p func (s *IMinerStateStruct) StateCirculatingSupply(p0 context.Context, p1 types.TipSetKey) (abi.TokenAmount, error) { return s.Internal.StateCirculatingSupply(p0, p1) } +func (s *IMinerStateStruct) StateComputeDataCID(p0 context.Context, p1 address.Address, p2 abi.RegisteredSealProof, p3 []abi.DealID, p4 types.TipSetKey) (cid.Cid, error) { + return s.Internal.StateComputeDataCID(p0, p1, p2, p3, p4) +} func (s *IMinerStateStruct) StateDealProviderCollateralBounds(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (types.DealCollateralBounds, error) { return s.Internal.StateDealProviderCollateralBounds(p0, p1, p2, p3) } @@ -219,7 +223,7 @@ func (s *IMinerStateStruct) StateSectorGetInfo(p0 context.Context, p1 address.Ad func (s *IMinerStateStruct) StateSectorPartition(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*lminer.SectorLocation, error) { return s.Internal.StateSectorPartition(p0, p1, p2, p3) } -func (s *IMinerStateStruct) StateSectorPreCommitInfo(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) { +func (s *IMinerStateStruct) StateSectorPreCommitInfo(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorPreCommitOnChainInfo, error) { return s.Internal.StateSectorPreCommitInfo(p0, p1, p2, p3) } func (s *IMinerStateStruct) StateVMCirculatingSupplyInternal(p0 context.Context, p1 types.TipSetKey) (types.CirculatingSupply, error) { @@ -258,6 +262,7 @@ type IChainInfoStruct struct { 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"` 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"` @@ -353,6 +358,9 @@ func (s *IChainInfoStruct) StateActorCodeCIDs(p0 context.Context, p1 network.Ver func (s *IChainInfoStruct) StateActorManifestCID(p0 context.Context, p1 network.Version) (cid.Cid, error) { return s.Internal.StateActorManifestCID(p0, p1) } +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) StateGetBeaconEntry(p0 context.Context, p1 abi.ChainEpoch) (*types.BeaconEntry, error) { return s.Internal.StateGetBeaconEntry(p0, p1) } @@ -746,14 +754,13 @@ func (s *IPaychanStruct) PaychVoucherSubmit(p0 context.Context, p1 address.Addre type ISyncerStruct struct { Internal struct { - ChainSyncHandleNewTipSet func(ctx context.Context, ci *types.ChainInfo) error `perm:"write"` - ChainTipSetWeight func(ctx context.Context, tsk types.TipSetKey) (big.Int, error) `perm:"read"` - Concurrent func(ctx context.Context) int64 `perm:"read"` - SetConcurrent func(ctx context.Context, concurrent int64) error `perm:"admin"` - StateCall func(ctx context.Context, msg *types.Message, tsk types.TipSetKey) (*types.InvocResult, error) `perm:"read"` - SyncState func(ctx context.Context) (*types.SyncState, error) `perm:"read"` - SyncSubmitBlock func(ctx context.Context, blk *types.BlockMsg) error `perm:"write"` - SyncerTracker func(ctx context.Context) *types.TargetTracker `perm:"read"` + ChainSyncHandleNewTipSet func(ctx context.Context, ci *types.ChainInfo) error `perm:"write"` + ChainTipSetWeight func(ctx context.Context, tsk types.TipSetKey) (big.Int, error) `perm:"read"` + Concurrent func(ctx context.Context) int64 `perm:"read"` + SetConcurrent func(ctx context.Context, concurrent int64) error `perm:"admin"` + SyncState func(ctx context.Context) (*types.SyncState, error) `perm:"read"` + SyncSubmitBlock func(ctx context.Context, blk *types.BlockMsg) error `perm:"write"` + SyncerTracker func(ctx context.Context) *types.TargetTracker `perm:"read"` } } @@ -767,9 +774,6 @@ func (s *ISyncerStruct) Concurrent(p0 context.Context) int64 { return s.Internal func (s *ISyncerStruct) SetConcurrent(p0 context.Context, p1 int64) error { return s.Internal.SetConcurrent(p0, p1) } -func (s *ISyncerStruct) StateCall(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*types.InvocResult, error) { - return s.Internal.StateCall(p0, p1, p2) -} func (s *ISyncerStruct) SyncState(p0 context.Context) (*types.SyncState, error) { return s.Internal.SyncState(p0) } diff --git a/venus-shared/api/chain/v1/syncer.go b/venus-shared/api/chain/v1/syncer.go index 2df413396f..fe2b71c916 100644 --- a/venus-shared/api/chain/v1/syncer.go +++ b/venus-shared/api/chain/v1/syncer.go @@ -9,12 +9,11 @@ import ( ) type ISyncer interface { - ChainSyncHandleNewTipSet(ctx context.Context, ci *types.ChainInfo) error //perm:write - SetConcurrent(ctx context.Context, concurrent int64) error //perm:admin - SyncerTracker(ctx context.Context) *types.TargetTracker //perm:read - Concurrent(ctx context.Context) int64 //perm:read - ChainTipSetWeight(ctx context.Context, tsk types.TipSetKey) (big.Int, error) //perm:read - SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) error //perm:write - StateCall(ctx context.Context, msg *types.Message, tsk types.TipSetKey) (*types.InvocResult, error) //perm:read - SyncState(ctx context.Context) (*types.SyncState, error) //perm:read + ChainSyncHandleNewTipSet(ctx context.Context, ci *types.ChainInfo) error //perm:write + SetConcurrent(ctx context.Context, concurrent int64) error //perm:admin + SyncerTracker(ctx context.Context) *types.TargetTracker //perm:read + Concurrent(ctx context.Context) int64 //perm:read + ChainTipSetWeight(ctx context.Context, tsk types.TipSetKey) (big.Int, error) //perm:read + SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) error //perm:write + SyncState(ctx context.Context) (*types.SyncState, error) //perm:read } diff --git a/venus-shared/api/chain/version.go b/venus-shared/api/chain/version.go index 1a775546a9..ac7b660a61 100644 --- a/venus-shared/api/chain/version.go +++ b/venus-shared/api/chain/version.go @@ -5,5 +5,5 @@ import "github.com/filecoin-project/venus/venus-shared/types" // semver versions of the rpc api exposed var ( FullAPIVersion0 = types.NewVer(1, 5, 0) - FullAPIVersion1 = types.NewVer(2, 2, 0) + FullAPIVersion1 = types.NewVer(2, 3, 0) ) diff --git a/venus-shared/api/gateway/v0/method.md b/venus-shared/api/gateway/v0/method.md index 43537b18fc..3d6224508a 100644 --- a/venus-shared/api/gateway/v0/method.md +++ b/venus-shared/api/gateway/v0/method.md @@ -42,7 +42,7 @@ Response: ```json { "Version": "string value", - "APIVersion": 131584 + "APIVersion": 131840 } ``` diff --git a/venus-shared/api/gateway/v1/method.md b/venus-shared/api/gateway/v1/method.md index 7131a5da7e..2028774e2f 100644 --- a/venus-shared/api/gateway/v1/method.md +++ b/venus-shared/api/gateway/v1/method.md @@ -42,7 +42,7 @@ Response: ```json { "Version": "string value", - "APIVersion": 131584 + "APIVersion": 131840 } ``` diff --git a/venus-shared/api/market/client/method.md b/venus-shared/api/market/client/method.md index a58bbea163..3d6e6910ef 100644 --- a/venus-shared/api/market/client/method.md +++ b/venus-shared/api/market/client/method.md @@ -1259,7 +1259,7 @@ Response: ```json { "Version": "string value", - "APIVersion": 131584 + "APIVersion": 131840 } ``` diff --git a/venus-shared/api/market/method.md b/venus-shared/api/market/method.md index 75195416fe..cf313401c7 100644 --- a/venus-shared/api/market/method.md +++ b/venus-shared/api/market/method.md @@ -2005,7 +2005,7 @@ Response: ```json { "Version": "string value", - "APIVersion": 131584 + "APIVersion": 131840 } ``` diff --git a/venus-shared/api/messager/method.md b/venus-shared/api/messager/method.md index 455b11adab..80c6a8e639 100644 --- a/venus-shared/api/messager/method.md +++ b/venus-shared/api/messager/method.md @@ -1355,7 +1355,7 @@ Response: ```json { "Version": "string value", - "APIVersion": 131584 + "APIVersion": 131840 } ``` diff --git a/venus-shared/api/wallet/method.md b/venus-shared/api/wallet/method.md index 614744517e..dd9f6ba4a0 100644 --- a/venus-shared/api/wallet/method.md +++ b/venus-shared/api/wallet/method.md @@ -135,7 +135,7 @@ Response: ```json { "Version": "string value", - "APIVersion": 131584 + "APIVersion": 131840 } ``` diff --git a/venus-shared/compatible-checks/api-diff.txt b/venus-shared/compatible-checks/api-diff.txt index 1c7566fe93..22b59500d5 100644 --- a/venus-shared/compatible-checks/api-diff.txt +++ b/venus-shared/compatible-checks/api-diff.txt @@ -200,12 +200,10 @@ github.com/filecoin-project/venus/venus-shared/api/chain/v1.FullNode <> github.c - Shutdown + StateActorManifestCID - StateCompute - - StateComputeDataCID > 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 field name: #8 field, BreezeGasTampingDuration != UpgradePriceListOopsHeight; nested=nil}}}}}} + StateMinerSectorSize + StateMinerWorkerAddress - StateReplay - > StateSectorPreCommitInfo {[func(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) <> func(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorPreCommitOnChainInfo, error)] base=func out type: #0 input; nested={[miner.SectorPreCommitOnChainInfo <> *miner.SectorPreCommitOnChainInfo] base=type kinds: struct != ptr; nested=nil}} - SyncCheckBad - SyncCheckpoint - SyncIncomingBlocks