Skip to content

Commit 0e7292a

Browse files
KubuxuStebalien
andauthored
chore(f3): update go-f3 to 0.4.0 (#12547)
--- Signed-off-by: Jakub Sztandera <[email protected]> Co-authored-by: Steven Allen <[email protected]>
1 parent 1f1afe5 commit 0e7292a

File tree

11 files changed

+75
-23
lines changed

11 files changed

+75
-23
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* 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".
1010
* 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)
1111
* 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)
12+
* 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.
1213

1314
## Improvements
1415

build/openrpc/full.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7505,7 +7505,8 @@
75057505
"Finality": 0,
75067506
"DelayMultiplier": 0,
75077507
"BaseDecisionBackoffTable": null,
7508-
"HeadLookback": 0
7508+
"HeadLookback": 0,
7509+
"Finalize": false
75097510
},
75107511
"CertificateExchange": {
75117512
"ClientRequestTimeout": 0,
@@ -7567,6 +7568,9 @@
75677568
"title": "number",
75687569
"type": "number"
75697570
},
7571+
"Finalize": {
7572+
"type": "boolean"
7573+
},
75707574
"HeadLookback": {
75717575
"title": "number",
75727576
"type": "number"

chain/lf3/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ import (
1717
type Config struct {
1818
InitialManifest *manifest.Manifest
1919
DynamicManifestProvider peer.ID
20-
F3ConsensusEnabled bool
2120
}
2221

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

3940
// TODO: We're forcing this to start paused for now. We need to remove this for the final
4041
// mainnet launch.
4142
m.Pause = true
4243
return &Config{
4344
InitialManifest: m,
4445
DynamicManifestProvider: manifestProvider,
45-
F3ConsensusEnabled: consensusEnabled,
4646
}
4747
}
4848
}

chain/lf3/ec.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ type ecWrapper struct {
3030
ChainStore *store.ChainStore
3131
Syncer *chain.Syncer
3232
StateManager *stmgr.StateManager
33-
34-
// Checkpoint sets whether to checkpoint tipsets finalized by F3 in ChainStore.
35-
Checkpoint bool
3633
}
3734

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

