Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding an option to boostrapcmd to pull candidate access nodes in addition to proposed nodes #6489

Merged
merged 2 commits into from
Sep 23, 2024

Conversation

vishalchangrani
Copy link
Contributor

@vishalchangrani vishalchangrani commented Sep 21, 2024

The bootstrapcmd is used to download all the partner node info during a network upgrade. It downloads all the nodes in the proposed table.
For the upcoming mainnet upgrade, the access nodes that have staked but have not yet been chosen and included in the proposed table must also be included. They are in the candidate table.
This PR adds an option to the bootstrap command to include those candidate access nodes.

Before we would run:

./bootstrapcmd populate-partner-infos \
--access-address=access.mainnet.nodes.onflow.org:9000 \
--network=mainnet \
--outdir=./bootstrap/mainnet25-partners

With this change we would run the same command with the additional flag include-candidate-access-nodes,

./bootstrapcmd populate-partner-infos \
--access-address=access.mainnet.nodes.onflow.org:9000 \
--network=mainnet \
--outdir=./bootstrap/mainnet25-partners \
--include-candidate-access-nodes=true

Example Output by running the command without the flag: Total partner nodes = 359

<nil> INF total nodes in proposed table total_proposed_nodes=459
<nil> INF wrote file /tmp/bootstraptest/mainnet25-partners/public-root-information/node-info.pub.61ab46c9e1421eedbfeebf2f9abafc183ed664d6a094b74b923986fbec9e76fd.json
...
...
<nil> INF wrote file /tmp/bootstraptest/mainnet25-partners/partner-weights.json
Total number of flow nodes (skipped): 100
Total number of partner nodes: 359
Number of partner nodes by role:        verification : 48       access : 179    collection : 57 consensus : 70  execution : 5

Example Output by running the command with the flag: Total partner nodes = 359 proposed + 5 candidate = 364

<nil> INF total nodes in proposed table total_proposed_nodes=459
<nil> INF total access nodes in candidate table total_candidate_access_nodes=5
<nil> INF wrote file /tmp/bootstraptest2/mainnet25-partners/public-root-information/node-info.pub.61ab46c9e1421eedbfeebf2f9abafc183ed664d6a094b74b923986fbec9e76fd.json
...
...
<nil> INF wrote file /tmp/bootstraptest2/mainnet25-partners/partner-weights.json
Total number of flow nodes (skipped): 100
Total number of partner nodes: 364
Number of partner nodes by role:        verification : 48       access : 184    collection : 57 consensus : 70  execution : 5

import FlowIDTableStaking from "FlowIDTableStaking"
access(all) fun main(): [FlowIDTableStaking.NodeInfo] {
let candidateNodes = FlowIDTableStaking.getCandidateNodeList()
let candidateAccessNodes = candidateNodes[UInt8(5)]!
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this statement filters out all nodes except the Access node (type 5)

@codecov-commenter
Copy link

codecov-commenter commented Sep 21, 2024

Codecov Report

Attention: Patch coverage is 3.70370% with 26 lines in your changes missing coverage. Please review.

Project coverage is 41.35%. Comparing base (62de9f2) to head (2db29f6).

Files with missing lines Patch % Lines
cmd/bootstrap/cmd/partner_infos.go 5.26% 18 Missing ⚠️
cmd/util/cmd/common/transactions.go 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            v0.37    #6489      +/-   ##
==========================================
- Coverage   41.44%   41.35%   -0.10%     
==========================================
  Files        2017     2009       -8     
  Lines      144049   143695     -354     
==========================================
- Hits        59706    59419     -287     
+ Misses      78138    78081      -57     
+ Partials     6205     6195      -10     
Flag Coverage Δ
unittests 41.35% <3.70%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vishalchangrani vishalchangrani merged commit d5206ed into v0.37 Sep 23, 2024
54 of 55 checks passed
@vishalchangrani vishalchangrani deleted the vishal/v0_37_bootstrapcmd branch September 23, 2024 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants