Skip to content

Commit 01b9246

Browse files
committed
Merge branch 'master' into jordan/existence-check-snapshot
2 parents 6932613 + 243a5e3 commit 01b9246

File tree

235 files changed

+8672
-4543
lines changed

Some content is hidden

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

235 files changed

+8672
-4543
lines changed

.github/workflows/test-monitor-flaky.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ jobs:
7272
TEST_FLAKY: true
7373
JSON_OUTPUT: true
7474
RACE_DETECTOR: 1
75+
- name: Print test results
76+
run: cat test-output
7577
- name: Process test results
7678
run: cat test-output | go run tools/test_monitor/level1/process_summary1_results.go
7779
env:

.github/workflows/test-monitor-regular-skipped.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ jobs:
7676
command: ./tools/test_monitor/run-tests.sh
7777
env:
7878
JSON_OUTPUT: true
79+
- name: Print test results
80+
run: cat test-output
7981
- name: Process test results
8082
run: cat test-output | go run tools/test_monitor/level1/process_summary1_results.go
8183
env:

Makefile

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# The short Git commit hash
22
SHORT_COMMIT := $(shell git rev-parse --short HEAD)
3+
BRANCH_NAME:=$(shell git rev-parse --abbrev-ref HEAD | tr '/' '-')
34
# The Git commit hash
45
COMMIT := $(shell git rev-parse HEAD)
56
# The tag of the current commit, otherwise empty
@@ -9,6 +10,9 @@ VERSION := $(shell git describe --tags --abbrev=2 --match "v*" --match "secure-c
910
# dynamically split up CI jobs into smaller jobs that can be run in parallel
1011
GO_TEST_PACKAGES := ./...
1112

13+
FLOW_GO_TAG := v0.28.15
14+
15+
1216
# Image tag: if image tag is not set, set it with version (or short commit if empty)
1317
ifeq (${IMAGE_TAG},)
1418
IMAGE_TAG := ${VERSION}
@@ -33,6 +37,7 @@ GOARCH := $(shell go env GOARCH)
3337
# The location of the k8s YAML files
3438
K8S_YAMLS_LOCATION_STAGING=./k8s/staging
3539

40+
3641
# docker container registry
3742
export CONTAINER_REGISTRY := gcr.io/flow-container-registry
3843
export DOCKER_BUILDKIT := 1
@@ -156,6 +161,7 @@ generate-mocks: install-mock-generators
156161
mockery --name '.*' --dir=engine/execution/computation/computer --case=underscore --output="./engine/execution/computation/computer/mock" --outpkg="mock"
157162
mockery --name '.*' --dir=engine/execution/state --case=underscore --output="./engine/execution/state/mock" --outpkg="mock"
158163
mockery --name '.*' --dir=engine/collection --case=underscore --output="./engine/collection/mock" --outpkg="mock"
164+
mockery --name 'complianceCore' --dir=engine/common/follower --exported --case=underscore --output="./engine/common/follower/mock" --outpkg="mock"
159165
mockery --name '.*' --dir=engine/common/follower/cache --case=underscore --output="./engine/common/follower/cache/mock" --outpkg="mock"
160166
mockery --name '.*' --dir=engine/consensus --case=underscore --output="./engine/consensus/mock" --outpkg="mock"
161167
mockery --name '.*' --dir=engine/consensus/approvals --case=underscore --output="./engine/consensus/approvals/mock" --outpkg="mock"
@@ -248,12 +254,12 @@ docker-ci-integration:
248254
docker-build-collection:
249255
docker build -f cmd/Dockerfile --build-arg TARGET=./cmd/collection --build-arg COMMIT=$(COMMIT) --build-arg VERSION=$(IMAGE_TAG) --build-arg GOARCH=$(GOARCH) --target production \
250256
--label "git_commit=${COMMIT}" --label "git_tag=${IMAGE_TAG}" \
251-
-t "$(CONTAINER_REGISTRY)/collection:latest" -t "$(CONTAINER_REGISTRY)/collection:$(SHORT_COMMIT)" -t "$(CONTAINER_REGISTRY)/collection:$(IMAGE_TAG)" .
257+
-t "$(CONTAINER_REGISTRY)/collection:latest" -t "$(CONTAINER_REGISTRY)/collection:$(SHORT_COMMIT)" -t "$(CONTAINER_REGISTRY)/collection:$(IMAGE_TAG)" -t "$(CONTAINER_REGISTRY)/collection:$(FLOW_GO_TAG)" .
252258

253259
.PHONY: docker-build-collection-without-netgo
254260
docker-build-collection-without-netgo:
255261
docker build -f cmd/Dockerfile --build-arg TAGS=relic --build-arg TARGET=./cmd/collection --build-arg COMMIT=$(COMMIT) --build-arg VERSION=$(IMAGE_TAG_NO_NETGO) --build-arg GOARCH=$(GOARCH) --target production \
256-
--label "git_commit=${COMMIT}" --label "git_tag=$(IMAGE_TAG_NO_NETGO)" -t "$(CONTAINER_REGISTRY)/collection:$(IMAGE_TAG_NO_NETGO)" .
262+
--label "git_commit=${COMMIT}" --label "git_tag=$(IMAGE_TAG_NO_NETGO)" -t "$(CONTAINER_REGISTRY)/collection:$(IMAGE_TAG_NO_NETGO)" .
257263

258264
.PHONY: docker-build-collection-debug
259265
docker-build-collection-debug:
@@ -264,7 +270,7 @@ docker-build-collection-debug:
264270
docker-build-consensus:
265271
docker build -f cmd/Dockerfile --build-arg TARGET=./cmd/consensus --build-arg COMMIT=$(COMMIT) --build-arg VERSION=$(IMAGE_TAG) --build-arg GOARCH=$(GOARCH) --target production \
266272
--label "git_commit=${COMMIT}" --label "git_tag=${IMAGE_TAG}" \
267-
-t "$(CONTAINER_REGISTRY)/consensus:latest" -t "$(CONTAINER_REGISTRY)/consensus:$(SHORT_COMMIT)" -t "$(CONTAINER_REGISTRY)/consensus:$(IMAGE_TAG)" .
273+
-t "$(CONTAINER_REGISTRY)/consensus:latest" -t "$(CONTAINER_REGISTRY)/consensus:$(SHORT_COMMIT)" -t "$(CONTAINER_REGISTRY)/consensus:$(IMAGE_TAG)" -t "$(CONTAINER_REGISTRY)/consensus:$(FLOW_GO_TAG)" .
268274

269275
.PHONY: docker-build-consensus-without-netgo
270276
docker-build-consensus-without-netgo:
@@ -280,7 +286,7 @@ docker-build-consensus-debug:
280286
docker-build-execution:
281287
docker build -f cmd/Dockerfile --build-arg TARGET=./cmd/execution --build-arg COMMIT=$(COMMIT) --build-arg VERSION=$(IMAGE_TAG) --build-arg GOARCH=$(GOARCH) --target production \
282288
--label "git_commit=${COMMIT}" --label "git_tag=${IMAGE_TAG}" \
283-
-t "$(CONTAINER_REGISTRY)/execution:latest" -t "$(CONTAINER_REGISTRY)/execution:$(SHORT_COMMIT)" -t "$(CONTAINER_REGISTRY)/execution:$(IMAGE_TAG)" .
289+
-t "$(CONTAINER_REGISTRY)/execution:latest" -t "$(CONTAINER_REGISTRY)/execution:$(SHORT_COMMIT)" -t "$(CONTAINER_REGISTRY)/execution:$(IMAGE_TAG)" -t "$(CONTAINER_REGISTRY)/execution:$(FLOW_GO_TAG)" .
284290

285291
.PHONY: docker-build-execution-without-netgo
286292
docker-build-execution-without-netgo:
@@ -306,7 +312,7 @@ docker-build-execution-corrupt:
306312
docker-build-verification:
307313
docker build -f cmd/Dockerfile --build-arg TARGET=./cmd/verification --build-arg COMMIT=$(COMMIT) --build-arg VERSION=$(IMAGE_TAG) --build-arg GOARCH=$(GOARCH) --target production \
308314
--label "git_commit=${COMMIT}" --label "git_tag=${IMAGE_TAG}" \
309-
-t "$(CONTAINER_REGISTRY)/verification:latest" -t "$(CONTAINER_REGISTRY)/verification:$(SHORT_COMMIT)" -t "$(CONTAINER_REGISTRY)/verification:$(IMAGE_TAG)" .
315+
-t "$(CONTAINER_REGISTRY)/verification:latest" -t "$(CONTAINER_REGISTRY)/verification:$(SHORT_COMMIT)" -t "$(CONTAINER_REGISTRY)/verification:$(IMAGE_TAG)" -t "$(CONTAINER_REGISTRY)/verification:$(FLOW_GO_TAG)" .
310316

311317
.PHONY: docker-build-verification-without-netgo
312318
docker-build-verification-without-netgo:
@@ -332,7 +338,7 @@ docker-build-verification-corrupt:
332338
docker-build-access:
333339
docker build -f cmd/Dockerfile --build-arg TARGET=./cmd/access --build-arg COMMIT=$(COMMIT) --build-arg VERSION=$(IMAGE_TAG) --build-arg GOARCH=$(GOARCH) --target production \
334340
--label "git_commit=${COMMIT}" --label "git_tag=${IMAGE_TAG}" \
335-
-t "$(CONTAINER_REGISTRY)/access:latest" -t "$(CONTAINER_REGISTRY)/access:$(SHORT_COMMIT)" -t "$(CONTAINER_REGISTRY)/access:$(IMAGE_TAG)" .
341+
-t "$(CONTAINER_REGISTRY)/access:latest" -t "$(CONTAINER_REGISTRY)/access:$(SHORT_COMMIT)" -t "$(CONTAINER_REGISTRY)/access:$(IMAGE_TAG)" -t "$(CONTAINER_REGISTRY)/access:$(FLOW_GO_TAG)" .
336342

337343
.PHONY: docker-build-access-without-netgo
338344
docker-build-access-without-netgo:
@@ -419,6 +425,7 @@ docker-build-benchnet: docker-build-flow docker-build-loader
419425
docker-push-collection:
420426
docker push "$(CONTAINER_REGISTRY)/collection:$(SHORT_COMMIT)"
421427
docker push "$(CONTAINER_REGISTRY)/collection:$(IMAGE_TAG)"
428+
docker push "$(CONTAINER_REGISTRY)/collection:$(FLOW_GO_TAG)"
422429

423430
.PHONY: docker-push-collection-without-netgo
424431
docker-push-collection-without-netgo:
@@ -432,6 +439,7 @@ docker-push-collection-latest: docker-push-collection
432439
docker-push-consensus:
433440
docker push "$(CONTAINER_REGISTRY)/consensus:$(SHORT_COMMIT)"
434441
docker push "$(CONTAINER_REGISTRY)/consensus:$(IMAGE_TAG)"
442+
docker push "$(CONTAINER_REGISTRY)/consensus:$(FLOW_GO_TAG)"
435443

436444
.PHONY: docker-push-consensus-without-netgo
437445
docker-push-consensus-without-netgo:
@@ -445,6 +453,13 @@ docker-push-consensus-latest: docker-push-consensus
445453
docker-push-execution:
446454
docker push "$(CONTAINER_REGISTRY)/execution:$(SHORT_COMMIT)"
447455
docker push "$(CONTAINER_REGISTRY)/execution:$(IMAGE_TAG)"
456+
docker push "$(CONTAINER_REGISTRY)/execution:$(FLOW_GO_TAG)"
457+
458+
.PHONY: docker-push-execution-corrupt
459+
docker-push-execution-corrupt:
460+
docker push "$(CONTAINER_REGISTRY)/execution-corrupted:$(SHORT_COMMIT)"
461+
docker push "$(CONTAINER_REGISTRY)/execution-corrupted:$(IMAGE_TAG)"
462+
448463

449464
.PHONY: docker-push-execution-without-netgo
450465
docker-push-execution-without-netgo:
@@ -458,6 +473,12 @@ docker-push-execution-latest: docker-push-execution
458473
docker-push-verification:
459474
docker push "$(CONTAINER_REGISTRY)/verification:$(SHORT_COMMIT)"
460475
docker push "$(CONTAINER_REGISTRY)/verification:$(IMAGE_TAG)"
476+
docker push "$(CONTAINER_REGISTRY)/verification:$(FLOW_GO_TAG)"
477+
478+
.PHONY: docker-push-verification-corrupt
479+
docker-push-verification-corrupt:
480+
docker push "$(CONTAINER_REGISTRY)/verification-corrupted:$(SHORT_COMMIT)"
481+
docker push "$(CONTAINER_REGISTRY)/verification-corrupted:$(IMAGE_TAG)"
461482

462483
.PHONY: docker-push-verification-without-netgo
463484
docker-push-verification-without-netgo:
@@ -471,6 +492,12 @@ docker-push-verification-latest: docker-push-verification
471492
docker-push-access:
472493
docker push "$(CONTAINER_REGISTRY)/access:$(SHORT_COMMIT)"
473494
docker push "$(CONTAINER_REGISTRY)/access:$(IMAGE_TAG)"
495+
docker push "$(CONTAINER_REGISTRY)/access:$(FLOW_GO_TAG)"
496+
497+
.PHONY: docker-push-access-corrupt
498+
docker-push-access-corrupt:
499+
docker push "$(CONTAINER_REGISTRY)/access-corrupted:$(SHORT_COMMIT)"
500+
docker push "$(CONTAINER_REGISTRY)/access-corrupted:$(IMAGE_TAG)"
474501

475502
.PHONY: docker-push-access-without-netgo
476503
docker-push-access-without-netgo:
@@ -479,6 +506,7 @@ docker-push-access-without-netgo:
479506
.PHONY: docker-push-access-latest
480507
docker-push-access-latest: docker-push-access
481508
docker push "$(CONTAINER_REGISTRY)/access:latest"
509+
482510

483511
.PHONY: docker-push-observer
484512
docker-push-observer:
@@ -520,6 +548,9 @@ docker-push-flow-without-netgo: docker-push-collection-without-netgo docker-push
520548
.PHONY: docker-push-flow-latest
521549
docker-push-flow-latest: docker-push-collection-latest docker-push-consensus-latest docker-push-execution-latest docker-push-verification-latest docker-push-access-latest docker-push-observer-latest
522550

551+
.PHONY: docker-push-flow-corrupt
552+
docker-push-flow-corrupt: docker-push-access-corrupt docker-push-execution-corrupt docker-push-verification-corrupt
553+
523554
.PHONY: docker-push-benchnet
524555
docker-push-benchnet: docker-push-flow docker-push-loader
525556

@@ -621,4 +652,4 @@ monitor-rollout:
621652
kubectl --kubeconfig=$$kconfig rollout status statefulsets.apps flow-collection-node-v1; \
622653
kubectl --kubeconfig=$$kconfig rollout status statefulsets.apps flow-consensus-node-v1; \
623654
kubectl --kubeconfig=$$kconfig rollout status statefulsets.apps flow-execution-node-v1; \
624-
kubectl --kubeconfig=$$kconfig rollout status statefulsets.apps flow-verification-node-v1
655+
kubectl --kubeconfig=$$kconfig rollout status statefulsets.apps flow-verification-node-v1

cmd/access/node_builder/access_node_builder.go

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/onflow/flow-go/consensus"
2929
"github.com/onflow/flow-go/consensus/hotstuff"
3030
"github.com/onflow/flow-go/consensus/hotstuff/committees"
31+
"github.com/onflow/flow-go/consensus/hotstuff/notifications"
3132
consensuspubsub "github.com/onflow/flow-go/consensus/hotstuff/notifications/pubsub"
3233
"github.com/onflow/flow-go/consensus/hotstuff/signature"
3334
hotstuffvalidator "github.com/onflow/flow-go/consensus/hotstuff/validator"
@@ -39,21 +40,18 @@ import (
3940
"github.com/onflow/flow-go/engine/access/rpc"
4041
"github.com/onflow/flow-go/engine/access/rpc/backend"
4142
"github.com/onflow/flow-go/engine/access/state_stream"
42-
"github.com/onflow/flow-go/engine/common/follower"
4343
followereng "github.com/onflow/flow-go/engine/common/follower"
4444
"github.com/onflow/flow-go/engine/common/requester"
4545
synceng "github.com/onflow/flow-go/engine/common/synchronization"
4646
"github.com/onflow/flow-go/model/flow"
4747
"github.com/onflow/flow-go/model/flow/filter"
4848
"github.com/onflow/flow-go/module"
4949
"github.com/onflow/flow-go/module/blobs"
50-
"github.com/onflow/flow-go/module/buffer"
5150
"github.com/onflow/flow-go/module/chainsync"
52-
"github.com/onflow/flow-go/module/compliance"
51+
modulecompliance "github.com/onflow/flow-go/module/compliance"
5352
"github.com/onflow/flow-go/module/executiondatasync/execution_data"
5453
finalizer "github.com/onflow/flow-go/module/finalizer/consensus"
5554
"github.com/onflow/flow-go/module/id"
56-
"github.com/onflow/flow-go/module/mempool/queue"
5755
"github.com/onflow/flow-go/module/mempool/stdmap"
5856
"github.com/onflow/flow-go/module/metrics"
5957
"github.com/onflow/flow-go/module/metrics/unstaked"
@@ -68,7 +66,6 @@ import (
6866
"github.com/onflow/flow-go/network/p2p/cache"
6967
"github.com/onflow/flow-go/network/p2p/connection"
7068
"github.com/onflow/flow-go/network/p2p/dht"
71-
"github.com/onflow/flow-go/network/p2p/distributor"
7269
"github.com/onflow/flow-go/network/p2p/middleware"
7370
"github.com/onflow/flow-go/network/p2p/p2pbuilder"
7471
"github.com/onflow/flow-go/network/p2p/subscription"
@@ -225,7 +222,7 @@ type FlowAccessNodeBuilder struct {
225222
// engines
226223
IngestEng *ingestion.Engine
227224
RequestEng *requester.Engine
228-
FollowerEng *followereng.Engine
225+
FollowerEng *followereng.ComplianceEngine
229226
SyncEng *synceng.Engine
230227
StateStreamEng *state_stream.Engine
231228
}
@@ -321,31 +318,39 @@ func (builder *FlowAccessNodeBuilder) buildFollowerCore() *FlowAccessNodeBuilder
321318

322319
func (builder *FlowAccessNodeBuilder) buildFollowerEngine() *FlowAccessNodeBuilder {
323320
builder.Component("follower engine", func(node *cmd.NodeConfig) (module.ReadyDoneAware, error) {
324-
// initialize cleaner for DB
325-
cleaner := bstorage.NewCleaner(node.Logger, node.DB, builder.Metrics.CleanCollector, flow.DefaultValueLogGCFrequency)
326-
conCache := buffer.NewPendingBlocks()
321+
var heroCacheCollector module.HeroCacheMetrics = metrics.NewNoopCollector()
322+
if node.HeroCacheMetricsEnable {
323+
heroCacheCollector = metrics.FollowerCacheMetrics(node.MetricsRegisterer)
324+
}
327325

328-
followerEng, err := follower.New(
326+
core, err := followereng.NewComplianceCore(
329327
node.Logger,
330-
node.Network,
331-
node.Me,
332-
node.Metrics.Engine,
333328
node.Metrics.Mempool,
334-
cleaner,
335-
node.Storage.Headers,
336-
node.Storage.Payloads,
329+
heroCacheCollector,
330+
builder.FinalizationDistributor,
337331
builder.FollowerState,
338-
conCache,
339332
builder.FollowerCore,
340333
builder.Validator,
341334
builder.SyncCore,
342335
node.Tracer,
343-
follower.WithComplianceOptions(compliance.WithSkipNewProposalsThreshold(builder.ComplianceConfig.SkipNewProposalsThreshold)),
336+
modulecompliance.WithSkipNewProposalsThreshold(node.ComplianceConfig.SkipNewProposalsThreshold),
337+
)
338+
if err != nil {
339+
return nil, fmt.Errorf("could not create follower core: %w", err)
340+
}
341+
342+
builder.FollowerEng, err = followereng.NewComplianceLayer(
343+
node.Logger,
344+
node.Network,
345+
node.Me,
346+
node.Metrics.Engine,
347+
node.Storage.Headers,
348+
builder.Finalized,
349+
core,
344350
)
345351
if err != nil {
346352
return nil, fmt.Errorf("could not create follower engine: %w", err)
347353
}
348-
builder.FollowerEng = followerEng
349354

350355
return builder.FollowerEng, nil
351356
})
@@ -562,10 +567,12 @@ func (builder *FlowAccessNodeBuilder) BuildExecutionDataRequester() *FlowAccessN
562567
}
563568

564569
func FlowAccessNode(nodeBuilder *cmd.FlowNodeBuilder) *FlowAccessNodeBuilder {
570+
dist := consensuspubsub.NewFinalizationDistributor()
571+
dist.AddConsumer(notifications.NewSlashingViolationsConsumer(nodeBuilder.Logger))
565572
return &FlowAccessNodeBuilder{
566573
AccessNodeConfig: DefaultAccessNodeConfig(),
567574
FlowNodeBuilder: nodeBuilder,
568-
FinalizationDistributor: consensuspubsub.NewFinalizationDistributor(),
575+
FinalizationDistributor: dist,
569576
}
570577
}
571578

@@ -699,12 +706,7 @@ func (builder *FlowAccessNodeBuilder) InitIDProviders() {
699706
}
700707
builder.IDTranslator = translator.NewHierarchicalIDTranslator(idCache, translator.NewPublicNetworkIDTranslator())
701708

702-
heroStoreOpts := []queue.HeroStoreConfigOption{queue.WithHeroStoreSizeLimit(builder.DisallowListNotificationCacheSize)}
703-
if builder.HeroCacheMetricsEnable {
704-
collector := metrics.DisallowListNotificationQueueMetricFactory(builder.MetricsRegisterer)
705-
heroStoreOpts = append(heroStoreOpts, queue.WithHeroStoreCollector(collector))
706-
}
707-
builder.NodeDisallowListDistributor = distributor.DefaultDisallowListNotificationDistributor(builder.Logger, heroStoreOpts...)
709+
builder.NodeDisallowListDistributor = cmd.BuildDisallowListNotificationDisseminator(builder.DisallowListNotificationCacheSize, builder.MetricsRegisterer, builder.Logger, builder.MetricsEnabled)
708710

709711
// The following wrapper allows to disallow-list byzantine nodes via an admin command:
710712
// the wrapper overrides the 'Ejected' flag of disallow-listed nodes to true

cmd/bootstrap/cmd/key.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"github.com/spf13/cobra"
1414

1515
"github.com/onflow/flow-go/crypto"
16+
1617
model "github.com/onflow/flow-go/model/bootstrap"
1718
"github.com/onflow/flow-go/model/flow"
1819
)
@@ -47,31 +48,31 @@ func init() {
4748
&flagNetworkSeed,
4849
"networking-seed",
4950
[]byte{},
50-
fmt.Sprintf("hex encoded networking seed (min %d bytes)", crypto.KeyGenSeedMinLenECDSAP256))
51+
fmt.Sprintf("hex encoded networking seed (min %d bytes)", crypto.KeyGenSeedMinLen))
5152
keyCmd.Flags().BytesHexVar(
5253
&flagStakingSeed,
5354
"staking-seed",
5455
[]byte{},
55-
fmt.Sprintf("hex encoded staking seed (min %d bytes)", crypto.KeyGenSeedMinLenBLSBLS12381))
56+
fmt.Sprintf("hex encoded staking seed (min %d bytes)", crypto.KeyGenSeedMinLen))
5657
keyCmd.Flags().BytesHexVar(
5758
&flagMachineSeed,
5859
"machine-seed",
5960
[]byte{},
60-
fmt.Sprintf("hex encoded machine account seed (min %d bytes)", crypto.KeyGenSeedMinLenECDSAP256))
61+
fmt.Sprintf("hex encoded machine account seed (min %d bytes)", crypto.KeyGenSeedMinLen))
6162
}
6263

