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

Make bootstrap peers consistent across bootstrap and network #2320

Closed
AureliaDolo opened this issue Feb 21, 2022 · 3 comments
Closed

Make bootstrap peers consistent across bootstrap and network #2320

AureliaDolo opened this issue Feb 21, 2022 · 3 comments
Labels
bootstrap Issues related to the bootstrap enhancement New feature or request good first issue Good for newcomers

Comments

@AureliaDolo
Copy link
Contributor

AureliaDolo commented Feb 21, 2022

A peer in the bootstrap_peers list in the config is not considered as bootstrap unless it is also marked as bootstrap in peers.json

My idea to tackle that was to have in the GlobalBootstrapState returned by get_state instead of

pub struct GlobalBootstrapState {
    pub peers: Option<BootstrapPeers>,
    ..
}

have something like

pub struct GlobalBootstrapState {
    pub peers: Option<BootstrapPeers>,
    pub bootstrap_peers: Vec<IpAddr>, // peers in the BootstrapSettings.bootstrap_list
    ..
}

or

pub struct GlobalBootstrapState {
    pub peers: Vec<(IpAddr, bool)>, // true if ip in the BootstrapSettings.bootstrap_list
    ..
}

where in network worker

pub struct BootstrapPeers(pub Vec<IpAddr>);

And make sure that these peers are returned even if we don't need to bootstrap.

@AureliaDolo AureliaDolo added bootstrap Issues related to the bootstrap enhancement New feature or request good first issue Good for newcomers refactoring labels Feb 21, 2022
@AureliaDolo
Copy link
Contributor Author

I have some preference for the second option

bors bot added a commit that referenced this issue Mar 9, 2022
2324: Harmonize bootstrap bootsrap peers and network bootstrap peers. r=yvan-sraka a=AureliaDolo

Fix #2320 

Co-authored-by: Aurelia <adolo@massa.network>
@damip
Copy link
Member

damip commented Mar 22, 2022

Protocol peers are conceptually different from bootstrap nodes, that's why we keep them separate.

A bootstrap node can be bootstrap-only (and not be a protocol peer), can be both on different IPs etc... and a "peer that does bootstrap" can also be there just to seed peer lists without ever doing actual bootstrapping.

To me, this distinction should be kept, and this PR tends to mix things together, reducing flexibility.

@AureliaDolo
Copy link
Contributor Author

Protocol peers are conceptually different from bootstrap nodes, that's why we keep them separate.

A bootstrap node can be bootstrap-only (and not be a protocol peer), can be both on different IPs etc... and a "peer that does bootstrap" can also be there just to seed peer lists without ever doing actual bootstrapping.

To me, this distinction should be kept, and this PR tends to mix things together, reducing flexibility.

Ok I close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bootstrap Issues related to the bootstrap enhancement New feature or request good first issue Good for newcomers
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants