From f45f7ee588d755a1c16c8940fd57f2b6e46468d9 Mon Sep 17 00:00:00 2001 From: dtynn Date: Thu, 20 Jan 2022 10:30:43 +0800 Subject: [PATCH 1/2] add api meta for compatible checks --- venus-devtool/compatible/apis/checksum.go | 12 ++--- venus-devtool/compatible/apis/diff.go | 15 ++---- venus-devtool/compatible/apis/perm.go | 23 ++------- venus-devtool/util/api_meta.go | 59 +++++++++++++++++++++++ venus-devtool/util/interface.go | 23 ++++++++- 5 files changed, 92 insertions(+), 40 deletions(-) create mode 100644 venus-devtool/util/api_meta.go diff --git a/venus-devtool/compatible/apis/checksum.go b/venus-devtool/compatible/apis/checksum.go index 40c1051e0a..3ca79dcb3b 100644 --- a/venus-devtool/compatible/apis/checksum.go +++ b/venus-devtool/compatible/apis/checksum.go @@ -7,22 +7,18 @@ import ( "reflect" "strings" - "github.com/filecoin-project/lotus/api/v0api" - "github.com/filecoin-project/lotus/api/v1api" "github.com/urfave/cli/v2" + + "github.com/filecoin-project/venus/venus-devtool/util" ) var checksumCmd = &cli.Command{ Name: "checksum", Flags: []cli.Flag{}, Action: func(cctx *cli.Context) error { - wants := []reflect.Type{ - reflect.TypeOf((*v0api.FullNode)(nil)).Elem(), - reflect.TypeOf((*v1api.FullNode)(nil)).Elem(), - } - var buf bytes.Buffer - for _, rt := range wants { + for _, pair := range util.APIPairs { + rt := pair.Lotus.Type fmt.Printf("%s:\n", rt) for mi := 0; mi < rt.NumMethod(); mi++ { buf.Reset() diff --git a/venus-devtool/compatible/apis/diff.go b/venus-devtool/compatible/apis/diff.go index 5fd2782c30..615df3f4a0 100644 --- a/venus-devtool/compatible/apis/diff.go +++ b/venus-devtool/compatible/apis/diff.go @@ -5,27 +5,18 @@ import ( "reflect" "sort" - "github.com/filecoin-project/lotus/api/v1api" "github.com/urfave/cli/v2" - "github.com/filecoin-project/venus/venus-shared/api/chain/v1" "github.com/filecoin-project/venus/venus-shared/typeutil" + + "github.com/filecoin-project/venus/venus-devtool/util" ) var diffCmd = &cli.Command{ Name: "diff", Flags: []cli.Flag{}, Action: func(cctx *cli.Context) error { - pairs := [][2]reflect.Type{ - { - reflect.TypeOf((*v1.FullNode)(nil)).Elem(), - reflect.TypeOf((*v1api.FullNode)(nil)).Elem(), - }, - } - - for _, pair := range pairs { - showDiff(pair[0], pair[1]) - } + showDiff(util.LatestAPIPair.Venus.Type, util.LatestAPIPair.Lotus.Type) return nil }, } diff --git a/venus-devtool/compatible/apis/perm.go b/venus-devtool/compatible/apis/perm.go index ebd8232b50..c643edb7f3 100644 --- a/venus-devtool/compatible/apis/perm.go +++ b/venus-devtool/compatible/apis/perm.go @@ -14,16 +14,12 @@ var permCmd = &cli.Command{ Name: "perm", Flags: []cli.Flag{}, Action: func(cctx *cli.Context) error { - originMetas, err := parsePermMetas(permOption{ - importPath: "github.com/filecoin-project/lotus/api", - }) + originMetas, err := parsePermMetas(util.LatestAPIPair.Lotus.ParseOpt) if err != nil { log.Fatalln("parse lotus api interfaces:", err) } - targetMetas, err := parsePermMetas(permOption{ - importPath: "github.com/filecoin-project/venus/venus-shared/api/chain/v1", - }) + targetMetas, err := parsePermMetas(util.LatestAPIPair.Venus.ParseOpt) if err != nil { log.Fatalln("parse venus chain api interfaces:", err) } @@ -53,11 +49,6 @@ var permCmd = &cli.Command{ }, } -type permOption struct { - importPath string - excluded map[string]struct{} -} - type permMeta struct { pkg string iface string @@ -65,21 +56,17 @@ type permMeta struct { perm string } -func parsePermMetas(opt permOption) ([]permMeta, error) { - ifaceMetas, err := util.ParseInterfaceMetas(opt.importPath) +func parsePermMetas(opt util.InterfaceParseOption) ([]permMeta, error) { + ifaceMetas, err := util.ParseInterfaceMetas(opt) if err != nil { return nil, err } var permMetas []permMeta for _, iface := range ifaceMetas { - if _, yes := opt.excluded[iface.Name]; yes { - continue - } - for _, ifMeth := range iface.Defined { permMetas = append(permMetas, permMeta{ - pkg: opt.importPath, + pkg: opt.ImportPath, iface: iface.Name, meth: ifMeth.Name, perm: getPerms(ifMeth), diff --git a/venus-devtool/util/api_meta.go b/venus-devtool/util/api_meta.go new file mode 100644 index 0000000000..a17990ed5d --- /dev/null +++ b/venus-devtool/util/api_meta.go @@ -0,0 +1,59 @@ +package util + +import ( + "reflect" + + "github.com/filecoin-project/lotus/api/v0api" + "github.com/filecoin-project/lotus/api/v1api" + + "github.com/filecoin-project/venus/venus-shared/api/chain/v0" + "github.com/filecoin-project/venus/venus-shared/api/chain/v1" +) + +var APIPairs = []struct { + Ver int + Lotus APIMeta + Venus APIMeta +}{ + { + Ver: 0, + Lotus: APIMeta{ + Type: reflect.TypeOf((*v0api.FullNode)(nil)).Elem(), + ParseOpt: InterfaceParseOption{ + ImportPath: "github.com/filecoin-project/lotus/api/v0api", + Included: []string{"FullNode", "Common", "Net"}, + }, + }, + Venus: APIMeta{ + Type: reflect.TypeOf((*v0.FullNode)(nil)).Elem(), + ParseOpt: InterfaceParseOption{ + ImportPath: "github.com/filecoin-project/venus/venus-shared/api/chain/v0", + Included: []string{"FullNode", "Common", "Net"}, + }, + }, + }, + { + Ver: 1, + Lotus: APIMeta{ + Type: reflect.TypeOf((*v1api.FullNode)(nil)).Elem(), + ParseOpt: InterfaceParseOption{ + ImportPath: "github.com/filecoin-project/lotus/api", + IncludeAll: true, + }, + }, + Venus: APIMeta{ + Type: reflect.TypeOf((*v1.FullNode)(nil)).Elem(), + ParseOpt: InterfaceParseOption{ + ImportPath: "github.com/filecoin-project/venus/venus-shared/api/chain/v1", + IncludeAll: true, + }, + }, + }, +} + +var LatestAPIPair = APIPairs[len(APIPairs)-1] + +type APIMeta struct { + Type reflect.Type + ParseOpt InterfaceParseOption +} diff --git a/venus-devtool/util/interface.go b/venus-devtool/util/interface.go index d7ffce6384..0c836a24a7 100644 --- a/venus-devtool/util/interface.go +++ b/venus-devtool/util/interface.go @@ -8,6 +8,12 @@ import ( "strings" ) +type InterfaceParseOption struct { + ImportPath string + IncludeAll bool + Included []string +} + type InterfaceMeta struct { Pkg string File string @@ -26,6 +32,8 @@ type InterfaceMethodMeta struct { type ifaceMetaVisitor struct { pname string fname string + included map[string]struct{} + includAll bool comments ast.CommentMap ifaces []*InterfaceMeta ifaceIdxes map[string]int @@ -42,6 +50,10 @@ func (iv *ifaceMetaVisitor) Visit(node ast.Node) ast.Visitor { return iv } + if _, yes := iv.included[st.Name.Name]; !yes && !iv.includAll { + return iv + } + ifaceIdx, ok := iv.ifaceIdxes[st.Name.Name] if !ok { ifaceIdx = len(iv.ifaces) @@ -72,8 +84,8 @@ func (iv *ifaceMetaVisitor) Visit(node ast.Node) ast.Visitor { return iv } -func ParseInterfaceMetas(importPath string) ([]*InterfaceMeta, error) { - location, err := FindLocationForImportPath(importPath) +func ParseInterfaceMetas(opt InterfaceParseOption) ([]*InterfaceMeta, error) { + location, err := FindLocationForImportPath(opt.ImportPath) if err != nil { return nil, err } @@ -86,6 +98,11 @@ func ParseInterfaceMetas(importPath string) ([]*InterfaceMeta, error) { var metas []*InterfaceMeta + included := map[string]struct{}{} + for _, one := range opt.Included { + included[one] = struct{}{} + } + for pname, pkg := range pkgs { if strings.HasSuffix(pname, "_test") { continue @@ -93,6 +110,8 @@ func ParseInterfaceMetas(importPath string) ([]*InterfaceMeta, error) { visitor := &ifaceMetaVisitor{ pname: pname, + included: included, + includAll: opt.IncludeAll, ifaceIdxes: map[string]int{}, } From 23ef293d98976d3e05ec94b75c284248e70c8841 Mon Sep 17 00:00:00 2001 From: dtynn Date: Thu, 20 Jan 2022 10:50:26 +0800 Subject: [PATCH 2/2] checks for all api versions --- Makefile | 2 +- venus-devtool/compatible/apis/diff.go | 4 +- venus-devtool/compatible/apis/perm.go | 49 ++--- venus-devtool/util/api_meta.go | 4 +- venus-shared/compatible-checks/api-diff.txt | 189 ++++++++++++++++++++ venus-shared/compatible-checks/api-perm.txt | 131 +++++++++----- 6 files changed, 308 insertions(+), 71 deletions(-) diff --git a/Makefile b/Makefile index 55b0707b30..87083a9add 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ test-venus-shared: compatible-all: compatible-api compatible-actor -compatible-api: api-checksum api-diff +compatible-api: api-checksum api-diff api-perm api-checksum: cd venus-devtool && go run ./compatible/apis/*.go checksum > ../venus-shared/compatible-checks/api-checksum.txt diff --git a/venus-devtool/compatible/apis/diff.go b/venus-devtool/compatible/apis/diff.go index 615df3f4a0..a45a2a4114 100644 --- a/venus-devtool/compatible/apis/diff.go +++ b/venus-devtool/compatible/apis/diff.go @@ -16,7 +16,9 @@ var diffCmd = &cli.Command{ Name: "diff", Flags: []cli.Flag{}, Action: func(cctx *cli.Context) error { - showDiff(util.LatestAPIPair.Venus.Type, util.LatestAPIPair.Lotus.Type) + for _, pair := range util.APIPairs { + showDiff(pair.Venus.Type, pair.Lotus.Type) + } return nil }, } diff --git a/venus-devtool/compatible/apis/perm.go b/venus-devtool/compatible/apis/perm.go index c643edb7f3..9db33ca20d 100644 --- a/venus-devtool/compatible/apis/perm.go +++ b/venus-devtool/compatible/apis/perm.go @@ -14,36 +14,39 @@ var permCmd = &cli.Command{ Name: "perm", Flags: []cli.Flag{}, Action: func(cctx *cli.Context) error { - originMetas, err := parsePermMetas(util.LatestAPIPair.Lotus.ParseOpt) - if err != nil { - log.Fatalln("parse lotus api interfaces:", err) - } - - targetMetas, err := parsePermMetas(util.LatestAPIPair.Venus.ParseOpt) - if err != nil { - log.Fatalln("parse venus chain api interfaces:", err) - } + for _, pair := range util.APIPairs { + originMetas, err := parsePermMetas(pair.Lotus.ParseOpt) + if err != nil { + log.Fatalln("parse lotus api interfaces:", err) + } - originMap := map[string]permMeta{} - for _, om := range originMetas { - if om.perm != "" { - originMap[om.meth] = om + targetMetas, err := parsePermMetas(pair.Venus.ParseOpt) + if err != nil { + log.Fatalln("parse venus chain api interfaces:", err) } - } - for _, tm := range targetMetas { - om, has := originMap[tm.meth] - if !has { - fmt.Printf("%s.%s: %s <> N/A\n", tm.iface, tm.meth, tm.perm) - continue + originMap := map[string]permMeta{} + for _, om := range originMetas { + if om.perm != "" { + originMap[om.meth] = om + } } - if tm.perm != om.perm { - fmt.Printf("%s.%s: %s <> %s.%s: %s\n", tm.iface, tm.meth, tm.perm, om.iface, om.meth, om.perm) + fmt.Printf("v%d: %s <> %s\n", pair.Ver, pair.Venus.ParseOpt.ImportPath, pair.Lotus.ParseOpt.ImportPath) + for _, tm := range targetMetas { + om, has := originMap[tm.meth] + if !has { + fmt.Printf("\t- %s.%s\n", tm.iface, tm.meth) + continue + } + + if tm.perm != om.perm { + fmt.Printf("\t> %s.%s: %s <> %s.%s: %s\n", tm.iface, tm.meth, tm.perm, om.iface, om.meth, om.perm) + } } - } - fmt.Println() + fmt.Println() + } return nil }, diff --git a/venus-devtool/util/api_meta.go b/venus-devtool/util/api_meta.go index a17990ed5d..5c7a5bed15 100644 --- a/venus-devtool/util/api_meta.go +++ b/venus-devtool/util/api_meta.go @@ -28,7 +28,7 @@ var APIPairs = []struct { Type: reflect.TypeOf((*v0.FullNode)(nil)).Elem(), ParseOpt: InterfaceParseOption{ ImportPath: "github.com/filecoin-project/venus/venus-shared/api/chain/v0", - Included: []string{"FullNode", "Common", "Net"}, + IncludeAll: true, }, }, }, @@ -38,7 +38,7 @@ var APIPairs = []struct { Type: reflect.TypeOf((*v1api.FullNode)(nil)).Elem(), ParseOpt: InterfaceParseOption{ ImportPath: "github.com/filecoin-project/lotus/api", - IncludeAll: true, + Included: []string{"FullNode", "Common", "Net"}, }, }, Venus: APIMeta{ diff --git a/venus-shared/compatible-checks/api-diff.txt b/venus-shared/compatible-checks/api-diff.txt index 55da15f9cf..65ccda5a44 100644 --- a/venus-shared/compatible-checks/api-diff.txt +++ b/venus-shared/compatible-checks/api-diff.txt @@ -1,3 +1,192 @@ +github.com/filecoin-project/venus/venus-shared/api/chain/v0.FullNode <> github.com/filecoin-project/lotus/api/v0api.FullNode: + - AuthVerify + + BlockTime + > ChainExport {[func(context.Context, abi.ChainEpoch, bool, types.TipSetKey) (<-chan []uint8, error) <> func(context.Context, abi.ChainEpoch, bool, types.TipSetKey) (<-chan []uint8, error)] base=func in type: #3 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + - ChainGetGenesis + > ChainGetMessagesInTipset {[func(context.Context, types.TipSetKey) ([]types.MessageCID, error) <> func(context.Context, types.TipSetKey) ([]api.Message, error)] base=func in type: #1 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + - ChainGetNode + > ChainGetPath {[func(context.Context, types.TipSetKey, types.TipSetKey) ([]*types.HeadChange, error) <> func(context.Context, types.TipSetKey, types.TipSetKey) ([]*api.HeadChange, error)] base=func in type: #1 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > ChainGetRandomnessFromBeacon {[func(context.Context, types.TipSetKey, crypto.DomainSeparationTag, abi.ChainEpoch, []uint8) (abi.Randomness, error) <> func(context.Context, types.TipSetKey, crypto.DomainSeparationTag, abi.ChainEpoch, []uint8) (abi.Randomness, error)] base=func in type: #1 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > ChainGetRandomnessFromTickets {[func(context.Context, types.TipSetKey, crypto.DomainSeparationTag, abi.ChainEpoch, []uint8) (abi.Randomness, error) <> func(context.Context, types.TipSetKey, crypto.DomainSeparationTag, abi.ChainEpoch, []uint8) (abi.Randomness, error)] base=func in type: #1 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + + ChainGetReceipts + > ChainGetTipSet {[func(context.Context, types.TipSetKey) (*types.TipSet, error) <> func(context.Context, types.TipSetKey) (*types.TipSet, error)] base=func in type: #1 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > ChainGetTipSetByHeight {[func(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error) <> func(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + + ChainList + > ChainSetHead {[func(context.Context, types.TipSetKey) error <> func(context.Context, types.TipSetKey) error] base=func in type: #1 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + + ChainSyncHandleNewTipSet + > ChainTipSetWeight {[func(context.Context, types.TipSetKey) (big.Int, error) <> func(context.Context, types.TipSetKey) (big.Int, error)] base=func in type: #1 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + - ClientCalcCommP + - ClientCancelDataTransfer + - ClientCancelRetrievalDeal + - ClientDataTransferUpdates + - ClientDealPieceCID + - ClientDealSize + - ClientFindData + - ClientGenCar + - ClientGetDealInfo + - ClientGetDealStatus + - ClientGetDealUpdates + - ClientGetRetrievalUpdates + - ClientHasLocal + - ClientImport + - ClientListDataTransfers + - ClientListDeals + - ClientListImports + - ClientListRetrievals + - ClientMinerQueryOffer + - ClientQueryAsk + - ClientRemoveImport + - ClientRestartDataTransfer + - ClientRetrieve + - ClientRetrieveTryRestartInsufficientFunds + - ClientRetrieveWithEvents + - ClientStartDeal + - ClientStatelessDeal + - Closing + + Concurrent + - CreateBackup + - Discover + + GasBatchEstimateMessageGas + > GasEstimateFeeCap {[func(context.Context, *internal.Message, int64, types.TipSetKey) (big.Int, error) <> func(context.Context, *types.Message, int64, types.TipSetKey) (big.Int, error)] base=func in type: #3 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > GasEstimateGasLimit {[func(context.Context, *internal.Message, types.TipSetKey) (int64, error) <> func(context.Context, *types.Message, types.TipSetKey) (int64, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > GasEstimateGasPremium {[func(context.Context, uint64, address.Address, int64, types.TipSetKey) (big.Int, error) <> func(context.Context, uint64, address.Address, int64, types.TipSetKey) (big.Int, error)] base=func in type: #4 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > GasEstimateMessageGas {[func(context.Context, *internal.Message, *types.MessageSendSpec, types.TipSetKey) (*internal.Message, error) <> func(context.Context, *types.Message, *api.MessageSendSpec, types.TipSetKey) (*types.Message, 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: 2 != 1; nested=nil}}}} + + GetActor + + GetEntry + + GetFullBlock + + GetParentStateRootActor + + HasPassword + - ID + + ListActor + + LockWallet + - LogAlerts + - LogList + - LogSetLevel + - MarketAddBalance + - MarketGetReserved + - MarketReleaseFunds + - MarketReserveFunds + - MarketWithdraw + + MessageWait + > MinerCreateBlock {[func(context.Context, *types.BlockTemplate) (*types.BlockMsg, error) <> func(context.Context, *api.BlockTemplate) (*types.BlockMsg, error)] base=func in type: #1 input; nested={[*types.BlockTemplate <> *api.BlockTemplate] base=pointed type; nested={[types.BlockTemplate <> api.BlockTemplate] base=struct field; nested={[types.BlockTemplate <> api.BlockTemplate] base=exported field type: #1 field named Parents; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}}}}} + > MinerGetBaseInfo {[func(context.Context, address.Address, abi.ChainEpoch, types.TipSetKey) (*types.MiningBaseInfo, error) <> func(context.Context, address.Address, abi.ChainEpoch, types.TipSetKey) (*api.MiningBaseInfo, error)] base=func in type: #3 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > MpoolBatchPushMessage {[func(context.Context, []*internal.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: 2 != 1; nested=nil}}}} + + MpoolDeleteByAdress + > MpoolPending {[func(context.Context, types.TipSetKey) ([]*types.SignedMessage, error) <> func(context.Context, types.TipSetKey) ([]*types.SignedMessage, error)] base=func in type: #1 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + + MpoolPublishByAddr + + MpoolPublishMessage + > MpoolPushMessage {[func(context.Context, *internal.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: 2 != 1; nested=nil}}}} + > MpoolSelect {[func(context.Context, types.TipSetKey, float64) ([]*types.SignedMessage, error) <> func(context.Context, types.TipSetKey, float64) ([]*types.SignedMessage, error)] base=func in type: #1 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + + MpoolSelects + > MsigCancel {[func(context.Context, address.Address, uint64, address.Address) (cid.Cid, error) <> func(context.Context, address.Address, uint64, address.Address, big.Int, address.Address, uint64, []uint8) (cid.Cid, error)] base=func in num: 4 != 8; nested=nil} + + MsigCancelTxnHash + - MsigGetAvailableBalance + - MsigGetPending + > MsigGetVested {[func(context.Context, address.Address, types.TipSetKey, types.TipSetKey) (big.Int, error) <> func(context.Context, address.Address, types.TipSetKey, types.TipSetKey) (big.Int, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + - MsigGetVestingSchedule + - NetAgentVersion + - NetAutoNatStatus + - NetBandwidthStats + - NetBandwidthStatsByPeer + - NetBandwidthStatsByProtocol + - NetBlockAdd + - NetBlockList + - NetBlockRemove + - NetConnect + - NetConnectedness + - NetDisconnect + - NetFindPeer + - NetPeerInfo + - NetPeers + - NetPubsubScores + + NetworkConnect + + NetworkFindPeer + + NetworkFindProvidersAsync + + NetworkGetBandwidthStats + + NetworkGetClosestPeers + + NetworkGetPeerAddresses + + NetworkGetPeerID + + NetworkPeers + + ProtocolParameters + + ResolveToKeyAddr + - Session + + SetConcurrent + + SetPassword + - Shutdown + > StateAccountKey {[func(context.Context, address.Address, types.TipSetKey) (address.Address, error) <> func(context.Context, address.Address, types.TipSetKey) (address.Address, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + - StateAllMinerFaults + > StateCall {[func(context.Context, *internal.Message, types.TipSetKey) (*types.InvocResult, error) <> func(context.Context, *types.Message, types.TipSetKey) (*api.InvocResult, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + - StateChangedActors + > StateCirculatingSupply {[func(context.Context, types.TipSetKey) (big.Int, error) <> func(context.Context, types.TipSetKey) (big.Int, error)] base=func in type: #1 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + - StateCompute + > StateDealProviderCollateralBounds {[func(context.Context, abi.PaddedPieceSize, bool, types.TipSetKey) (types.DealCollateralBounds, error) <> func(context.Context, abi.PaddedPieceSize, bool, types.TipSetKey) (api.DealCollateralBounds, error)] base=func in type: #3 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + - StateDecodeParams + > StateGetActor {[func(context.Context, address.Address, types.TipSetKey) (*internal.Actor, error) <> func(context.Context, address.Address, types.TipSetKey) (*types.Actor, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + - StateGetRandomnessFromBeacon + - StateGetRandomnessFromTickets + > StateGetReceipt {[func(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error) <> func(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateListActors {[func(context.Context, types.TipSetKey) ([]address.Address, error) <> func(context.Context, types.TipSetKey) ([]address.Address, error)] base=func in type: #1 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + - StateListMessages + > StateListMiners {[func(context.Context, types.TipSetKey) ([]address.Address, error) <> func(context.Context, types.TipSetKey) ([]address.Address, error)] base=func in type: #1 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateLookupID {[func(context.Context, address.Address, types.TipSetKey) (address.Address, error) <> func(context.Context, address.Address, types.TipSetKey) (address.Address, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateMarketBalance {[func(context.Context, address.Address, types.TipSetKey) (types.MarketBalance, error) <> func(context.Context, address.Address, types.TipSetKey) (api.MarketBalance, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateMarketDeals {[func(context.Context, types.TipSetKey) (map[string]types.MarketDeal, error) <> func(context.Context, types.TipSetKey) (map[string]api.MarketDeal, error)] base=func in type: #1 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateMarketParticipants {[func(context.Context, types.TipSetKey) (map[string]types.MarketBalance, error) <> func(context.Context, types.TipSetKey) (map[string]api.MarketBalance, error)] base=func in type: #1 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateMarketStorageDeal {[func(context.Context, abi.DealID, types.TipSetKey) (*types.MarketDeal, error) <> func(context.Context, abi.DealID, types.TipSetKey) (*api.MarketDeal, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateMinerActiveSectors {[func(context.Context, address.Address, types.TipSetKey) ([]*miner.SectorOnChainInfo, error) <> func(context.Context, address.Address, types.TipSetKey) ([]*miner.SectorOnChainInfo, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateMinerAvailableBalance {[func(context.Context, address.Address, types.TipSetKey) (big.Int, error) <> func(context.Context, address.Address, types.TipSetKey) (big.Int, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateMinerDeadlines {[func(context.Context, address.Address, types.TipSetKey) ([]types.Deadline, error) <> func(context.Context, address.Address, types.TipSetKey) ([]api.Deadline, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateMinerFaults {[func(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error) <> func(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateMinerInfo {[func(context.Context, address.Address, types.TipSetKey) (miner.MinerInfo, error) <> func(context.Context, address.Address, types.TipSetKey) (miner.MinerInfo, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateMinerInitialPledgeCollateral {[func(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (big.Int, error) <> func(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (big.Int, error)] base=func in type: #3 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateMinerPartitions {[func(context.Context, address.Address, uint64, types.TipSetKey) ([]types.Partition, error) <> func(context.Context, address.Address, uint64, types.TipSetKey) ([]api.Partition, error)] base=func in type: #3 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateMinerPower {[func(context.Context, address.Address, types.TipSetKey) (*types.MinerPower, error) <> func(context.Context, address.Address, types.TipSetKey) (*api.MinerPower, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateMinerPreCommitDepositForPower {[func(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (big.Int, error) <> func(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (big.Int, error)] base=func in type: #3 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateMinerProvingDeadline {[func(context.Context, address.Address, types.TipSetKey) (*dline.Info, error) <> func(context.Context, address.Address, types.TipSetKey) (*dline.Info, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateMinerRecoveries {[func(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error) <> func(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateMinerSectorAllocated {[func(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (bool, error) <> func(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (bool, error)] base=func in type: #3 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateMinerSectorCount {[func(context.Context, address.Address, types.TipSetKey) (types.MinerSectors, error) <> func(context.Context, address.Address, types.TipSetKey) (api.MinerSectors, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + + StateMinerSectorSize + > StateMinerSectors {[func(context.Context, address.Address, *bitfield.BitField, types.TipSetKey) ([]*miner.SectorOnChainInfo, error) <> func(context.Context, address.Address, *bitfield.BitField, types.TipSetKey) ([]*miner.SectorOnChainInfo, error)] base=func in type: #3 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + + StateMinerWorkerAddress + > StateNetworkVersion {[func(context.Context, types.TipSetKey) (network.Version, error) <> func(context.Context, types.TipSetKey) (network.Version, error)] base=func in type: #1 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + - StateReadState + - StateReplay + > StateSearchMsg {[func(context.Context, cid.Cid) (*types.MsgLookup, error) <> func(context.Context, cid.Cid) (*api.MsgLookup, error)] base=func out type: #0 input; nested={[*types.MsgLookup <> *api.MsgLookup] base=pointed type; nested={[types.MsgLookup <> api.MsgLookup] base=struct field; nested={[types.MsgLookup <> api.MsgLookup] base=exported field type: #3 field named TipSet; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}}}}} + > StateSearchMsgLimited {[func(context.Context, cid.Cid, abi.ChainEpoch) (*types.MsgLookup, error) <> func(context.Context, cid.Cid, abi.ChainEpoch) (*api.MsgLookup, error)] base=func out type: #0 input; nested={[*types.MsgLookup <> *api.MsgLookup] base=pointed type; nested={[types.MsgLookup <> api.MsgLookup] base=struct field; nested={[types.MsgLookup <> api.MsgLookup] base=exported field type: #3 field named TipSet; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}}}}} + > StateSectorExpiration {[func(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorExpiration, error) <> func(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorExpiration, error)] base=func in type: #3 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateSectorGetInfo {[func(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorOnChainInfo, error) <> func(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorOnChainInfo, error)] base=func in type: #3 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateSectorPartition {[func(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorLocation, error) <> func(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorLocation, error)] base=func in type: #3 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > 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 in type: #3 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateVMCirculatingSupplyInternal {[func(context.Context, types.TipSetKey) (types.CirculatingSupply, error) <> func(context.Context, types.TipSetKey) (api.CirculatingSupply, error)] base=func in type: #1 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateVerifiedClientStatus {[func(context.Context, address.Address, types.TipSetKey) (*big.Int, error) <> func(context.Context, address.Address, types.TipSetKey) (*big.Int, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateVerifiedRegistryRootKey {[func(context.Context, types.TipSetKey) (address.Address, error) <> func(context.Context, types.TipSetKey) (address.Address, error)] base=func in type: #1 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateVerifierStatus {[func(context.Context, address.Address, types.TipSetKey) (*big.Int, error) <> func(context.Context, address.Address, types.TipSetKey) (*big.Int, error)] base=func in type: #2 input; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}} + > StateWaitMsg {[func(context.Context, cid.Cid, uint64) (*types.MsgLookup, error) <> func(context.Context, cid.Cid, uint64) (*api.MsgLookup, error)] base=func out type: #0 input; nested={[*types.MsgLookup <> *api.MsgLookup] base=pointed type; nested={[types.MsgLookup <> api.MsgLookup] base=struct field; nested={[types.MsgLookup <> api.MsgLookup] base=exported field type: #3 field named TipSet; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}}}}} + > StateWaitMsgLimited {[func(context.Context, cid.Cid, uint64, abi.ChainEpoch) (*types.MsgLookup, error) <> func(context.Context, cid.Cid, uint64, abi.ChainEpoch) (*api.MsgLookup, error)] base=func out type: #0 input; nested={[*types.MsgLookup <> *api.MsgLookup] base=pointed type; nested={[types.MsgLookup <> api.MsgLookup] base=struct field; nested={[types.MsgLookup <> api.MsgLookup] base=exported field type: #3 field named TipSet; nested={[types.TipSetKey <> types.TipSetKey] base=codec marshaler implementations for codec Cbor: true != false; nested=nil}}}}} + - SyncCheckBad + - SyncCheckpoint + - SyncIncomingBlocks + - SyncMarkBad + - SyncUnmarkAllBad + - SyncUnmarkBad + - SyncValidateTipset + + SyncerTracker + + UnLockWallet + + Verify + + VerifyEntry + > Version {[func(context.Context) (types.Version, error) <> func(context.Context) (api.APIVersion, error)] base=func out type: #0 input; nested={[types.Version <> api.APIVersion] base=struct field; nested={[types.Version <> api.APIVersion] base=exported fields count: 2 != 3; nested=nil}}} + + WalletAddresses + - WalletDelete + > WalletExport {[func(context.Context, address.Address, string) (*types.KeyInfo, error) <> func(context.Context, address.Address) (*types.KeyInfo, error)] base=func in num: 3 != 2; nested=nil} + - WalletList + - WalletNew + + WalletNewAddress + > WalletSign {[func(context.Context, address.Address, []uint8, types.MsgMeta) (*crypto.Signature, error) <> func(context.Context, address.Address, []uint8) (*crypto.Signature, error)] base=func in num: 4 != 3; nested=nil} + + WalletState + - WalletValidateAddress + - WalletVerify + github.com/filecoin-project/venus/venus-shared/api/chain/v1.FullNode <> github.com/filecoin-project/lotus/api.FullNode: - AuthVerify + BlockTime diff --git a/venus-shared/compatible-checks/api-perm.txt b/venus-shared/compatible-checks/api-perm.txt index 18dff3a899..323f77896e 100644 --- a/venus-shared/compatible-checks/api-perm.txt +++ b/venus-shared/compatible-checks/api-perm.txt @@ -1,45 +1,88 @@ -IActor.ListActor: read <> N/A -IChainInfo.BlockTime: read <> N/A -IChainInfo.ChainGetRandomnessFromBeacon: read <> N/A -IChainInfo.ChainGetRandomnessFromTickets: read <> N/A -IChainInfo.ChainGetReceipts: read <> N/A -IChainInfo.ChainList: read <> N/A -IChainInfo.GetActor: read <> N/A -IChainInfo.GetEntry: read <> N/A -IChainInfo.GetFullBlock: read <> N/A -IChainInfo.GetParentStateRootActor: read <> N/A -IChainInfo.MessageWait: read <> N/A -IChainInfo.ProtocolParameters: read <> N/A -IChainInfo.ResolveToKeyAddr: read <> N/A -IChainInfo.VerifyEntry: read <> N/A -IMinerState.StateMinerSectorSize: read <> N/A -IMinerState.StateMinerWorkerAddress: read <> N/A -IJwtAuthAPI.Verify: read <> N/A -IMessagePool.GasBatchEstimateMessageGas: read <> N/A -IMessagePool.MpoolDeleteByAdress: admin <> N/A -IMessagePool.MpoolPublishByAddr: write <> N/A -IMessagePool.MpoolPublishMessage: write <> N/A -IMessagePool.MpoolSelects: read <> N/A -INetwork.NetworkConnect: read <> N/A -INetwork.NetworkFindPeer: read <> N/A -INetwork.NetworkFindProvidersAsync: read <> N/A -INetwork.NetworkGetBandwidthStats: admin <> N/A -INetwork.NetworkGetClosestPeers: read <> N/A -INetwork.NetworkGetPeerAddresses: admin <> N/A -INetwork.NetworkGetPeerID: admin <> N/A -INetwork.NetworkPeers: read <> N/A -INetwork.Version: read <> Worker.Version: admin -ISyncer.ChainSyncHandleNewTipSet: write <> N/A -ISyncer.Concurrent: read <> N/A -ISyncer.SetConcurrent: admin <> N/A -ISyncer.SyncerTracker: read <> N/A -IWallet.HasPassword: admin <> N/A -IWallet.LockWallet: admin <> N/A -IWallet.SetPassword: admin <> N/A -IWallet.UnLockWallet: admin <> N/A -IWallet.WalletAddresses: admin <> N/A -IWallet.WalletHas: write <> Wallet.WalletHas: admin -IWallet.WalletNewAddress: write <> N/A -IWallet.WalletSign: sign <> Wallet.WalletSign: admin -IWallet.WalletState: admin <> N/A +v0: github.com/filecoin-project/venus/venus-shared/api/chain/v0 <> github.com/filecoin-project/lotus/api/v0api + - IActor.ListActor + - IChainInfo.BlockTime + - IChainInfo.ChainGetReceipts + - IChainInfo.ChainList + - IChainInfo.GetActor + - IChainInfo.GetEntry + - IChainInfo.GetFullBlock + - IChainInfo.GetParentStateRootActor + - IChainInfo.MessageWait + - IChainInfo.ProtocolParameters + - IChainInfo.ResolveToKeyAddr + - IChainInfo.VerifyEntry + - IMinerState.StateMinerSectorSize + - IMinerState.StateMinerWorkerAddress + - IJwtAuthAPI.AuthNew + - IJwtAuthAPI.Verify + - IMessagePool.GasBatchEstimateMessageGas + - IMessagePool.MpoolDeleteByAdress + - IMessagePool.MpoolPublishByAddr + - IMessagePool.MpoolPublishMessage + - IMessagePool.MpoolSelects + - IMultiSig.MsigCancelTxnHash + - INetwork.NetAddrsListen + - INetwork.NetworkConnect + - INetwork.NetworkFindPeer + - INetwork.NetworkFindProvidersAsync + - INetwork.NetworkGetBandwidthStats + - INetwork.NetworkGetClosestPeers + - INetwork.NetworkGetPeerAddresses + - INetwork.NetworkGetPeerID + - INetwork.NetworkPeers + - INetwork.Version + - ISyncer.ChainSyncHandleNewTipSet + - ISyncer.Concurrent + - ISyncer.SetConcurrent + - ISyncer.SyncerTracker + - IWallet.HasPassword + - IWallet.LockWallet + - IWallet.SetPassword + - IWallet.UnLockWallet + - IWallet.WalletAddresses + - IWallet.WalletNewAddress + - IWallet.WalletState + +v1: github.com/filecoin-project/venus/venus-shared/api/chain/v1 <> github.com/filecoin-project/lotus/api + - IActor.ListActor + - IChainInfo.BlockTime + - IChainInfo.ChainGetRandomnessFromBeacon + - IChainInfo.ChainGetRandomnessFromTickets + - IChainInfo.ChainGetReceipts + - IChainInfo.ChainList + - IChainInfo.GetActor + - IChainInfo.GetEntry + - IChainInfo.GetFullBlock + - IChainInfo.GetParentStateRootActor + - IChainInfo.MessageWait + - IChainInfo.ProtocolParameters + - IChainInfo.ResolveToKeyAddr + - IChainInfo.VerifyEntry + - IMinerState.StateMinerSectorSize + - IMinerState.StateMinerWorkerAddress + - IJwtAuthAPI.Verify + - IMessagePool.GasBatchEstimateMessageGas + - IMessagePool.MpoolDeleteByAdress + - IMessagePool.MpoolPublishByAddr + - IMessagePool.MpoolPublishMessage + - IMessagePool.MpoolSelects + - INetwork.NetworkConnect + - INetwork.NetworkFindPeer + - INetwork.NetworkFindProvidersAsync + - INetwork.NetworkGetBandwidthStats + - INetwork.NetworkGetClosestPeers + - INetwork.NetworkGetPeerAddresses + - INetwork.NetworkGetPeerID + - INetwork.NetworkPeers + - ISyncer.ChainSyncHandleNewTipSet + - ISyncer.Concurrent + - ISyncer.SetConcurrent + - ISyncer.SyncerTracker + - IWallet.HasPassword + - IWallet.LockWallet + - IWallet.SetPassword + - IWallet.UnLockWallet + - IWallet.WalletAddresses + - IWallet.WalletNewAddress + - IWallet.WalletState