Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: build v1.6.0 #4988

Merged
merged 4 commits into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions app/submodule/chain/beacon.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package chain

import (
"context"

"github.com/filecoin-project/go-state-types/abi"
v1api "github.com/filecoin-project/venus/venus-shared/api/chain/v1"
"github.com/filecoin-project/venus/venus-shared/types"
)

var _ v1api.IBeacon = &beaconAPI{}

type beaconAPI struct {
chain *ChainSubmodule
}

//NewBeaconAPI create a new beacon api
func NewBeaconAPI(chain *ChainSubmodule) v1api.IBeacon {
return &beaconAPI{chain: chain}
}

// BeaconGetEntry returns the beacon entry for the given filecoin epoch. If
// the entry has not yet been produced, the call will block until the entry
// becomes available
func (beaconAPI *beaconAPI) BeaconGetEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) {
return beaconAPI.chain.API().StateGetBeaconEntry(ctx, epoch)
}
1 change: 1 addition & 0 deletions app/submodule/chain/chain_submodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ func (chain *ChainSubmodule) API() v1api.IChain {
IActor: NewActorAPI(chain),
IChainInfo: NewChainInfoAPI(chain),
IMinerState: NewMinerStateAPI(chain),
IBeacon: NewBeaconAPI(chain),
}
}

Expand Down
29 changes: 29 additions & 0 deletions app/submodule/chain/chaininfo_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
logging "github.com/ipfs/go-log/v2"

"github.com/filecoin-project/venus/pkg/chain"
"github.com/filecoin-project/venus/venus-shared/actors"
v1api "github.com/filecoin-project/venus/venus-shared/api/chain/v1"
"github.com/filecoin-project/venus/venus-shared/types"
)
Expand Down Expand Up @@ -678,3 +679,31 @@ func (cia *chainInfoAPI) StateGetNetworkParams(ctx context.Context) (*types.Netw

return params, nil
}

// StateActorCodeCIDs returns the CIDs of all the builtin actors for the given network version
func (cia *chainInfoAPI) StateActorCodeCIDs(ctx context.Context, nv network.Version) (map[string]cid.Cid, error) {
actorVersion, err := actors.VersionForNetwork(nv)
if err != nil {
return nil, fmt.Errorf("invalid network version")
}

cids := make(map[string]cid.Cid)

manifestCid, ok := actors.GetManifest(actorVersion)
if !ok {
return nil, fmt.Errorf("cannot get manifest CID")
}

cids["_manifest"] = manifestCid

var actorKeys = actors.GetBuiltinActorsKeys()
for _, name := range actorKeys {
actorCID, ok := actors.GetActorCodeID(actorVersion, name)
if !ok {
return nil, fmt.Errorf("didn't find actor %v code id for actor version %d", name,
actorVersion)
}
cids[name] = actorCID
}
return cids, nil
}
19 changes: 6 additions & 13 deletions cmd/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,23 +636,16 @@ var stateSysActorCIDsCmd = &cmds.Command{
}
buf.WriteString(fmt.Sprintf("Actor Version: %d\n", actorVersion))

manifestCid, ok := actors.GetManifest(actorVersion)
if !ok {
return fmt.Errorf("cannot get manifest CID")
}
buf.WriteString(fmt.Sprintf("Manifest CID: %v\n\n", manifestCid))

tw := tablewriter.New(tablewriter.Col("Actor"), tablewriter.Col("CID"))

