Skip to content

Commit

Permalink
build: build v1.6.0-rc2 (#4966)
Browse files Browse the repository at this point in the history
* Feat: migration: Implement function to migrate actors with only code changes

* fix: butterfly does not set the PreCommitChallengeDelay value

* fix: fmt error log

* chore: remove file .DS_Store

* fix: fix 2k net

* fix: reset buttefly

* ci: fix lint

* fix: fill MinVerifiedDealSize

* test: add test for migrate config

* chore: move MethodsMap to venus-shared

* chore: add util functions

* chore: upgrade go-state-types to v0.1.10

* chore: pull in thew bundles of actor version 8.0.0-rc.2

* chore: set mainnet upgrade epoch

* chore: update calibnet actors

* chore: refactor: rename var name for syncing mainnet v15 using FVM

* chore: update ffi

* fix: fvm: make exectraces match legacyVM some more

* misc: fvm liftoff

* cmd: load builtin actors

* ci: fix test

* fix: remove env var VENUS_DISABLE_SKYR

* chore: update actors to v8.0.0

* chore: update FFI to use FVM 1.0.0

* build: bump version to v1.6.0-rc2
  • Loading branch information
simlecode authored Jun 24, 2022
1 parent 34a2fcd commit 702394e
Show file tree
Hide file tree
Showing 68 changed files with 1,060 additions and 337 deletions.
Binary file removed .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ test:
go build -o gengen ./tools/gengen
./gengen --keypath ./fixtures/live --out-car ./fixtures/live/genesis.car --out-json ./fixtures/live/gen.json --config ./fixtures/setup.json
./gengen --keypath ./fixtures/test --out-car ./fixtures/test/genesis.car --out-json ./fixtures/test/gen.json --config ./fixtures/setup.json
go test -v ./... -integration=true -unit=false
go test -v ./... -integration=true -unit=false

lint: $(BUILD_DEPS)
staticcheck ./...
Expand Down
5 changes: 0 additions & 5 deletions app/node/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
"github.com/filecoin-project/venus/pkg/repo"
"github.com/filecoin-project/venus/pkg/util/ffiwrapper"
"github.com/filecoin-project/venus/pkg/util/ffiwrapper/impl"
builtin_actors "github.com/filecoin-project/venus/venus-shared/builtin-actors"
"github.com/filecoin-project/venus/venus-shared/types"
"github.com/ipfs-force-community/metrics/ratelimit"
)
Expand Down Expand Up @@ -102,10 +101,6 @@ func (b *Builder) build(ctx context.Context) (*Node, error) {
chainClock: b.chainClock,
}

if err := builtin_actors.SetNetworkBundle(b.repo.Config().NetworkParams.NetworkType); err != nil {
return nil, err
}

//modules
nd.circulatiingSupplyCalculator = chain2.NewCirculatingSupplyCalculator(b.repo.Datastore(), b.genBlk.ParentStateRoot, b.repo.Config().NetworkParams.ForkUpgradeParam)

Expand Down
9 changes: 9 additions & 0 deletions app/submodule/blockstore/blockstore_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/filecoin-project/venus/venus-shared/types"

blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-blockservice"
"github.com/ipfs/go-cid"
offline "github.com/ipfs/go-ipfs-exchange-offline"
Expand Down Expand Up @@ -86,3 +87,11 @@ func (blockstoreAPI *blockstoreAPI) ChainStatObj(ctx context.Context, obj cid.Ci

return stats, nil
}

func (blockstoreAPI *blockstoreAPI) ChainPutObj(ctx context.Context, blk blocks.Block) error {
return blockstoreAPI.blockstore.Blockstore.Put(ctx, blk)
}

