Skip to content

Commit

Permalink
set mainnet upgrade height. remove faultage config, update repo versi… (
Browse files Browse the repository at this point in the history
#4571)

* set mainnet upgrade height. remove faultage config, update repo version to version 6

* fix repo upgrade
  • Loading branch information
hunjixin authored Oct 14, 2021
1 parent 3dfc54b commit 9668dfe
Show file tree
Hide file tree
Showing 22 changed files with 115 additions and 74 deletions.
4 changes: 0 additions & 4 deletions app/node/builder_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package node
import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/specs-actors/v6/actors/builtin/miner"
"github.com/filecoin-project/venus/pkg/clock"
"github.com/filecoin-project/venus/pkg/config"
"github.com/filecoin-project/venus/pkg/constants"
Expand Down Expand Up @@ -131,9 +130,6 @@ func SetNetParams(params *config.NetworkParamsConfig) {
policy.SetPreCommitChallengeDelay(params.PreCommitChallengeDelay)
}

if params.FaultMaxAge > 0 {
miner.FaultMaxAge = params.FaultMaxAge
}
constants.SetAddressNetwork(params.AddressNetwork)
}

Expand Down
7 changes: 3 additions & 4 deletions app/submodule/network/network_submodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"github.com/ipfs/go-graphsync"
graphsyncimpl "github.com/ipfs/go-graphsync/impl"
gsnet "github.com/ipfs/go-graphsync/network"
gsstoreutil "github.com/ipfs/go-graphsync/storeutil"
"github.com/ipfs/go-graphsync/storeutil"
exchange "github.com/ipfs/go-ipfs-exchange-interface"
cbor "github.com/ipfs/go-ipld-cbor"
"github.com/libp2p/go-libp2p"
Expand Down Expand Up @@ -206,9 +206,8 @@ func NewNetworkSubmodule(ctx context.Context, config networkConfig) (*NetworkSub

// set up graphsync
graphsyncNetwork := gsnet.NewFromLibp2pHost(peerHost)
loader := gsstoreutil.LoaderForBlockstore(config.Repo().Datastore())
storer := gsstoreutil.StorerForBlockstore(config.Repo().Datastore())
gsync := graphsyncimpl.New(ctx, graphsyncNetwork, loader, storer, graphsyncimpl.RejectAllRequestsByDefault())
lsys := storeutil.LinkSystemForBlockstore(config.Repo().Datastore())
gsync := graphsyncimpl.New(ctx, graphsyncNetwork, lsys, graphsyncimpl.RejectAllRequestsByDefault())

//dataTransger
//sc := storedcounter.New(repo.ChainDatastore(), datastore.NewKey("/datatransfer/api/counter"))
Expand Down
2 changes: 0 additions & 2 deletions fixtures/networks/calibration.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/specs-actors/v6/actors/builtin/miner"
"github.com/filecoin-project/venus/pkg/config"
"github.com/filecoin-project/venus/pkg/constants"
)
Expand Down Expand Up @@ -56,7 +55,6 @@ func Calibration() *NetworkConf {
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 1},
AddressNetwork: address.Testnet,
PreCommitChallengeDelay: abi.ChainEpoch(150),
FaultMaxAge: miner.WPoStProvingPeriod * 42,
},
}
}
2 changes: 0 additions & 2 deletions fixtures/networks/forcenet.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/specs-actors/v6/actors/builtin/miner"
"github.com/filecoin-project/venus/pkg/config"
"github.com/filecoin-project/venus/pkg/constants"
"math"
Expand Down Expand Up @@ -57,7 +56,6 @@ func ForceNet() *NetworkConf {
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: config.DrandMainnet},
AddressNetwork: address.Testnet,
PreCommitChallengeDelay: abi.ChainEpoch(10),
FaultMaxAge: miner.WPoStProvingPeriod * 42,
},
}
}
4 changes: 1 addition & 3 deletions fixtures/networks/integrationtestnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
"math"

"github.com/filecoin-project/venus/pkg/config"
)

Expand Down Expand Up @@ -38,7 +36,7 @@ func IntegrationNet() *NetworkConf {
UpgradeNorwegianHeight: 665280,
UpgradeTurboHeight: 712320,
UpgradeHyperdriveHeight: 892800,
UpgradeChocolateHeight: math.MaxInt32,
UpgradeChocolateHeight: 1231620,

BreezeGasTampingDuration: 120,
UpgradeClausHeight: 343200,
Expand Down
8 changes: 2 additions & 6 deletions fixtures/networks/interopnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/specs-actors/v6/actors/builtin/miner"
"github.com/filecoin-project/venus/pkg/constants"
"math"

"github.com/filecoin-project/venus/pkg/config"
"github.com/filecoin-project/venus/pkg/constants"
)

func InteropNet() *NetworkConf {
Expand Down Expand Up @@ -50,15 +47,14 @@ func InteropNet() *NetworkConf {
UpgradeNorwegianHeight: -14,
UpgradeTurboHeight: -15,
UpgradeHyperdriveHeight: -16,
UpgradeChocolateHeight: math.MaxInt32,
UpgradeChocolateHeight: -17,

BreezeGasTampingDuration: 0,
UpgradeClausHeight: -11,
},
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 1},
AddressNetwork: address.Testnet,
PreCommitChallengeDelay: abi.ChainEpoch(10),
FaultMaxAge: miner.WPoStProvingPeriod * 42,
},
}
}
6 changes: 2 additions & 4 deletions fixtures/networks/mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
"github.com/filecoin-project/venus/pkg/constants"
"math"

