Skip to content

Clean up devnet script and default peering#3990

Open
vicsn wants to merge 7 commits intostagingfrom
clean_devnet_script
Open

Clean up devnet script and default peering#3990
vicsn wants to merge 7 commits intostagingfrom
clean_devnet_script

Conversation

@vicsn
Copy link
Collaborator

@vicsn vicsn commented Nov 3, 2025

I changed the defaults so my most common workflow just requires only pressing Enter.

Closes: #3986

@vicsn vicsn requested a review from ljedrz November 3, 2025 12:53
ljedrz
ljedrz previously approved these changes Nov 3, 2025
@vicsn vicsn force-pushed the disallow_unknown_peers_as_validator branch 2 times, most recently from 68e8742 to 7b9c19c Compare November 4, 2025 10:51
@vicsn vicsn force-pushed the clean_devnet_script branch from cda7321 to 576ec48 Compare November 4, 2025 12:52
@vicsn vicsn changed the base branch from disallow_unknown_peers_as_validator to staging November 4, 2025 12:52
@vicsn vicsn dismissed ljedrz’s stale review November 4, 2025 12:52

The base branch was changed.

@vicsn vicsn requested a review from kaimast November 4, 2025 12:53
@vicsn vicsn changed the title Clean up devnet script Clean up devnet script and default peering Nov 6, 2025
if let Some(dev) = self.dev {
// Add the dev nodes to the trusted peers.
if trusted_peers.is_empty() {
for i in 0..dev {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this only be done for clients? Validators shouldn't need to add other validators as trusted peers

Copy link
Contributor

Choose a reason for hiding this comment

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

I also wonder if it would be better to just set the trusted peers from the devnet script instead of having some custom logic in the CLI.
For example, only the devnet script knows how many clients they are and which validators they will/should connect to.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will answer later:

Don't both nodes have to add each other as trusted peers to connect? Shouldn't validators have a list of trusted clients passed to them?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should this only be done for clients? Validators shouldn't need to add other validators as trusted peers

It's not very useful except for earlier transmission propagation, but it doesn't hurt either.

I also wonder if it would be better to just set the trusted peers from the devnet script instead of having some custom logic in the CLI.

Indeed that would be better, but this is out of scope and low priority for me.

Don't both nodes have to add each other as trusted peers to connect? Shouldn't validators have a list of trusted clients passed to them?

For validators both sides have to trust each other, a client will accept connections from anyone.

Copy link
Contributor

Choose a reason for hiding this comment

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

For validators both sides have to trust each other, a client will accept connections from anyone.

But then isn't this code incorrect? Each node only adds nodes with an index lower than their current index as trusted. That means validators only add other validators as trusted, but not any clients.

We could also just allow external connections for validators in dev mode and avoid all this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I changed it to for i in 0..num_validators, not 0..i.

We could also just allow external connections for validators in dev mode and avoid all this?

We could, but is out of scope.

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.

[Bug] Devnet script has problems with larger sets of validators.

3 participants