Skip to content

Commit 702394e

Browse files
authored
build: build v1.6.0-rc2 (#4966)
* 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
1 parent 34a2fcd commit 702394e

68 files changed

Lines changed: 1060 additions & 337 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.DS_Store

-10 KB
Binary file not shown.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ test:
9898
go build -o gengen ./tools/gengen
9999
./gengen --keypath ./fixtures/live --out-car ./fixtures/live/genesis.car --out-json ./fixtures/live/gen.json --config ./fixtures/setup.json
100100
./gengen --keypath ./fixtures/test --out-car ./fixtures/test/genesis.car --out-json ./fixtures/test/gen.json --config ./fixtures/setup.json
101-
go test -v ./... -integration=true -unit=false
101+
go test -v ./... -integration=true -unit=false
102102

103103
lint: $(BUILD_DEPS)
104104
staticcheck ./...

app/node/builder.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
"github.com/filecoin-project/venus/pkg/repo"
3232
"github.com/filecoin-project/venus/pkg/util/ffiwrapper"
3333
"github.com/filecoin-project/venus/pkg/util/ffiwrapper/impl"
34-
builtin_actors "github.com/filecoin-project/venus/venus-shared/builtin-actors"
3534
"github.com/filecoin-project/venus/venus-shared/types"
3635
"github.com/ipfs-force-community/metrics/ratelimit"
3736
)
@@ -102,10 +101,6 @@ func (b *Builder) build(ctx context.Context) (*Node, error) {
102101
chainClock: b.chainClock,
103102
}
104103

105-
if err := builtin_actors.SetNetworkBundle(b.repo.Config().NetworkParams.NetworkType); err != nil {
106-
return nil, err
107-
}
108-
109104
//modules
110105
nd.circulatiingSupplyCalculator = chain2.NewCirculatingSupplyCalculator(b.repo.Datastore(), b.genBlk.ParentStateRoot, b.repo.Config().NetworkParams.ForkUpgradeParam)
111106

app/submodule/blockstore/blockstore_api.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77

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

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

8788
return stats, nil
8889
}
90+
91+
func (blockstoreAPI *blockstoreAPI) ChainPutObj(ctx context.Context, blk blocks.Block) error {
92+
return blockstoreAPI.blockstore.Blockstore.Put(ctx, blk)
93+
}
94+
95+
func (blockstoreAPI *blockstoreAPI) PutMany(ctx context.Context, blocks []blocks.Block) error {
96+
return blockstoreAPI.blockstore.Blockstore.PutMany(ctx, blocks)
97+
}

