Skip to content

Bootstrap weights in plain text#4703

Merged
pwojcikdev merged 8 commits intonanocurrency:developfrom
RickiNano:bootstrap-weights
Oct 29, 2024
Merged

Bootstrap weights in plain text#4703
pwojcikdev merged 8 commits intonanocurrency:developfrom
RickiNano:bootstrap-weights

Conversation

@RickiNano
Copy link
Copy Markdown
Contributor

Replaces the binary file with embedded bootstrap weight in plain text.
The weight values and max block counts in this PR are from 14-08-2024

@pwojcikdev
Copy link
Copy Markdown
Contributor

We also need the script you used to generate bootstrap_weights_live.hpp and bootstrap_weights_beta.hpp. It would be better to place the globals in a namespace nano::weights and a separate weights library.

@RickiNano
Copy link
Copy Markdown
Contributor Author

@pwojcikdev
I have added the script for generating the bootstrap weights data.
I tried updating the namespace but I get some weird build errors. Probably just me lacking the knowledge to do this correctly. Could you change it for me?

@RickiNano
Copy link
Copy Markdown
Contributor Author

I think I got the namespace change working now

@RickiNano
Copy link
Copy Markdown
Contributor Author

Rebased on top of develop 25-10-2024

@gr0vity-dev-bot
Copy link
Copy Markdown

gr0vity-dev-bot commented Oct 25, 2024

Test Results for Commit c09e95b

Pull Request 4703: Results
Overall Status:

Test Case Results

  • 5n4pr_conf_10k_bintree: PASS (Duration: 123s)
  • 5n4pr_conf_10k_change: PASS (Duration: 218s)
  • 5n4pr_conf_change_dependant: PASS (Duration: 138s)
  • 5n4pr_conf_change_independant: PASS (Duration: 142s)
  • 5n4pr_conf_send_dependant: PASS (Duration: 133s)
  • 5n4pr_conf_send_independant: PASS (Duration: 154s)
  • 5n4pr_rocks_10k_bintree: PASS (Duration: 126s)
  • 5n4pr_rocks_10k_change: PASS (Duration: 215s)

Last updated: 2024-10-26 13:31:24 UTC

@pwojcikdev
Copy link
Copy Markdown
Contributor

The biggest issue I can see with this is that it introduces create_weights_file node option, which requires node shutdown and restart to generate weights. This might not be that big deal, but why do this at all when there is already a nice record_rep_weights.py script that can pull weights from any node via rpc, so it doesn't require full ssh access or node restarts.

@RickiNano
Copy link
Copy Markdown
Contributor Author

@pwojcikdev
The create_weights_file option is meant to be used by us developers just once for each node release to update the embedded weights before the node version is shipped. This can be done on any node that is up to date.
It addresses issue #4702 that is part of the V28 milestones
I wouldn't mind taking the responsibility of updating the weights for both live and beta before releases.

@pwojcikdev
Copy link
Copy Markdown
Contributor

Okay, but why change this at all when working and maintaining the python file was strictly easier and more ergonomic?

@RickiNano
Copy link
Copy Markdown
Contributor Author

I can look into converting the existing python script so that it creates the weights as text files. I'm not a Python guy though.

@RickiNano
Copy link
Copy Markdown
Contributor Author

I have removed the create_weights_file option and modified the python script. Turned out that it was super easy to do even though I had no experience with Python.
The python script now takes a network name as input and creates the complete bootstrap_weights_live.hpp or bootstrap_weights_beta.hpp file that can overwrite the existing file.
I also updated the current bootstrap_weights_live.hpp and bootstrap_weights_beta.hpp with the python created ones.

pwojcikdev
pwojcikdev previously approved these changes Oct 28, 2024
Copy link
Copy Markdown
Contributor

@pwojcikdev pwojcikdev left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for modifying the script, this will make maintenance easier in the future

@pwojcikdev pwojcikdev merged commit 6fad597 into nanocurrency:develop Oct 29, 2024
@qwahzi qwahzi added this to the V28 milestone Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged / V28.0

Development

Successfully merging this pull request may close these issues.

4 participants