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

bugfix : Removed the default value of the bootnode flag to prevent it from being overridden during testnet usage #14357

Merged
merged 2 commits into from
Aug 23, 2024

Conversation

gts2030
Copy link
Contributor

@gts2030 gts2030 commented Aug 17, 2024

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?
By #11166, this fix made bug to always load mainnet bootnodes when just using testnet flags like --Holesky.
In configureBeacon() at beacon-chain/node/node.go it first initialize testnet network config by ConfigureBeaconChain() -> configureTestnet().
Than it always overrides beaconchain network config bootnodes value as a mainnet bootnodes(which is default value for bootstrap-node flag) in configureNetwork() because len(cmd.BootstrapNode.Name) is always >1.
So this default value for bootstrap-node flag should be removed to run testnet beacon node with just testnet flag.
And also removing this default value doesn't disturb using mainnet flag usage.

@gts2030 gts2030 requested a review from a team as a code owner August 17, 2024 14:27
@CLAassistant
Copy link

CLAassistant commented Aug 17, 2024

CLA assistant check
All committers have signed the CLA.

@gts2030 gts2030 changed the title Removed the default value of the bootnode flag to prevent it from being overridden during testnet usage bugfix : Removed the default value of the bootnode flag to prevent it from being overridden during testnet usage Aug 17, 2024
cmd/flags.go Outdated
@@ -101,7 +100,6 @@ var (
BootstrapNode = &cli.StringSliceFlag{
Name: "bootstrap-node",
Usage: "The address of bootstrap node. Beacon node will connect for peer discovery via DHT. Multiple nodes can be passed by using the flag multiple times but not comma-separated. You can also pass YAML files containing multiple nodes.",
Value: cli.NewStringSlice(params.BeaconNetworkConfig().BootstrapNodes...),
Copy link
Contributor

Choose a reason for hiding this comment

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

We should instead just change to if cliCtx.IsSet(cmd.BootstrapNode.Name) { instead of len(cliCtx.StringSlice(cmd.BootstrapNode.Name)) > 0 now that the library is fixed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh that's a good news. Than I will fix it to use IsSet() instead of removing default value from flag.

@james-prysm
Copy link
Contributor

thanks for the submission left a comment

@james-prysm james-prysm added the Bug Something isn't working label Aug 20, 2024
@gts2030 gts2030 requested a review from james-prysm August 21, 2024 06:10
@gts2030
Copy link
Contributor Author

gts2030 commented Aug 21, 2024

Bugfix to revert changes from #11166 because library is fixed now.
Tested to use only testnet flag to connect to testnet bootnode done.

@gts2030 gts2030 force-pushed the fix-bootnode-flag branch from d2e3203 to 7bcd780 Compare August 21, 2024 06:16
@james-prysm james-prysm enabled auto-merge August 22, 2024 02:46
auto-merge was automatically disabled August 22, 2024 16:00

Head branch was pushed to by a user without write access

@gts2030 gts2030 force-pushed the fix-bootnode-flag branch from 2615be5 to 82cd079 Compare August 22, 2024 16:00
@prestonvanloon prestonvanloon added this pull request to the merge queue Aug 22, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 22, 2024
@prestonvanloon prestonvanloon added this pull request to the merge queue Aug 23, 2024
Merged via the queue into prysmaticlabs:develop with commit 50e5326 Aug 23, 2024
16 of 17 checks passed
james-prysm pushed a commit that referenced this pull request Sep 6, 2024
… from being overridden during testnet usage (#14357)

* Removed the default value of the bootnode flag to prevent it from being overridden during testnet usage

* bugfix for checking stringslice flag to use isSet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants