Skip to content

Commit

Permalink
chore(f3): update go-f3 to 0.4.0 (#12547)
Browse files Browse the repository at this point in the history
---

Signed-off-by: Jakub Sztandera <[email protected]>
Co-authored-by: Steven Allen <[email protected]>
  • Loading branch information
Kubuxu and Stebalien authored Oct 3, 2024
1 parent 1f1afe5 commit 0e7292a
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 23 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Add an environment variable, `F3_INITIAL_POWERTABLE_CID` to allow specifying the initial power table used by F3 ([filecoin-project/lotus#12502](https://github.com/filecoin-project/lotus/pull/12502)). This may be used to help a lotus node re-sync the F3 chain when syncing from a snapshot after the F3 upgrade epoch. The precise CID to use here won't be known until the F3 is officially "live".
* Added `StateMinerInitialPledgeForSector` RPC method and deprecated existing `StateMinerInitialPledgeCollateral` method. Since ProveCommitSectors3 and ProveReplicaUpdates3, sector onboarding no longer includes an explicit notion of "deals", and precommit messages no longer contain deal information. This makes the existing `StateMinerInitialPledgeCollateral` unable to properly calculate pledge requirements with only the precommit. `StateMinerInitialPledgeForSector` is a new simplified calculator that simply takes duration, sector size, and verified size and estimates pledge based on current network conditions. Please note that the `StateMinerInitialPledgeCollateral` method will be removed entirely in the next non-patch release. ([filecoin-project/lotus#12384](https://github.com/filecoin-project/lotus/pull/12384)
* Implement [FIP-0081](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0081.md) and its migration for NV24. Initial pledge collateral will now be calculated using a 70% / 30% split between "simple" and "baseline" in the initial consensus pledge contribution to collateral calculation. The change in this calculation will begin at NV24 activation and ramp up from the current split of 100% / 0% to the eventual 70% / 30% over the course of a year so as to minimise impact on existing operations. ([filecoin-project/lotus#12526](https://github.com/filecoin-project/lotus/pull/12526)
* Update to F3 0.4.0 ([filecoin-project/lotus#12547](https://github.com/filecoin-project/lotus/pull/12547)). This includes additional performance enhancements and bug fixes.

## Improvements

Expand Down
6 changes: 5 additions & 1 deletion build/openrpc/full.json
Original file line number Diff line number Diff line change
Expand Up @@ -7505,7 +7505,8 @@
"Finality": 0,
"DelayMultiplier": 0,
"BaseDecisionBackoffTable": null,
"HeadLookback": 0
"HeadLookback": 0,
"Finalize": false
},
"CertificateExchange": {
"ClientRequestTimeout": 0,
Expand Down Expand Up @@ -7567,6 +7568,9 @@
"title": "number",
"type": "number"
},
"Finalize": {
"type": "boolean"
},
"HeadLookback": {
"title": "number",
"type": "number"
Expand Down
6 changes: 3 additions & 3 deletions chain/lf3/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import (
type Config struct {
InitialManifest *manifest.Manifest
DynamicManifestProvider peer.ID
F3ConsensusEnabled bool
}

func NewConfig(manifestProvider peer.ID, consensusEnabled bool, initialPowerTable cid.Cid) func(dtypes.NetworkName) *Config {
func NewConfig(manifestProvider peer.ID, initialPowerTable cid.Cid) func(dtypes.NetworkName) *Config {
return func(nn dtypes.NetworkName) *Config {
m := manifest.LocalDevnetManifest()
m.NetworkName = gpbft.NetworkName(nn)
m.EC.Period = time.Duration(buildconstants.BlockDelaySecs) * time.Second
m.CatchUpAlignment = time.Duration(buildconstants.BlockDelaySecs) * time.Second / 2
if buildconstants.F3BootstrapEpoch < 0 {
// if unset, set to a sane default so we don't get scary logs and pause.
m.BootstrapEpoch = 2 * int64(policy.ChainFinality)
Expand All @@ -35,14 +35,14 @@ func NewConfig(manifestProvider peer.ID, consensusEnabled bool, initialPowerTabl
m.EC.Finality = int64(policy.ChainFinality)
m.CommitteeLookback = 5
m.InitialPowerTable = initialPowerTable
m.EC.Finalize = buildconstants.F3Consensus

// TODO: We're forcing this to start paused for now. We need to remove this for the final
// mainnet launch.
m.Pause = true
return &Config{
InitialManifest: m,
DynamicManifestProvider: manifestProvider,
F3ConsensusEnabled: consensusEnabled,
}
}
}
6 changes: 0 additions & 6 deletions chain/lf3/ec.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ type ecWrapper struct {
ChainStore *store.ChainStore
Syncer *chain.Syncer
StateManager *stmgr.StateManager

// Checkpoint sets whether to checkpoint tipsets finalized by F3 in ChainStore.
Checkpoint bool
}

type f3TipSet struct {
Expand Down Expand Up @@ -212,9 +209,6 @@ func (ec *ecWrapper) getPowerTableLotusTSK(ctx context.Context, tsk types.TipSet
}

func (ec *ecWrapper) Finalize(ctx context.Context, key gpbft.TipSetKey) error {
if !ec.Checkpoint {
return nil // Nothing to do; checkpointing is not enabled.
}
tsk, err := toLotusTipSetKey(key)
if err != nil {
return err
Expand Down
7 changes: 5 additions & 2 deletions chain/lf3/f3.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package lf3
import (
"context"
"errors"
"path/filepath"
"time"

"github.com/ipfs/go-datastore"
Expand All @@ -26,6 +27,7 @@ import (
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/filecoin-project/lotus/node/modules/helpers"
"github.com/filecoin-project/lotus/node/repo"
)

type F3 struct {
Expand All @@ -48,6 +50,7 @@ type F3Params struct {
Datastore dtypes.MetadataDS
Wallet api.Wallet
Config *Config
LockedRepo repo.LockedRepo
}

var log = logging.Logger("f3")
Expand All @@ -58,12 +61,12 @@ func New(mctx helpers.MetricsCtx, lc fx.Lifecycle, params F3Params) (*F3, error)
ChainStore: params.ChainStore,
StateManager: params.StateManager,
Syncer: params.Syncer,
Checkpoint: params.Config.F3ConsensusEnabled,
}
verif := blssig.VerifierWithKeyOnG1()

f3FsPath := filepath.Join(params.LockedRepo.Path(), "f3")
module, err := f3.New(mctx, params.ManifestProvider, ds,
params.Host, params.PubSub, verif, ec)
params.Host, params.PubSub, verif, ec, f3FsPath)

if err != nil {
return nil, xerrors.Errorf("creating F3: %w", err)
Expand Down
24 changes: 22 additions & 2 deletions chain/lf3/manifest.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package lf3

import (
"fmt"

"github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/namespace"
pubsub "github.com/libp2p/go-libp2p-pubsub"
Expand All @@ -16,10 +18,28 @@ import (
// message topic will be filtered
var MaxDynamicManifestChangesAllowed = 1000

func NewManifestProvider(config *Config, ps *pubsub.PubSub, mds dtypes.MetadataDS) manifest.ManifestProvider {
func NewManifestProvider(config *Config, ps *pubsub.PubSub, mds dtypes.MetadataDS) (manifest.ManifestProvider, error) {
if config.DynamicManifestProvider == "" {
return manifest.NewStaticManifestProvider(config.InitialManifest)
}

primaryNetworkName := config.InitialManifest.NetworkName
filter := func(m *manifest.Manifest) error {
if m.EC.Finalize {
return fmt.Errorf("refusing dynamic manifest that finalizes tipsets")
}
if m.NetworkName == primaryNetworkName {
return fmt.Errorf(
"refusing dynamic manifest with network name %q that clashes with initial manifest",
primaryNetworkName,
)
}
return nil
}
ds := namespace.Wrap(mds, datastore.NewKey("/f3-dynamic-manifest"))
return manifest.NewDynamicManifestProvider(config.InitialManifest, ds, ps, config.DynamicManifestProvider)
return manifest.NewDynamicManifestProvider(ps, config.DynamicManifestProvider,
manifest.DynamicManifestProviderWithInitialManifest(config.InitialManifest),
manifest.DynamicManifestProviderWithDatastore(ds),
manifest.DynamicManifestProviderWithFilter(filter),
)
}
3 changes: 2 additions & 1 deletion documentation/en/api-v1-unstable-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -2554,7 +2554,8 @@ Response:
"Finality": 0,
"DelayMultiplier": 0,
"BaseDecisionBackoffTable": null,
"HeadLookback": 0
"HeadLookback": 0,
"Finalize": false
},
"CertificateExchange": {
"ClientRequestTimeout": 0,
Expand Down
8 changes: 7 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ require (
github.com/filecoin-project/go-cbor-util v0.0.1
github.com/filecoin-project/go-commp-utils/v2 v2.1.0
github.com/filecoin-project/go-crypto v0.1.0
github.com/filecoin-project/go-f3 v0.3.0
github.com/filecoin-project/go-f3 v0.4.0
github.com/filecoin-project/go-fil-commcid v0.2.0
github.com/filecoin-project/go-hamt-ipld/v3 v3.4.0
github.com/filecoin-project/go-jsonrpc v0.6.0
Expand Down Expand Up @@ -177,10 +177,13 @@ require (
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cilium/ebpf v0.9.1 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/cskr/pubsub v1.0.2 // indirect
github.com/daaku/go.zipexe v1.0.2 // indirect
Expand Down Expand Up @@ -267,6 +270,7 @@ require (
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
Expand Down Expand Up @@ -322,6 +326,7 @@ require (
github.com/zondax/ledger-go v0.14.3 // indirect
gitlab.com/yawning/secp256k1-voi v0.0.0-20230925100816-f2616030848b // indirect
gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect
go.dedis.ch/kyber/v4 v4.0.0-pre2.0.20240924132404-4de33740016e // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
go.uber.org/dig v1.17.1 // indirect
go.uber.org/mock v0.4.0 // indirect
Expand All @@ -337,4 +342,5 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
howett.net/plist v0.0.0-20181124034731-591f970eefbb // indirect
lukechampine.com/blake3 v1.3.0 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)
22 changes: 18 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE=
github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8=
github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI=
Expand Down Expand Up @@ -152,12 +154,16 @@ github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX
github.com/cilium/ebpf v0.9.1 h1:64sn2K3UKw8NbP/blsixRpF3nXuyhz/VjRlRzvlBRu4=
github.com/cilium/ebpf v0.9.1/go.mod h1:+OhNOIXx/Fnu1IE8bJz2dzOA+VSfyTfdNUVdlQnxUFY=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU=
github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA=
github.com/cloudflare/circl v1.3.9 h1:QFrlgFYf2Qpi8bSpVPK1HBvWpx16v/1TZivyo7pGuBE=
github.com/cloudflare/circl v1.3.9/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cockroachdb/cockroach-go/v2 v2.2.0 h1:/5znzg5n373N/3ESjHF5SMLxiW4RKB05Ql//KWfeTFs=
github.com/cockroachdb/cockroach-go/v2 v2.2.0/go.mod h1:u3MiKYGupPPjkn3ozknpMUpxPaNLTFWAya419/zv6eI=
github.com/codegangsta/cli v1.20.0/go.mod h1:/qJNoX69yVSKu5o4jLyXAENLRyk1uhi7zkbQ3slBdOA=
github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ=
github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI=
github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M=
github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY=
github.com/containerd/cgroups v0.0.0-20201119153540-4cbc285b3327/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE=
github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM=
github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw=
Expand Down Expand Up @@ -267,8 +273,8 @@ github.com/filecoin-project/go-commp-utils/v2 v2.1.0/go.mod h1:NbxJYlhxtWaNhlVCj
github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ=
github.com/filecoin-project/go-crypto v0.1.0 h1:Pob2MphoipMbe/ksxZOMcQvmBHAd3sI/WEqcbpIsGI0=
github.com/filecoin-project/go-crypto v0.1.0/go.mod h1:K9UFXvvoyAVvB+0Le7oGlKiT9mgA5FHOJdYQXEE8IhI=
github.com/filecoin-project/go-f3 v0.3.0 h1:GUY7+QSyWqX4MEuFtQAYkYLRM1t3GleZ0U2I87oOStM=
github.com/filecoin-project/go-f3 v0.3.0/go.mod h1:MVf4ynbRdLMnZZWK8GJCex0VH1lQvh9AwFTMEu7jX1Y=
github.com/filecoin-project/go-f3 v0.4.0 h1:3UUjFMmZYvytDZPI5oeMroaEGO691icQM/7XoioYVxg=
github.com/filecoin-project/go-f3 v0.4.0/go.mod h1:QoxuoK4aktNZD1R/unlhNbhV6TnlNTAbA/QODCnAjak=
github.com/filecoin-project/go-fil-commcid v0.2.0 h1:B+5UX8XGgdg/XsdUpST4pEBviKkFOw+Fvl2bLhSKGpI=
github.com/filecoin-project/go-fil-commcid v0.2.0/go.mod h1:8yigf3JDIil+/WpqR5zoKyP0jBPCOGtEqq/K1CcMy9Q=
github.com/filecoin-project/go-fil-commp-hashhash v0.2.0 h1:HYIUugzjq78YvV3vC6rL95+SfC/aSTVSnZSZiDV5pCk=
Expand Down Expand Up @@ -484,6 +490,7 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf
github.com/google/pprof v0.0.0-20240509144519-723abb6459b7 h1:velgFPYr1X9TDwLIfkV7fWqsFlf7TeP11M/7kPd/dVI=
github.com/google/pprof v0.0.0-20240509144519-723abb6459b7/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
Expand Down Expand Up @@ -933,6 +940,9 @@ github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY=
github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU=
github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
Expand Down Expand Up @@ -1344,6 +1354,8 @@ gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 h1:qwDnMxjkyLmAF
gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02/go.mod h1:JTnUj0mpYiAsuZLmKjTx/ex3AtMowcCgnE7YNyCEP0I=
go.dedis.ch/fixbuf v1.0.3 h1:hGcV9Cd/znUxlusJ64eAlExS+5cJDIyTyEG+otu5wQs=
go.dedis.ch/fixbuf v1.0.3/go.mod h1:yzJMt34Wa5xD37V5RTdmp38cz3QhMagdGoem9anUalw=
go.dedis.ch/kyber/v4 v4.0.0-pre2.0.20240924132404-4de33740016e h1:BAGc1ommHzlhqHktWyRmoldVONj3QHMzdfGLW4ItltA=
go.dedis.ch/kyber/v4 v4.0.0-pre2.0.20240924132404-4de33740016e/go.mod h1:tg6jwKTYEjm94VxkFwiQy+ec9hoQvccIU989wNjXWVI=
go.dedis.ch/protobuf v1.0.11 h1:FTYVIEzY/bfl37lu3pR4lIj+F9Vp1jE8oh91VmxKgLo=
go.dedis.ch/protobuf v1.0.11/go.mod h1:97QR256dnkimeNdfmURz0wAMNVbd1VmLXhG1CrTYrJ4=
go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ=
Expand Down Expand Up @@ -1900,5 +1912,7 @@ lukechampine.com/blake3 v1.3.0/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU=
rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA=
sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck=
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
14 changes: 12 additions & 2 deletions itests/kit/node_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"time"

"github.com/ipfs/go-cid"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/libp2p/go-libp2p/core/peer"

"github.com/filecoin-project/go-f3/manifest"
Expand Down Expand Up @@ -217,16 +218,25 @@ func MutateSealingConfig(mut func(sc *config.SealingConfig)) NodeOpt {
func F3Enabled(bootstrapEpoch abi.ChainEpoch, blockDelay time.Duration, finality abi.ChainEpoch, manifestProvider peer.ID) NodeOpt {
return ConstructorOpts(
node.Override(new(*lf3.Config), func(nn dtypes.NetworkName) *lf3.Config {
c := lf3.NewConfig(manifestProvider, true, cid.Undef)(nn)
c := lf3.NewConfig(manifestProvider, cid.Undef)(nn)
c.InitialManifest.Pause = false
c.InitialManifest.EC.Period = blockDelay
c.InitialManifest.Gpbft.Delta = blockDelay / 5
c.InitialManifest.EC.Finality = int64(finality)
c.InitialManifest.BootstrapEpoch = int64(bootstrapEpoch)
c.InitialManifest.EC.HeadLookback = 0
c.InitialManifest.EC.Finalize = true
c.InitialManifest.CatchUpAlignment = blockDelay / 2
c.InitialManifest.CertificateExchange.MinimumPollInterval = 2 * blockDelay
c.InitialManifest.CertificateExchange.MaximumPollInterval = 10 * blockDelay
return c
}),
node.Override(new(manifest.ManifestProvider), lf3.NewManifestProvider),
node.Override(new(manifest.ManifestProvider),
func(config *lf3.Config, ps *pubsub.PubSub) (manifest.ManifestProvider, error) {
return manifest.NewDynamicManifestProvider(ps, config.DynamicManifestProvider,
manifest.DynamicManifestProviderWithInitialManifest(config.InitialManifest),
)
}),
node.Override(new(*lf3.F3), lf3.New),
)
}
Expand Down
1 change: 0 additions & 1 deletion node/builder_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ var ChainNode = Options(
If(build.IsF3Enabled(),
Override(new(*lf3.Config), lf3.NewConfig(
buildconstants.F3ManifestServerID,
buildconstants.F3Consensus,
buildconstants.F3InitialPowerTableCID,
)),
Override(new(manifest.ManifestProvider), lf3.NewManifestProvider),
Expand Down

0 comments on commit 0e7292a

Please sign in to comment.