214211
func (ec *ecWrapper) Finalize(ctx context.Context, key gpbft.TipSetKey) error {
215-
if !ec.Checkpoint {
216-
return nil // Nothing to do; checkpointing is not enabled.
217-
}
218212
tsk, err := toLotusTipSetKey(key)
219213
if err != nil {
220214
return err

chain/lf3/f3.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package lf3
33
import (
44
"context"
55
"errors"
6+
"path/filepath"
67
"time"
78

89
"github.com/ipfs/go-datastore"
@@ -26,6 +27,7 @@ import (
2627
"github.com/filecoin-project/lotus/chain/types"
2728
"github.com/filecoin-project/lotus/node/modules/dtypes"
2829
"github.com/filecoin-project/lotus/node/modules/helpers"
30+
"github.com/filecoin-project/lotus/node/repo"
2931
)
3032

3133
type F3 struct {
@@ -48,6 +50,7 @@ type F3Params struct {
4850
Datastore dtypes.MetadataDS
4951
Wallet api.Wallet
5052
Config *Config
53+
LockedRepo repo.LockedRepo
5154
}
5255

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

67+
f3FsPath := filepath.Join(params.LockedRepo.Path(), "f3")
6568
module, err := f3.New(mctx, params.ManifestProvider, ds,
66-
params.Host, params.PubSub, verif, ec)
69+
params.Host, params.PubSub, verif, ec, f3FsPath)
6770

6871
if err != nil {
6972
return nil, xerrors.Errorf("creating F3: %w", err)

chain/lf3/manifest.go

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package lf3
22

33
import (
4+
"fmt"
5+
46
"github.com/ipfs/go-datastore"
57
"github.com/ipfs/go-datastore/namespace"
68
pubsub "github.com/libp2p/go-libp2p-pubsub"
@@ -16,10 +18,28 @@ import (
1618
// message topic will be filtered
1719
var MaxDynamicManifestChangesAllowed = 1000
1820

19-
func NewManifestProvider(config *Config, ps *pubsub.PubSub, mds dtypes.MetadataDS) manifest.ManifestProvider {
21+
func NewManifestProvider(config *Config, ps *pubsub.PubSub, mds dtypes.MetadataDS) (manifest.ManifestProvider, error) {
2022
if config.DynamicManifestProvider == "" {
2123
return manifest.NewStaticManifestProvider(config.InitialManifest)
2224
}
25+
26+
primaryNetworkName := config.InitialManifest.NetworkName
27+
filter := func(m *manifest.Manifest) error {
28+
if m.EC.Finalize {
29+
return fmt.Errorf("refusing dynamic manifest that finalizes tipsets")
30+
}
31+
if m.NetworkName == primaryNetworkName {
32+
return fmt.Errorf(
33+
"refusing dynamic manifest with network name %q that clashes with initial manifest",
34+
primaryNetworkName,
35+
)
36+
}
37+
return nil
38+
}
2339
ds := namespace.Wrap(mds, datastore.NewKey("/f3-dynamic-manifest"))
24-
return manifest.NewDynamicManifestProvider(config.InitialManifest, ds, ps, config.DynamicManifestProvider)
40+
return manifest.NewDynamicManifestProvider(ps, config.DynamicManifestProvider,
41+
manifest.DynamicManifestProviderWithInitialManifest(config.InitialManifest),
42+
manifest.DynamicManifestProviderWithDatastore(ds),
43+
manifest.DynamicManifestProviderWithFilter(filter),
44+
)
2545
}

documentation/en/api-v1-unstable-methods.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2554,7 +2554,8 @@ Response:
25542554
"Finality": 0,
25552555
"DelayMultiplier": 0,
25562556
"BaseDecisionBackoffTable": null,
2557-
"HeadLookback": 0
2557+
"HeadLookback": 0,
2558+
"Finalize": false
25582559
},
25592560
"CertificateExchange": {
25602561
"ClientRequestTimeout": 0,

go.mod

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ require (
4343
github.com/filecoin-project/go-cbor-util v0.0.1
4444
github.com/filecoin-project/go-commp-utils/v2 v2.1.0
4545
github.com/filecoin-project/go-crypto v0.1.0
46-
github.com/filecoin-project/go-f3 v0.3.0
46+
github.com/filecoin-project/go-f3 v0.4.0
4747
github.com/filecoin-project/go-fil-commcid v0.2.0
4848
github.com/filecoin-project/go-hamt-ipld/v3 v3.4.0
4949
github.com/filecoin-project/go-jsonrpc v0.6.0
@@ -177,10 +177,13 @@ require (
177177
github.com/bahlo/generic-list-go v0.2.0 // indirect
178178
github.com/benbjohnson/clock v1.3.5 // indirect
179179
github.com/beorn7/perks v1.0.1 // indirect
180+
github.com/bits-and-blooms/bitset v1.13.0 // indirect
180181
github.com/buger/jsonparser v1.1.1 // indirect
181182
github.com/cespare/xxhash v1.1.0 // indirect
182183
github.com/cespare/xxhash/v2 v2.3.0 // indirect
183184
github.com/cilium/ebpf v0.9.1 // indirect
185+
github.com/consensys/bavard v0.1.13 // indirect
186+
github.com/consensys/gnark-crypto v0.12.1 // indirect
184187
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
185188
github.com/cskr/pubsub v1.0.2 // indirect
186189
github.com/daaku/go.zipexe v1.0.2 // indirect
@@ -267,6 +270,7 @@ require (
267270
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect
268271
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
269272
github.com/minio/sha256-simd v1.0.1 // indirect
273+
github.com/mmcloughlin/addchain v0.4.0 // indirect
270274
github.com/mr-tron/base58 v1.2.0 // indirect
271275
github.com/multiformats/go-base36 v0.2.0 // indirect
272276
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
@@ -322,6 +326,7 @@ require (
322326
github.com/zondax/ledger-go v0.14.3 // indirect
323327
gitlab.com/yawning/secp256k1-voi v0.0.0-20230925100816-f2616030848b // indirect
324328
gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect
329+
go.dedis.ch/kyber/v4 v4.0.0-pre2.0.20240924132404-4de33740016e // indirect
325330
go.opentelemetry.io/otel/trace v1.28.0 // indirect
326331
go.uber.org/dig v1.17.1 // indirect
327332
go.uber.org/mock v0.4.0 // indirect
@@ -337,4 +342,5 @@ require (
337342
gopkg.in/yaml.v3 v3.0.1 // indirect
338343
howett.net/plist v0.0.0-20181124034731-591f970eefbb // indirect
339344
lukechampine.com/blake3 v1.3.0 // indirect
345+
rsc.io/tmplfunc v0.0.3 // indirect
340346
)

go.sum

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24
103103
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
104104
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
105105
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
106+
github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE=
107+
github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
106108
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
107109
github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8=
108110
github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI=
@@ -152,12 +154,16 @@ github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX
152154
github.com/cilium/ebpf v0.9.1 h1:64sn2K3UKw8NbP/blsixRpF3nXuyhz/VjRlRzvlBRu4=
153155
github.com/cilium/ebpf v0.9.1/go.mod h1:+OhNOIXx/Fnu1IE8bJz2dzOA+VSfyTfdNUVdlQnxUFY=
154156
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
155-
github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU=
156-
github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA=
157+
github.com/cloudflare/circl v1.3.9 h1:QFrlgFYf2Qpi8bSpVPK1HBvWpx16v/1TZivyo7pGuBE=
158+
github.com/cloudflare/circl v1.3.9/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU=
157159
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
158160
github.com/cockroachdb/cockroach-go/v2 v2.2.0 h1:/5znzg5n373N/3ESjHF5SMLxiW4RKB05Ql//KWfeTFs=
159161
github.com/cockroachdb/cockroach-go/v2 v2.2.0/go.mod h1:u3MiKYGupPPjkn3ozknpMUpxPaNLTFWAya419/zv6eI=
160162
github.com/codegangsta/cli v1.20.0/go.mod h1:/qJNoX69yVSKu5o4jLyXAENLRyk1uhi7zkbQ3slBdOA=
163+
github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ=
164+
github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI=
165+
github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M=
166+
github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY=
161167
github.com/containerd/cgroups v0.0.0-20201119153540-4cbc285b3327/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE=
162168
github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM=
163169
github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw=
@@ -267,8 +273,8 @@ github.com/filecoin-project/go-commp-utils/v2 v2.1.0/go.mod h1:NbxJYlhxtWaNhlVCj
267273
github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ=
268274
github.com/filecoin-project/go-crypto v0.1.0 h1:Pob2MphoipMbe/ksxZOMcQvmBHAd3sI/WEqcbpIsGI0=
269275
github.com/filecoin-project/go-crypto v0.1.0/go.mod h1:K9UFXvvoyAVvB+0Le7oGlKiT9mgA5FHOJdYQXEE8IhI=
270-
github.com/filecoin-project/go-f3 v0.3.0 h1:GUY7+QSyWqX4MEuFtQAYkYLRM1t3GleZ0U2I87oOStM=
271-
github.com/filecoin-project/go-f3 v0.3.0/go.mod h1:MVf4ynbRdLMnZZWK8GJCex0VH1lQvh9AwFTMEu7jX1Y=
276+
github.com/filecoin-project/go-f3 v0.4.0 h1:3UUjFMmZYvytDZPI5oeMroaEGO691icQM/7XoioYVxg=
277+
github.com/filecoin-project/go-f3 v0.4.0/go.mod h1:QoxuoK4aktNZD1R/unlhNbhV6TnlNTAbA/QODCnAjak=
272278
github.com/filecoin-project/go-fil-commcid v0.2.0 h1:B+5UX8XGgdg/XsdUpST4pEBviKkFOw+Fvl2bLhSKGpI=
273279
github.com/filecoin-project/go-fil-commcid v0.2.0/go.mod h1:8yigf3JDIil+/WpqR5zoKyP0jBPCOGtEqq/K1CcMy9Q=
274280
github.com/filecoin-project/go-fil-commp-hashhash v0.2.0 h1:HYIUugzjq78YvV3vC6rL95+SfC/aSTVSnZSZiDV5pCk=
@@ -484,6 +490,7 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf
484490
github.com/google/pprof v0.0.0-20240509144519-723abb6459b7 h1:velgFPYr1X9TDwLIfkV7fWqsFlf7TeP11M/7kPd/dVI=
485491
github.com/google/pprof v0.0.0-20240509144519-723abb6459b7/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw=
486492
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
493+
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
487494
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
488495
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
489496
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
@@ -933,6 +940,9 @@ github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5
933940
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
934941
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
935942
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
943+
github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY=
944+
github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU=
945+
github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU=
936946
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
937947
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
938948
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
@@ -1344,6 +1354,8 @@ gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 h1:qwDnMxjkyLmAF
13441354
gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02/go.mod h1:JTnUj0mpYiAsuZLmKjTx/ex3AtMowcCgnE7YNyCEP0I=
13451355
go.dedis.ch/fixbuf v1.0.3 h1:hGcV9Cd/znUxlusJ64eAlExS+5cJDIyTyEG+otu5wQs=
13461356
go.dedis.ch/fixbuf v1.0.3/go.mod h1:yzJMt34Wa5xD37V5RTdmp38cz3QhMagdGoem9anUalw=
1357+
go.dedis.ch/kyber/v4 v4.0.0-pre2.0.20240924132404-4de33740016e h1:BAGc1ommHzlhqHktWyRmoldVONj3QHMzdfGLW4ItltA=
1358+
go.dedis.ch/kyber/v4 v4.0.0-pre2.0.20240924132404-4de33740016e/go.mod h1:tg6jwKTYEjm94VxkFwiQy+ec9hoQvccIU989wNjXWVI=
13471359
go.dedis.ch/protobuf v1.0.11 h1:FTYVIEzY/bfl37lu3pR4lIj+F9Vp1jE8oh91VmxKgLo=
13481360
go.dedis.ch/protobuf v1.0.11/go.mod h1:97QR256dnkimeNdfmURz0wAMNVbd1VmLXhG1CrTYrJ4=
13491361
go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ=
@@ -1900,5 +1912,7 @@ lukechampine.com/blake3 v1.3.0/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1
19001912
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
19011913
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
19021914
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
1915+
rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU=
1916+
rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA=
19031917
sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck=
19041918
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=

itests/kit/node_opts.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"time"
66

77
"github.com/ipfs/go-cid"
8+
pubsub "github.com/libp2p/go-libp2p-pubsub"
89
"github.com/libp2p/go-libp2p/core/peer"
910

1011
"github.com/filecoin-project/go-f3/manifest"
@@ -217,16 +218,25 @@ func MutateSealingConfig(mut func(sc *config.SealingConfig)) NodeOpt {
217218
func F3Enabled(bootstrapEpoch abi.ChainEpoch, blockDelay time.Duration, finality abi.ChainEpoch, manifestProvider peer.ID) NodeOpt {
218219
return ConstructorOpts(
219220
node.Override(new(*lf3.Config), func(nn dtypes.NetworkName) *lf3.Config {
220-
c := lf3.NewConfig(manifestProvider, true, cid.Undef)(nn)
221+
c := lf3.NewConfig(manifestProvider, cid.Undef)(nn)
221222
c.InitialManifest.Pause = false
222223
c.InitialManifest.EC.Period = blockDelay
223224
c.InitialManifest.Gpbft.Delta = blockDelay / 5
224225
c.InitialManifest.EC.Finality = int64(finality)
225226
c.InitialManifest.BootstrapEpoch = int64(bootstrapEpoch)
226227
c.InitialManifest.EC.HeadLookback = 0
228+
c.InitialManifest.EC.Finalize = true
229+
c.InitialManifest.CatchUpAlignment = blockDelay / 2
230+
c.InitialManifest.CertificateExchange.MinimumPollInterval = 2 * blockDelay
231+
c.InitialManifest.CertificateExchange.MaximumPollInterval = 10 * blockDelay
227232
return c
228233
}),
229-
node.Override(new(manifest.ManifestProvider), lf3.NewManifestProvider),
234+
node.Override(new(manifest.ManifestProvider),
235+
func(config *lf3.Config, ps *pubsub.PubSub) (manifest.ManifestProvider, error) {
236+
return manifest.NewDynamicManifestProvider(ps, config.DynamicManifestProvider,
237+
manifest.DynamicManifestProviderWithInitialManifest(config.InitialManifest),
238+
)
239+
}),
230240
node.Override(new(*lf3.F3), lf3.New),
231241
)
232242
}

0 commit comments

Comments
 (0)