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

feat: integrate nv17 #5405

Merged
merged 36 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1682eca
feat: add api `StateComputeDataCID` and refactor api `StateSectorPreC…
simlecode Sep 23, 2022
9e9f428
feat: fvm增加debug功能 / FVM Debug Dual Execution (#5319)
simlecode Sep 23, 2022
11e6578
chore: Check for existing signers in add-propose (#5320)
simlecode Sep 23, 2022
e68b815
chore: change 1475 bootstrap peer (#5321)
simlecode Sep 23, 2022
b070be2
fix: gas: estimate gas with a zero base-fee (#5322)
simlecode Sep 26, 2022
7af780d
feat: FVM: always enable tracing for user-triggered executions (#5323)
simlecode Sep 26, 2022
8cf958f
chore: upgrade libp2p to v0.22 (#5324)
simlecode Sep 26, 2022
56b5ef9
feat: add chain api `StateMinerAllocated` (#5325)
simlecode Sep 26, 2022
7866473
feat: network: add nv17 and integrate the corresponding go state type…
simlecode Sep 30, 2022
d0aead6
feat: print beneficiary info in state miner-info (#5348)
simlecode Oct 8, 2022
8970d8b
feat: move propagationDelaySecs to config (#5358)
simlecode Oct 8, 2022
ae91cbd
feat: refactor: remove NewestNetworkVersion (#5360)
simlecode Oct 9, 2022
f1b8f96
chore: actors: Allow builtin-actors to return a map of methods
simlecode Oct 10, 2022
f9be855
chore: ci: update go version (#5363)
simlecode Oct 12, 2022
1d04a57
feat: actors: Integrate datacap actor (#5362)
simlecode Oct 12, 2022
1129b85
chore: use go 1.18 in go.mod (#5365)
simlecode Oct 12, 2022
48e41d1
feat: actors: Integrate builtin-actors changes for FIP-0045
simlecode Oct 10, 2022
95a2910
chore: fix lint
simlecode Oct 12, 2022
c7dde07
fix: state: add datacap actor to actors registry
simlecode Oct 14, 2022
e0f21b4
chore: fix test
simlecode Oct 14, 2022
628e0d4
feat: add API methods to get allocations and claims
simlecode Oct 14, 2022
0d20550
chore: update clib and butterfly asset (#5376)
simlecode Oct 17, 2022
b6eb13d
feat: Returns nil if pendallocation is not found (#5378)
simlecode Oct 17, 2022
1173fe3
chore: update deps (#5379)
simlecode Oct 17, 2022
bb17e5d
chore: bump version to v1.8.0-rc1
simlecode Oct 17, 2022
3aa42ba
chore: update venus-auth version
simlecode Oct 17, 2022
7698951
fix: add name for MethodMeta (#5387)
simlecode Oct 17, 2022
1443447
chore: update to go-state-types v0.9.1
simlecode Oct 18, 2022
28a4f60
fix: Update DevNet to true in 2k network configuration
simlecode Oct 18, 2022
b75163f
chore: bump version to 1.8.0-rc2 (#5390)
simlecode Oct 18, 2022
590b3bb
chore: move apibsstore.go to pkg/util/blockstoreutil (#5391)
simlecode Oct 19, 2022
67a833c
chore: bump version to v1.8.0-rc3 (#5393)
simlecode Oct 19, 2022
638b80d
chore: Integrate builtin-actors v9.0.1 (#5392)
simlecode Oct 19, 2022
db63d95
chore: migration: Use autobatch bs (#5396)
simlecode Oct 20, 2022
dbdb6ae
feat: Use MethodMeta from go-state-types (#5397)
simlecode Oct 20, 2022
36b6017
feat: add a second premigration for nv17 (#5400)
simlecode Oct 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/baisc_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18

- name: install deps
run: |
Expand All @@ -34,7 +34,7 @@ jobs:

- name: Lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.44.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.0
golangci-lint run --timeout 10m

- name: Compatible all
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/common_build_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18

- name: install deps
if: ${{ !inputs.has_ffi }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/common_go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18

- name: vars
id: vars
Expand All @@ -47,7 +47,7 @@ jobs:

- name: Lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.44.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.0
golangci-lint run --timeout 10m

- name: Detect changes
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18

- name: install deps
run: |
Expand Down
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,9 @@ run:
skip-dirs:
- pkg/constants$
- pkg/util/test$
- venus-shared/actors/adt$
- venus-shared/actors/aerrors$
- venus-shared/actors/builtin$
- venus-shared/actors/policy$
skip-files:
- ".*_gen\\.go$" # skip auto generated go files
2 changes: 1 addition & 1 deletion app/node/builder_getter.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (b builder) GenesisRoot() cid.Cid {
return b.genBlk.ParentStateRoot
}

//todo remove block time
// todo remove block time
// BlockTime get chain block time
func (b builder) BlockTime() time.Duration {
return b.blockTime
Expand Down
2 changes: 1 addition & 1 deletion app/node/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package node

import (
libp2p "github.com/libp2p/go-libp2p"
ci "github.com/libp2p/go-libp2p-core/crypto"
ci "github.com/libp2p/go-libp2p/core/crypto"
errors "github.com/pkg/errors"

"github.com/filecoin-project/venus/pkg/repo"
Expand Down
2 changes: 1 addition & 1 deletion app/node/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/filecoin-project/venus/pkg/repo/fskeystore"

cbor "github.com/ipfs/go-ipld-cbor"
acrypto "github.com/libp2p/go-libp2p-core/crypto"
acrypto "github.com/libp2p/go-libp2p/core/crypto"
"github.com/pkg/errors"

"github.com/filecoin-project/venus/pkg/crypto"
Expand Down
4 changes: 2 additions & 2 deletions app/node/rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"context"
"encoding/json"
"io/ioutil"
"io"
"net/http"
"net/http/httptest"
"testing"
Expand Down Expand Up @@ -71,7 +71,7 @@ func TestJsonrpc(t *testing.T) {
httpRes, err := http.Post("http://"+testServ.Listener.Addr().String()+"/rpc/v1", "", bytes.NewReader(reqBytes))
require.NoError(t, err)
assert.Equal(t, httpRes.Status, "200 OK")
result, err := ioutil.ReadAll(httpRes.Body)
result, err := io.ReadAll(httpRes.Body)
require.NoError(t, err)
res := struct {
Result string `json:"result"`
Expand Down
4 changes: 2 additions & 2 deletions app/node/test/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
ds "github.com/ipfs/go-datastore"
blockstore "github.com/ipfs/go-ipfs-blockstore"
cbor "github.com/ipfs/go-ipld-cbor"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/stretchr/testify/require"

"github.com/filecoin-project/go-address"
Expand Down
2 changes: 1 addition & 1 deletion app/submodule/chain/account_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type accountAPI struct {
chain *ChainSubmodule
}

//NewAccountAPI create a new account api
// NewAccountAPI create a new account api
func NewAccountAPI(chain *ChainSubmodule) v1api.IAccount {
return &accountAPI{chain: chain}
}
Expand Down
2 changes: 1 addition & 1 deletion app/submodule/chain/actor_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type actorAPI struct {
chain *ChainSubmodule
}

//NewActorAPI new actor api
// NewActorAPI new actor api
func NewActorAPI(chain *ChainSubmodule) v1api.IActor {
return &actorAPI{chain: chain}
}
Expand Down
73 changes: 0 additions & 73 deletions app/submodule/chain/apibstore.go

This file was deleted.

4 changes: 2 additions & 2 deletions app/submodule/chain/chain_submodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ func (chain *ChainSubmodule) Start(ctx context.Context) error {
return chain.Fork.Start(ctx)
}

//Stop stop the chain head event
// Stop stop the chain head event
func (chain *ChainSubmodule) Stop(ctx context.Context) {
chain.ChainReader.Stop()
}

//API chain module api implement
// API chain module api implement
func (chain *ChainSubmodule) API() v1api.IChain {
return &chainAPI{
IAccount: NewAccountAPI(chain),
Expand Down
35 changes: 32 additions & 3 deletions app/submodule/chain/chaininfo_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
acrypto "github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/go-state-types/network"
miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
Expand Down Expand Up @@ -661,6 +662,7 @@ func (cia *chainInfoAPI) StateGetNetworkParams(ctx context.Context) (*types.Netw
UpgradeChocolateHeight: cfg.NetworkParams.ForkUpgradeParam.UpgradeChocolateHeight,
UpgradeOhSnapHeight: cfg.NetworkParams.ForkUpgradeParam.UpgradeOhSnapHeight,
UpgradeSkyrHeight: cfg.NetworkParams.ForkUpgradeParam.UpgradeSkyrHeight,
UpgradeSharkHeight: cfg.NetworkParams.ForkUpgradeParam.UpgradeSharkHeight,
},
}

Expand All @@ -669,7 +671,7 @@ func (cia *chainInfoAPI) StateGetNetworkParams(ctx context.Context) (*types.Netw

// 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)
actorVersion, err := actorstypes.VersionForNetwork(nv)
if err != nil {
return nil, fmt.Errorf("invalid network version")
}
Expand All @@ -683,7 +685,7 @@ func (cia *chainInfoAPI) StateActorCodeCIDs(ctx context.Context, nv network.Vers

cids["_manifest"] = manifestCid

var actorKeys = actors.GetBuiltinActorsKeys()
var actorKeys = actors.GetBuiltinActorsKeys(actorVersion)
for _, name := range actorKeys {
actorCID, ok := actors.GetActorCodeID(actorVersion, name)
if !ok {
Expand All @@ -707,7 +709,7 @@ func (cia *chainInfoAPI) ChainGetGenesis(ctx context.Context) (*types.TipSet, er

// StateActorManifestCID returns the CID of the builtin actors manifest for the given network version
func (cia *chainInfoAPI) StateActorManifestCID(ctx context.Context, nv network.Version) (cid.Cid, error) {
actorVersion, err := actors.VersionForNetwork(nv)
actorVersion, err := actorstypes.VersionForNetwork(nv)
if err != nil {
return cid.Undef, fmt.Errorf("invalid network version")
}
Expand All @@ -719,3 +721,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
}
Loading