cmd/daemon.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import (
66

77
"github.com/filecoin-project/venus/fixtures/assets"
88
"github.com/filecoin-project/venus/fixtures/networks"
9+
builtinactors "github.com/filecoin-project/venus/venus-shared/builtin-actors"
10+
"github.com/filecoin-project/venus/venus-shared/utils"
911

1012
"github.com/filecoin-project/venus/pkg/constants"
1113
"github.com/filecoin-project/venus/pkg/util/ulimit"
@@ -24,7 +26,6 @@ import (
2426
"github.com/filecoin-project/venus/pkg/journal"
2527
"github.com/filecoin-project/venus/pkg/migration"
2628
"github.com/filecoin-project/venus/pkg/repo"
27-
builtin_actors "github.com/filecoin-project/venus/venus-shared/builtin-actors"
2829
)
2930

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

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

179176
config := rep.Config()
180177

178+
if err := builtinactors.SetNetworkBundle(config.NetworkParams.NetworkType); err != nil {
179+
return err
180+
}
181+
utils.ReloadMethodsMap()
182+
181183
// second highest precedence is env vars.
182184
if envAPI := os.Getenv("VENUS_API"); envAPI != "" {
183185
config.API.APIAddress = envAPI

cmd/message.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import (
1717
cbg "github.com/whyrusleeping/cbor-gen"
1818

1919
"github.com/filecoin-project/venus/app/node"
20-
"github.com/filecoin-project/venus/pkg/chain"
2120
"github.com/filecoin-project/venus/pkg/vm"
2221
"github.com/filecoin-project/venus/venus-shared/actors/builtin"
2322
"github.com/filecoin-project/venus/venus-shared/types"
23+
"github.com/filecoin-project/venus/venus-shared/utils"
2424
)
2525

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

124+
if err := utils.LoadBuiltinActors(req.Context, env.(*node.Env).ChainAPI); err != nil {
125+
return err
126+
}
127+
124128
var params []byte
125129
rawPJ := req.Options["params-json"]
126130
if rawPJ != nil {
@@ -191,7 +195,7 @@ func decodeTypedParams(ctx context.Context, fapi *node.Env, to address.Address,
191195
return nil, err
192196
}
193197

194-
methodMeta, found := chain.MethodsMap[act.Code][method]
198+
methodMeta, found := utils.MethodsMap[act.Code][method]
195199
if !found {
196200
return nil, fmt.Errorf("method %d not found on actor %s", method, act.Code)
197201
}

cmd/multisig.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ import (
1919
"github.com/filecoin-project/go-state-types/big"
2020
"github.com/filecoin-project/venus/app/node"
2121
sbchain "github.com/filecoin-project/venus/app/submodule/chain"
22-
"github.com/filecoin-project/venus/pkg/chain"
2322
"github.com/filecoin-project/venus/pkg/constants"
2423
"github.com/filecoin-project/venus/venus-shared/actors"
2524
"github.com/filecoin-project/venus/venus-shared/actors/adt"
2625
"github.com/filecoin-project/venus/venus-shared/actors/builtin"
2726
"github.com/filecoin-project/venus/venus-shared/actors/builtin/multisig"
2827
"github.com/filecoin-project/venus/venus-shared/types"
28+
"github.com/filecoin-project/venus/venus-shared/utils"
2929
"github.com/ipfs/go-cid"
3030
cmds "github.com/ipfs/go-ipfs-cmds"
3131
cbor "github.com/ipfs/go-ipld-cbor"
@@ -164,6 +164,11 @@ var msigInspectCmd = &cmds.Command{
164164
if err != nil {
165165
return err
166166
}
167+
168+
if err := utils.LoadBuiltinActors(ctx, env.(*node.Env).ChainAPI); err != nil {
169+
return err
170+
}
171+
167172
head, err := env.(*node.Env).ChainAPI.ChainHead(req.Context)
168173
if err != nil {
169174
return err
@@ -271,7 +276,7 @@ var msigInspectCmd = &cmds.Command{
271276
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)
272277
}
273278
} else {
274-
method := chain.MethodsMap[targAct.Code][tx.Method]
279+
method := utils.MethodsMap[targAct.Code][tx.Method]
275280

276281
if decParams && tx.Method != 0 {
277282
ptyp := reflect.New(method.Params.Elem()).Interface().(cbg.CBORUnmarshaler)
14.5 KB
Binary file not shown.

fixtures/networks/butterfly.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,25 @@ func ButterflySnapNet() *NetworkConf {
1212
return &NetworkConf{
1313
Bootstrap: config.BootstrapConfig{
1414
Addresses: []string{
15-
"/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWFHDtFx7CVTy4xoCDutVo1cScvSnQjDeaM8UzwVS1qwkh",
16-
"/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWKt8cwpkiumkT8x32c3YFxsPRwhV5J8hCYPn9mhUmcAXt",
15+
"/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWSUZhAY3eyoPUboJ1ZWe4dNPFWTr1EPoDjbTDSAN15uhY",
16+
"/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWDfvNrSRVGWAGbn3sm9C8z98W2x25qCZjaXGHXmGiH24e",
1717
},
1818
MinPeerThreshold: 0,
1919
Period: "30s",
2020
},
2121
Network: config.NetworkParamsConfig{
22-
DevNet: true,
22+
DevNet: true,
23+
NetworkType: types.NetworkButterfly,
24+
GenesisNetworkVersion: network.Version15,
2325
ReplaceProofTypes: []abi.RegisteredSealProof{
2426
abi.RegisteredSealProof_StackedDrg512MiBV1,
2527
abi.RegisteredSealProof_StackedDrg32GiBV1,
2628
abi.RegisteredSealProof_StackedDrg64GiBV1,
2729
},
28-
NetworkType: types.NetworkButterfly,
29-
GenesisNetworkVersion: network.Version15,
30-
BlockDelay: 30,
31-
ConsensusMinerMinPower: 2 << 30,
30+
BlockDelay: 30,
31+
ConsensusMinerMinPower: 2 << 30,
32+
MinVerifiedDealSize: 1 << 20,
33+
PreCommitChallengeDelay: abi.ChainEpoch(150),
3234
ForkUpgradeParam: &config.ForkUpgradeConfig{
3335
UpgradeBreezeHeight: -1,
3436
UpgradeSmokeHeight: -2,

0 commit comments

Comments
 (0)