"github.com/filecoin-project/venus/pkg/config"
"github.com/filecoin-project/venus/pkg/constants"
)

func Mainnet() *NetworkConf {
Expand Down Expand Up @@ -59,7 +57,7 @@ func Mainnet() *NetworkConf {
UpgradeNorwegianHeight: 665280, // 2021-04-12T22:00:00Z
UpgradeTurboHeight: 712320, // 2021-04-29T06:00:00Z
UpgradeHyperdriveHeight: 892800, // 2021-06-30T22:00:00Z
UpgradeChocolateHeight: math.MaxInt32,
UpgradeChocolateHeight: 1231620,

BreezeGasTampingDuration: 120,
UpgradeClausHeight: 343200, // 2020-12-22T02:00:00Z
Expand Down
2 changes: 0 additions & 2 deletions fixtures/networks/net_2k.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/specs-actors/v6/actors/builtin/miner"
"github.com/filecoin-project/venus/pkg/config"
"github.com/filecoin-project/venus/pkg/constants"
)
Expand Down Expand Up @@ -51,7 +50,6 @@ func Net2k() *NetworkConf {
DrandSchedule: map[abi.ChainEpoch]config.DrandEnum{0: 1},
AddressNetwork: address.Testnet,
PreCommitChallengeDelay: abi.ChainEpoch(10),
FaultMaxAge: miner.WPoStProvingPeriod * 42,
},
}
}
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ require (
github.com/filecoin-project/go-cbor-util v0.0.0-20201016124514-d0bbec7bfcc4
github.com/filecoin-project/go-commp-utils v0.1.0
github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03
github.com/filecoin-project/go-data-transfer v1.5.0
github.com/filecoin-project/go-data-transfer v1.10.1
github.com/filecoin-project/go-fil-commcid v0.0.0-20201016201715-d41df56b4f6a
github.com/filecoin-project/go-jsonrpc v0.1.4-0.20210217175800-45ea43ac2bec
github.com/filecoin-project/go-leb128 v0.0.0-20190212224330-8d79a5489543
Expand All @@ -40,7 +40,7 @@ require (
github.com/filecoin-project/specs-actors/v3 v3.1.1
github.com/filecoin-project/specs-actors/v4 v4.0.1
github.com/filecoin-project/specs-actors/v5 v5.0.4
github.com/filecoin-project/specs-actors/v6 v6.0.0-20211001193936-c3afe7fa3c5c
github.com/filecoin-project/specs-actors/v6 v6.0.0
github.com/filecoin-project/specs-storage v0.1.1-0.20201105051918-5188d9774506
github.com/filecoin-project/test-vectors/schema v0.0.5
github.com/filecoin-project/venus-auth v1.3.1-0.20210809053831-012d55d5f578
Expand All @@ -63,11 +63,11 @@ require (
github.com/ipfs/go-bitswap v0.3.2
github.com/ipfs/go-block-format v0.0.3
github.com/ipfs/go-blockservice v0.1.4
github.com/ipfs/go-cid v0.0.7
github.com/ipfs/go-cid v0.1.0
github.com/ipfs/go-datastore v0.4.5
github.com/ipfs/go-ds-badger2 v0.1.1-0.20200708190120-187fc06f714e
github.com/ipfs/go-fs-lock v0.0.6
github.com/ipfs/go-graphsync v0.6.1
github.com/ipfs/go-graphsync v0.9.1
github.com/ipfs/go-ipfs-blockstore v1.0.3
github.com/ipfs/go-ipfs-chunker v0.0.5
github.com/ipfs/go-ipfs-cmdkit v0.0.1
Expand All @@ -85,7 +85,7 @@ require (
github.com/ipfs/go-path v0.0.7
github.com/ipfs/go-unixfs v0.2.4
github.com/ipfs/iptb v1.4.0
github.com/ipld/go-car v0.1.1-0.20201119040415-11b6074b6d4d
github.com/ipld/go-car v0.3.1-0.20210601190600-f512dac51e8e
github.com/jbenet/goprocess v0.1.4
github.com/jstemmer/go-junit-report v0.9.1
github.com/libp2p/go-eventbus v0.2.1
Expand All @@ -104,7 +104,7 @@ require (
github.com/morikuni/aec v1.0.0 // indirect
github.com/multiformats/go-multiaddr v0.3.3
github.com/multiformats/go-multiaddr-dns v0.3.1
github.com/multiformats/go-multihash v0.0.14
github.com/multiformats/go-multihash v0.0.15
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.1 // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible
Expand All @@ -128,7 +128,7 @@ require (
github.com/xorcare/golden v0.6.1-0.20191112154924-b87f686d7542 // indirect
go.opencensus.io v0.23.0
go.uber.org/zap v1.16.0
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2
golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6
Expand Down
Loading

0 comments on commit 9668dfe

Please sign in to comment.