Conversation
68e8742 to
7b9c19c
Compare
cda7321 to
576ec48
Compare
| if let Some(dev) = self.dev { | ||
| // Add the dev nodes to the trusted peers. | ||
| if trusted_peers.is_empty() { | ||
| for i in 0..dev { |
There was a problem hiding this comment.
Should this only be done for clients? Validators shouldn't need to add other validators as trusted peers
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
I changed the defaults so my most common workflow just requires only pressing Enter.
Closes: #3986