6364
// keyCmdRun generate the node staking key, networking key and node information
6465
func keyCmdRun(_ *cobra.Command, _ []string) {
6566

6667
// generate private key seeds if not specified via flag
6768
if len(flagNetworkSeed) == 0 {
68-
flagNetworkSeed = GenerateRandomSeed(crypto.KeyGenSeedMinLenECDSAP256)
69+
flagNetworkSeed = GenerateRandomSeed(crypto.KeyGenSeedMinLen)
6970
}
7071
if len(flagStakingSeed) == 0 {
71-
flagStakingSeed = GenerateRandomSeed(crypto.KeyGenSeedMinLenBLSBLS12381)
72+
flagStakingSeed = GenerateRandomSeed(crypto.KeyGenSeedMinLen)
7273
}
7374
if len(flagMachineSeed) == 0 {
74-
flagMachineSeed = GenerateRandomSeed(crypto.KeyGenSeedMinLenECDSAP256)
75+
flagMachineSeed = GenerateRandomSeed(crypto.KeyGenSeedMinLen)
7576
}
7677

7778
// validate inputs

cmd/bootstrap/cmd/keys.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ package cmd
33
import (
44
"fmt"
55

6-
"github.com/onflow/flow-go/cmd/bootstrap/utils"
76
"github.com/onflow/flow-go/crypto/hash"
7+
8+
"github.com/onflow/flow-go/cmd/bootstrap/utils"
89
"github.com/onflow/flow-go/model/flow/order"
910

1011
"github.com/onflow/flow-go/crypto"
12+
1113
model "github.com/onflow/flow-go/model/bootstrap"
1214
"github.com/onflow/flow-go/model/encodable"
1315
"github.com/onflow/flow-go/model/flow"
@@ -27,14 +29,14 @@ func genNetworkAndStakingKeys() []model.NodeInfo {
2729
log.Debug().Msg("all node addresses are unique")
2830

2931
log.Debug().Msgf("will generate %v networking keys for nodes in config", nodes)
30-
networkKeys, err := utils.GenerateNetworkingKeys(nodes, GenerateRandomSeeds(nodes, crypto.KeyGenSeedMinLenECDSAP256))
32+
networkKeys, err := utils.GenerateNetworkingKeys(nodes, GenerateRandomSeeds(nodes, crypto.KeyGenSeedMinLen))
3133
if err != nil {
3234
log.Fatal().Err(err).Msg("cannot generate networking keys")
3335
}
3436
log.Info().Msgf("generated %v networking keys for nodes in config", nodes)
3537

3638
log.Debug().Msgf("will generate %v staking keys for nodes in config", nodes)
37-
stakingKeys, err := utils.GenerateStakingKeys(nodes, GenerateRandomSeeds(nodes, crypto.KeyGenSeedMinLenBLSBLS12381))
39+
stakingKeys, err := utils.GenerateStakingKeys(nodes, GenerateRandomSeeds(nodes, crypto.KeyGenSeedMinLen))
3840
if err != nil {
3941
log.Fatal().Err(err).Msg("cannot generate staking keys")
4042
}

0 commit comments

Comments
 (0)