for _, name := range actors.GetBuiltinActorsKeys() {
sysActorCID, ok := actors.GetActorCodeID(actorVersion, name)
if !ok {
return fmt.Errorf("error getting actor %v code id for actor version %d", name,
actorVersion)
}
actorsCids, err := env.(*node.Env).ChainAPI.StateActorCodeCIDs(ctx, nv)
if err != nil {
return err
}
for name, cid := range actorsCids {
tw.Write(map[string]interface{}{
"Actor": name,
"CID": sysActorCID.String(),
"CID": cid.String(),
})
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ require (
github.com/filecoin-project/specs-actors/v8 v8.0.1
github.com/filecoin-project/specs-storage v0.4.1
github.com/filecoin-project/test-vectors/schema v0.0.5
github.com/filecoin-project/venus-auth v1.6.0-pre-rc1
github.com/filecoin-project/venus-auth v1.6.0
github.com/fxamacker/cbor/v2 v2.4.0
github.com/gbrlsnchs/jwt/v3 v3.0.1
github.com/go-errors/errors v1.0.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ github.com/filecoin-project/storetheindex v0.3.5 h1:KoS9TvjPm6zIZfUH8atAHJbVHOO7
github.com/filecoin-project/storetheindex v0.3.5/go.mod h1:0r3d0kSpK63O6AvLr1CjAINLi+nWD49clzcnKV+GLpI=
github.com/filecoin-project/test-vectors/schema v0.0.5 h1:w3zHQhzM4pYxJDl21avXjOKBLF8egrvwUwjpT8TquDg=
github.com/filecoin-project/test-vectors/schema v0.0.5/go.mod h1:iQ9QXLpYWL3m7warwvK1JC/pTri8mnfEmKygNDqqY6E=
github.com/filecoin-project/venus-auth v1.6.0-pre-rc1 h1:Ql7PezoiWm/JFtA8hDI8XAe1ALDeAN3GD8kxw99iM0Q=
github.com/filecoin-project/venus-auth v1.6.0-pre-rc1/go.mod h1:x/Cv3zz9z5O+/uqIKgYtk5UsL7nYu+CtiPjyVQ8Lywg=
github.com/filecoin-project/venus-auth v1.6.0 h1:DLl7q5g1eh6UTpp98MLpRWAI79k6TUw1Myh/RLeaFpU=
github.com/filecoin-project/venus-auth v1.6.0/go.mod h1:x/Cv3zz9z5O+/uqIKgYtk5UsL7nYu+CtiPjyVQ8Lywg=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ=
github.com/flynn/noise v1.0.0 h1:DlTHqmzmvcEiKj+4RYo/imoswx/4r6iBlCMfVtrMXpQ=
Expand Down
2 changes: 1 addition & 1 deletion pkg/constants/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

// BuildVersion is the local build version, set by build system
const BuildVersion = "1.6.0-rc2"
const BuildVersion = "1.6.0"

var CurrentCommit string

Expand Down
1 change: 1 addition & 0 deletions venus-devtool/api-gen/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ func init() {
addExample(network.ReachabilityPublic)
addExample(map[string]int{"name": 42})
addExample(map[string]time.Time{"name": time.Unix(1615243938, 0).UTC()})
addExample(map[string]cid.Cid{})
addExample(&types.ExecutionTrace{
Msg: ExampleValue("init", reflect.TypeOf(&types.Message{}), nil).(*types.Message),
MsgRct: ExampleValue("init", reflect.TypeOf(&types.MessageReceipt{}), nil).(*types.MessageReceipt),
Expand Down
2 changes: 1 addition & 1 deletion venus-devtool/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/filecoin-project/go-fil-markets v1.20.1-v16-2
github.com/filecoin-project/go-jsonrpc v0.1.5
github.com/filecoin-project/go-state-types v0.1.10
github.com/filecoin-project/lotus v1.16.0-pre-rc.0.20220614091823-016749b60be5
github.com/filecoin-project/lotus v1.16.0
github.com/filecoin-project/venus v0.0.0-00010101000000-000000000000
github.com/ipfs/go-block-format v0.0.3
github.com/ipfs/go-cid v0.1.0
Expand Down
7 changes: 3 additions & 4 deletions venus-devtool/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ github.com/filecoin-project/go-fil-commcid v0.1.0 h1:3R4ds1A9r6cr8mvZBfMYxTS88Oq
github.com/filecoin-project/go-fil-commcid v0.1.0/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ=
github.com/filecoin-project/go-fil-commp-hashhash v0.1.0 h1:imrrpZWEHRnNqqv0tN7LXep5bFEVOVmQWHJvl2mgsGo=
github.com/filecoin-project/go-fil-commp-hashhash v0.1.0/go.mod h1:73S8WSEWh9vr0fDJVnKADhfIv/d6dCbAGaAGWbdJEI8=
github.com/filecoin-project/go-fil-markets v1.20.1-v16-1/go.mod h1:QHJZVEbQ7TydJ6hjK87q4MxOmRfDNbQkuSkdjxtqBWo=
github.com/filecoin-project/go-fil-markets v1.20.1-v16-2 h1:uZHJav35gTGcm2CwY8B+V6fQO9aB1YeUYid2jkb6jXE=
github.com/filecoin-project/go-fil-markets v1.20.1-v16-2/go.mod h1:JLP8bltMbPVhOULcHxE+QFg3b8/a9J8NbcA6Qf69W0k=
github.com/filecoin-project/go-hamt-ipld v0.1.5 h1:uoXrKbCQZ49OHpsTCkrThPNelC4W3LPEk0OrS/ytIBM=
Expand Down Expand Up @@ -375,7 +374,6 @@ github.com/filecoin-project/go-state-types v0.1.4/go.mod h1:xCA/WfKlC2zcn3fUmDv4
github.com/filecoin-project/go-state-types v0.1.5/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.1.8/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.1.9/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.1.10 h1:YrrJWWh2fU4VPhwHyPlDK5I4mB7bqgnRd3HCm9IOwIU=
github.com/filecoin-project/go-state-types v0.1.10/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig=
Expand All @@ -388,8 +386,8 @@ github.com/filecoin-project/go-statestore v0.2.0/go.mod h1:8sjBYbS35HwPzct7iT4lI
github.com/filecoin-project/go-storedcounter v0.1.0/go.mod h1:4ceukaXi4vFURIoxYMfKzaRF5Xv/Pinh2oTnoxpv+z8=
github.com/filecoin-project/index-provider v0.5.0 h1:k2C1RFvOvxmA2i8bhmkb3b4qun7RDRDzzs/y25/TwQg=
github.com/filecoin-project/index-provider v0.5.0/go.mod h1:KHVrP2vU3YuScb+fawObwTFoR882up9U07kk0ZrfP0c=
github.com/filecoin-project/lotus v1.16.0-pre-rc.0.20220614091823-016749b60be5 h1:xPVYrCZNFLiEOfs8LRTCFxADLTzK3SOSb5QtO6vV3ok=
github.com/filecoin-project/lotus v1.16.0-pre-rc.0.20220614091823-016749b60be5/go.mod h1:YrPB+TedOacKPzMf2sxXGMpumGfswz0jXnXdiKdmTj8=
github.com/filecoin-project/lotus v1.16.0 h1:CbCXSoAMHV2Nx9eI6lP0NbRefvnWp4WTZjvOlcqpT/k=
github.com/filecoin-project/lotus v1.16.0/go.mod h1:JVXUiVE0BFW4DeQSElzJ9nCEIFJnBuwo2habuVGpF0c=
github.com/filecoin-project/pubsub v1.0.0/go.mod h1:GkpB33CcUtUNrLPhJgfdy4FDx4OMNR9k+46DHx/Lqrg=
github.com/filecoin-project/specs-actors v0.9.13/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao=
github.com/filecoin-project/specs-actors v0.9.15-0.20220514164640-94e0d5e123bd/go.mod h1:pjGEe3QlWtK20ju/aFRsiArbMX6Cn8rqEhhsiCM9xYE=
Expand All @@ -415,6 +413,7 @@ github.com/filecoin-project/specs-actors/v6 v6.0.2/go.mod h1:wnfVvPnYmzPZilNvSqC
github.com/filecoin-project/specs-actors/v7 v7.0.0/go.mod h1:TA5FwCna+Yi36POaT7SLKXsgEDvJwc0V/L6ZsO19B9M=
github.com/filecoin-project/specs-actors/v7 v7.0.1 h1:w72xCxijK7xs1qzmJiw+WYJaVt2EPHN8oiwpA1Ay3/4=
github.com/filecoin-project/specs-actors/v7 v7.0.1/go.mod h1:tPLEYXoXhcpyLh69Ccq91SOuLXsPWjHiY27CzawjUEk=
github.com/filecoin-project/specs-actors/v8 v8.0.0/go.mod h1:UYIPg65iPWoFw5NEftREdJwv9b/5yaLKdCgTvNI/2FA=
github.com/filecoin-project/specs-actors/v8 v8.0.1 h1:4u0tIRJeT5G7F05lwLRIsDnsrN+bJ5Ixj6h49Q7uE2Y=
github.com/filecoin-project/specs-actors/v8 v8.0.1/go.mod h1:UYIPg65iPWoFw5NEftREdJwv9b/5yaLKdCgTvNI/2FA=
github.com/filecoin-project/specs-storage v0.4.1 h1:yvLEaLZj8f+uByhNC4mFOtCUyL2wQku+NGBp6hjTe9M=
Expand Down
2 changes: 2 additions & 0 deletions venus-shared/api/chain/v0/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ type IChainInfo interface {
ChainGetPath(ctx context.Context, from types.TipSetKey, to types.TipSetKey) ([]*types.HeadChange, error) //perm:read
// StateGetNetworkParams return current network params
StateGetNetworkParams(ctx context.Context) (*types.NetworkParams, error) //perm:read
// StateActorCodeCIDs returns the CIDs of all the builtin actors for the given network version
StateActorCodeCIDs(context.Context, network.Version) (map[string]cid.Cid, error) //perm:read
}

type IMinerState interface {
Expand Down
16 changes: 16 additions & 0 deletions venus-shared/api/chain/v0/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* [MessageWait](#MessageWait)
* [ProtocolParameters](#ProtocolParameters)
* [ResolveToKeyAddr](#ResolveToKeyAddr)
* [StateActorCodeCIDs](#StateActorCodeCIDs)
* [StateGetNetworkParams](#StateGetNetworkParams)
* [StateGetReceipt](#StateGetReceipt)
* [StateNetworkName](#StateNetworkName)
Expand Down Expand Up @@ -1261,6 +1262,21 @@ Inputs:

Response: `"f01234"`

### StateActorCodeCIDs
StateActorCodeCIDs returns the CIDs of all the builtin actors for the given network version


Perms: read

Inputs:
```json
[
16
]
```

Response: `{}`

### StateGetNetworkParams
StateGetNetworkParams return current network params

Expand Down
15 changes: 15 additions & 0 deletions venus-shared/api/chain/v0/mock/mock_fullnode.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions venus-shared/api/chain/v0/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions venus-shared/api/chain/v1/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ type IChainInfo interface {
ChainGetPath(ctx context.Context, from types.TipSetKey, to types.TipSetKey) ([]*types.HeadChange, error) //perm:read
// StateGetNetworkParams return current network params
StateGetNetworkParams(ctx context.Context) (*types.NetworkParams, error) //perm:read
// StateActorCodeCIDs returns the CIDs of all the builtin actors for the given network version
StateActorCodeCIDs(context.Context, network.Version) (map[string]cid.Cid, error) //perm:read
}

type IMinerState interface {
Expand Down
16 changes: 16 additions & 0 deletions venus-shared/api/chain/v1/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
* [MessageWait](#MessageWait)
* [ProtocolParameters](#ProtocolParameters)
* [ResolveToKeyAddr](#ResolveToKeyAddr)
* [StateActorCodeCIDs](#StateActorCodeCIDs)
* [StateGetBeaconEntry](#StateGetBeaconEntry)
* [StateGetNetworkParams](#StateGetNetworkParams)
* [StateGetRandomnessFromBeacon](#StateGetRandomnessFromBeacon)
Expand Down Expand Up @@ -1299,6 +1300,21 @@ Inputs:

Response: `"f01234"`

### StateActorCodeCIDs
StateActorCodeCIDs returns the CIDs of all the builtin actors for the given network version


Perms: read

Inputs:
```json
[
16
]
```

Response: `{}`

### 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
Expand Down
15 changes: 15 additions & 0 deletions venus-shared/api/chain/v1/mock/mock_fullnode.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions venus-shared/api/chain/v1/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions venus-shared/compatible-checks/api-checksum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ v0api.FullNode:
Session: In=1, Out=2, CheckSum=cdb04ef6a97114c8f24f456a2e70f1cd
Shutdown: In=1, Out=1, CheckSum=c39be30cc5a8826024fcf4d23e7017d6
StateAccountKey: In=3, Out=2, CheckSum=9b6f9fdaea5bb22c60772266c418d98f
StateActorCodeCIDs: In=2, Out=2, CheckSum=d52881195cc100121739e6c85c45dd9f
StateAllMinerFaults: In=3, Out=2, CheckSum=a17e05b21e1ecc8da867e2f76df6c46c
StateCall: In=3, Out=2, CheckSum=b33ab6c7df31d805c256c8ab6691b085
StateChangedActors: In=3, Out=2, CheckSum=cbc0cd36e495552a6672caab9f839468
Expand Down Expand Up @@ -365,6 +366,7 @@ api.FullNode:
Session: In=1, Out=2, CheckSum=cdb04ef6a97114c8f24f456a2e70f1cd
Shutdown: In=1, Out=1, CheckSum=c39be30cc5a8826024fcf4d23e7017d6
StateAccountKey: In=3, Out=2, CheckSum=9b6f9fdaea5bb22c60772266c418d98f
StateActorCodeCIDs: In=2, Out=2, CheckSum=d52881195cc100121739e6c85c45dd9f
StateAllMinerFaults: In=3, Out=2, CheckSum=a17e05b21e1ecc8da867e2f76df6c46c
StateCall: In=3, Out=2, CheckSum=b33ab6c7df31d805c256c8ab6691b085
StateChangedActors: In=3, Out=2, CheckSum=cbc0cd36e495552a6672caab9f839468
Expand Down