func (blockstoreAPI *blockstoreAPI) PutMany(ctx context.Context, blocks []blocks.Block) error {
return blockstoreAPI.blockstore.Blockstore.PutMany(ctx, blocks)
}
12 changes: 7 additions & 5 deletions cmd/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (

"github.com/filecoin-project/venus/fixtures/assets"
"github.com/filecoin-project/venus/fixtures/networks"
builtinactors "github.com/filecoin-project/venus/venus-shared/builtin-actors"
"github.com/filecoin-project/venus/venus-shared/utils"

"github.com/filecoin-project/venus/pkg/constants"
"github.com/filecoin-project/venus/pkg/util/ulimit"
Expand All @@ -24,7 +26,6 @@ import (
"github.com/filecoin-project/venus/pkg/journal"
"github.com/filecoin-project/venus/pkg/migration"
"github.com/filecoin-project/venus/pkg/repo"
builtin_actors "github.com/filecoin-project/venus/venus-shared/builtin-actors"
)

var log = logging.Logger("daemon")
Expand Down Expand Up @@ -140,10 +141,6 @@ func initRun(req *cmds.Request) error {
}

node.SetNetParams(cfg.NetworkParams)
// load builtin actors
if err := builtin_actors.SetNetworkBundle(cfg.NetworkParams.NetworkType); err != nil {
return err
}
genesisFunc = genesis.MakeGenesis(req.Context, rep, mkGen, preTp.(string), cfg.NetworkParams.ForkUpgradeParam)
} else {
genesisFileSource, _ := req.Options[GenesisFile].(string)
Expand Down Expand Up @@ -178,6 +175,11 @@ func daemonRun(req *cmds.Request, re cmds.ResponseEmitter) error {

config := rep.Config()

if err := builtinactors.SetNetworkBundle(config.NetworkParams.NetworkType); err != nil {
return err
}
utils.ReloadMethodsMap()

// second highest precedence is env vars.
if envAPI := os.Getenv("VENUS_API"); envAPI != "" {
config.API.APIAddress = envAPI
Expand Down
8 changes: 6 additions & 2 deletions cmd/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import (
cbg "github.com/whyrusleeping/cbor-gen"

"github.com/filecoin-project/venus/app/node"
"github.com/filecoin-project/venus/pkg/chain"
"github.com/filecoin-project/venus/pkg/vm"
"github.com/filecoin-project/venus/venus-shared/actors/builtin"
"github.com/filecoin-project/venus/venus-shared/types"
"github.com/filecoin-project/venus/venus-shared/utils"
)

var feecapOption = cmds.StringOption("gas-feecap", "Price (FIL e.g. 0.00013) to pay for each GasUnit consumed mining this message")
Expand Down Expand Up @@ -121,6 +121,10 @@ var msgSendCmd = &cmds.Command{
return err
}

if err := utils.LoadBuiltinActors(req.Context, env.(*node.Env).ChainAPI); err != nil {
return err
}

var params []byte
rawPJ := req.Options["params-json"]
if rawPJ != nil {
Expand Down Expand Up @@ -191,7 +195,7 @@ func decodeTypedParams(ctx context.Context, fapi *node.Env, to address.Address,
return nil, err
}

methodMeta, found := chain.MethodsMap[act.Code][method]
methodMeta, found := utils.MethodsMap[act.Code][method]
if !found {
return nil, fmt.Errorf("method %d not found on actor %s", method, act.Code)
}
Expand Down
9 changes: 7 additions & 2 deletions cmd/multisig.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import (
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/venus/app/node"
sbchain "github.com/filecoin-project/venus/app/submodule/chain"
"github.com/filecoin-project/venus/pkg/chain"
"github.com/filecoin-project/venus/pkg/constants"
"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"
"github.com/filecoin-project/venus/venus-shared/actors/builtin/multisig"
"github.com/filecoin-project/venus/venus-shared/types"
"github.com/filecoin-project/venus/venus-shared/utils"
"github.com/ipfs/go-cid"
cmds "github.com/ipfs/go-ipfs-cmds"
cbor "github.com/ipfs/go-ipld-cbor"
Expand Down Expand Up @@ -164,6 +164,11 @@ var msigInspectCmd = &cmds.Command{
if err != nil {
return err
}

if err := utils.LoadBuiltinActors(ctx, env.(*node.Env).ChainAPI); err != nil {
return err
}

head, err := env.(*node.Env).ChainAPI.ChainHead(req.Context)
if err != nil {
return err
Expand Down Expand Up @@ -271,7 +276,7 @@ var msigInspectCmd = &cmds.Command{
fmt.Fprintf(w, "%d\t%s\t%d\t%s\t%s\t%s(%d)\t%s\n", txid, "pending", len(tx.Approved), target, types.FIL(tx.Value), "new account, unknown method", tx.Method, paramStr)
}
} else {
method := chain.MethodsMap[targAct.Code][tx.Method]
method := utils.MethodsMap[targAct.Code][tx.Method]

if decParams && tx.Method != 0 {
ptyp := reflect.New(method.Params.Elem()).Interface().(cbg.CBORUnmarshaler)
Expand Down
2 changes: 1 addition & 1 deletion extern/filecoin-ffi
Submodule filecoin-ffi updated 3 files
+1 −0 fvm.go
+16 −16 rust/Cargo.lock
+1 −1 rust/Cargo.toml
Binary file modified fixtures/assets/genesis-car/butterflynet.car
Binary file not shown.
16 changes: 9 additions & 7 deletions fixtures/networks/butterfly.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,25 @@ func ButterflySnapNet() *NetworkConf {
return &NetworkConf{
Bootstrap: config.BootstrapConfig{
Addresses: []string{
"/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWFHDtFx7CVTy4xoCDutVo1cScvSnQjDeaM8UzwVS1qwkh",
"/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWKt8cwpkiumkT8x32c3YFxsPRwhV5J8hCYPn9mhUmcAXt",
"/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWSUZhAY3eyoPUboJ1ZWe4dNPFWTr1EPoDjbTDSAN15uhY",
"/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWDfvNrSRVGWAGbn3sm9C8z98W2x25qCZjaXGHXmGiH24e",
},
MinPeerThreshold: 0,
Period: "30s",
},
Network: config.NetworkParamsConfig{
DevNet: true,
DevNet: true,
NetworkType: types.NetworkButterfly,
GenesisNetworkVersion: network.Version15,
ReplaceProofTypes: []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg512MiBV1,
abi.RegisteredSealProof_StackedDrg32GiBV1,
abi.RegisteredSealProof_StackedDrg64GiBV1,
},
NetworkType: types.NetworkButterfly,
GenesisNetworkVersion: network.Version15,
BlockDelay: 30,
ConsensusMinerMinPower: 2 << 30,
BlockDelay: 30,
ConsensusMinerMinPower: 2 << 30,
MinVerifiedDealSize: 1 << 20,
PreCommitChallengeDelay: abi.ChainEpoch(150),
ForkUpgradeParam: &config.ForkUpgradeConfig{
UpgradeBreezeHeight: -1,
UpgradeSmokeHeight: -2,
Expand Down
17 changes: 9 additions & 8 deletions fixtures/networks/calibration.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@ func Calibration() *NetworkConf {
Period: "30s",
},
Network: config.NetworkParamsConfig{
DevNet: true,
NetworkType: types.NetworkCalibnet,
GenesisNetworkVersion: network.Version0,
BlockDelay: 30,
ConsensusMinerMinPower: 32 << 30,
DevNet: true,
NetworkType: types.NetworkCalibnet,
GenesisNetworkVersion: network.Version0,
ReplaceProofTypes: []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg32GiBV1,
abi.RegisteredSealProof_StackedDrg64GiBV1,
},
BlockDelay: 30,
ConsensusMinerMinPower: 32 << 30,
MinVerifiedDealSize: 1 << 20,
PreCommitChallengeDelay: abi.ChainEpoch(150),
ForkUpgradeParam: &config.ForkUpgradeConfig{
UpgradeBreezeHeight: -1,
UpgradeSmokeHeight: -2,
Expand All @@ -58,9 +60,8 @@ func Calibration() *NetworkConf {
UpgradeChocolateHeight: 312746,
UpgradeOhSnapHeight: 682006, // 2022-02-10T19:23:00Z
},
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 1},
AddressNetwork: address.Testnet,
PreCommitChallengeDelay: abi.ChainEpoch(150),
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 1},
AddressNetwork: address.Testnet,
},
}
}
17 changes: 9 additions & 8 deletions fixtures/networks/forcenet.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@ func ForceNet() *NetworkConf {
Period: "30s",
},
Network: config.NetworkParamsConfig{
DevNet: true,
DevNet: true,
NetworkType: types.NetworkForce,
GenesisNetworkVersion: network.Version16,
ReplaceProofTypes: []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg8MiBV1,
abi.RegisteredSealProof_StackedDrg512MiBV1,
abi.RegisteredSealProof_StackedDrg32GiBV1,
},
NetworkType: types.NetworkForce,
GenesisNetworkVersion: network.Version15,
BlockDelay: 30,
ConsensusMinerMinPower: 2048,
BlockDelay: 30,
ConsensusMinerMinPower: 2048,
MinVerifiedDealSize: 256,
PreCommitChallengeDelay: abi.ChainEpoch(10),
ForkUpgradeParam: &config.ForkUpgradeConfig{
UpgradeBreezeHeight: -1,
BreezeGasTampingDuration: 0,
Expand All @@ -53,9 +55,8 @@ func ForceNet() *NetworkConf {
UpgradeOhSnapHeight: -18,
UpgradeSkyrHeight: -19,
},
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: config.DrandMainnet},
AddressNetwork: address.Testnet,
PreCommitChallengeDelay: abi.ChainEpoch(10),
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: config.DrandMainnet},
AddressNetwork: address.Testnet,
},
}
}
19 changes: 12 additions & 7 deletions fixtures/networks/integrationtestnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ func IntegrationNet() *NetworkConf {
Period: "30s",
},
Network: config.NetworkParamsConfig{
BlockDelay: 30,
ConsensusMinerMinPower: 10 << 40,
NetworkType: types.Integrationnet,
GenesisNetworkVersion: network.Version0,
NetworkType: types.Integrationnet,
GenesisNetworkVersion: network.Version0,
ReplaceProofTypes: []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg32GiBV1,
abi.RegisteredSealProof_StackedDrg64GiBV1,
},
BlockDelay: 30,
ConsensusMinerMinPower: 10 << 40,
MinVerifiedDealSize: 1 << 20,
PreCommitChallengeDelay: abi.ChainEpoch(150),
ForkUpgradeParam: &config.ForkUpgradeConfig{
UpgradeBreezeHeight: 41280,
UpgradeSmokeHeight: 51000,
Expand All @@ -44,9 +50,8 @@ func IntegrationNet() *NetworkConf {
BreezeGasTampingDuration: 120,
UpgradeClausHeight: 343200,
},
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 5, 51000: 1},
AddressNetwork: address.Testnet,
PreCommitChallengeDelay: abi.ChainEpoch(150),
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 5, 51000: 1},
AddressNetwork: address.Testnet,
},
}
}
18 changes: 9 additions & 9 deletions fixtures/networks/interopnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,18 @@ func InteropNet() *NetworkConf {
Period: "30s",
},
Network: config.NetworkParamsConfig{
DevNet: true,
DevNet: true,
NetworkType: types.NetworkInterop,
GenesisNetworkVersion: network.Version15,
ReplaceProofTypes: []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg2KiBV1,
abi.RegisteredSealProof_StackedDrg8MiBV1,
abi.RegisteredSealProof_StackedDrg512MiBV1,
},
NetworkType: types.NetworkInterop,
GenesisNetworkVersion: network.Version15,
BlockDelay: 30,
ConsensusMinerMinPower: 2048,
MinVerifiedDealSize: 256,
BlockDelay: 30,
ConsensusMinerMinPower: 2048,
MinVerifiedDealSize: 256,
PreCommitChallengeDelay: abi.ChainEpoch(10),
ForkUpgradeParam: &config.ForkUpgradeConfig{
UpgradeBreezeHeight: -1,
UpgradeSmokeHeight: -2,
Expand All @@ -53,9 +54,8 @@ func InteropNet() *NetworkConf {
BreezeGasTampingDuration: 0,
UpgradeClausHeight: -11,
},
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 1},
AddressNetwork: address.Testnet,
PreCommitChallengeDelay: abi.ChainEpoch(10),
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 1},
AddressNetwork: address.Testnet,
},
}
}
16 changes: 11 additions & 5 deletions fixtures/networks/mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ func Mainnet() *NetworkConf {
DevNet: false,
NetworkType: types.NetworkMainnet,
GenesisNetworkVersion: network.Version0,
BlockDelay: 30,
ReplaceProofTypes: []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg32GiBV1,
abi.RegisteredSealProof_StackedDrg64GiBV1,
},
BlockDelay: 30,
ConsensusMinerMinPower: 10 << 40,
MinVerifiedDealSize: 1 << 20,
PreCommitChallengeDelay: abi.ChainEpoch(150),
ForkUpgradeParam: &config.ForkUpgradeConfig{
UpgradeBreezeHeight: 41280,
UpgradeSmokeHeight: 51000,
Expand All @@ -59,14 +66,13 @@ func Mainnet() *NetworkConf {
UpgradeHyperdriveHeight: 892800, // 2021-06-30T22:00:00Z
UpgradeChocolateHeight: 1231620,
UpgradeOhSnapHeight: 1594680, // 2022-03-01T15:00:00Z
UpgradeSkyrHeight: 99999999999999,
UpgradeSkyrHeight: 1960320, // 2022-07-06T14:00:00Z

BreezeGasTampingDuration: 120,
UpgradeClausHeight: 343200, // 2020-12-22T02:00:00Z
},
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 5, 51000: 1},
AddressNetwork: address.Mainnet,
PreCommitChallengeDelay: abi.ChainEpoch(150),
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 5, 51000: 1},
AddressNetwork: address.Mainnet,
},
}
}
Loading

0 comments on commit 702394e

Please sign in to comment.