-
Notifications
You must be signed in to change notification settings - Fork 26
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
explicitly define a network topology #199
base: master
Are you sure you want to change the base?
Conversation
* allow arbitrary config from values.yaml to be set in the node. This allow for setting private mode from values.yaml and this setting is transparently passed to the node config * do not fail silently when generate-config.py crashes * scour both regular and baking nodes for bootstrap nodes in wait-for-bootstrap. If you have only non-baking bootstrap nodes, the init script would otherwise fail.
Whatever the structure or concept |
These are not trusted peers, these are links between 2 nodes. We already have |
Why need a standalone list of node links? With Roland's restructuring of the nodes:
tezos-baking-node:
instances:
- bake_using_accounts:
- tezos-baking-node-0
config:
shell:
history_mode: archive
p2p:
private-mode: true
is_bootstrap_node: true
links:
- tezos-node-0
- tezos-node-1
- tezos-baking-node-1
- bake_using_accounts:
- tezos-baking-node-1
config:
shell:
history_mode: archive
is_bootstrap_node: true
links:
- tezos-node-0
- tezos-node-1
runs:
- baker
- endorser
storage_size: 15Gi
...... This centralizes the node's links inside the node itself. You don't need an explicit 2 way mapping from the instanceA to instanceB as the links are being defined in instanceA. Also, I don't think one should need to specify the FQDN of each node. Why can't the code handle that for the user? All you need is the name of the node itself. Personally I still think we need a better name than (The former names suggestion is in imperative/verb form. The latter names suggestion is in active/descriptive form. The reason I am making this grammatical distinction is because I just realized that we haven't been consistent with these forms in our structures. Examples being |
Can we update the name of this PR? Private mode is already supported as you can pass whatever config you want to a node. The PR's main feature is being able to explicitly define a network topology. |
I agree with replacing the fqdns with just the hostnames. Also replacing I think defining links separately from nodes is cleaner. I briefly searched for reasons why and came across this: https://stackoverflow.com/questions/43052290/representing-a-graph-in-json |
I think it would be really cool to define topology in dot format (https://graphviz.org/) instead of a custom syntax - it could then be immediately visualized and compared with actual topology reported by https://github.com/oxheadalpha/tezos-net-viz |
Does the link array structure imply that it is non-directed and therefore If the former then I understand why a separate structure makes sense, as you wouldn't want to define the edge in each node instance. You only want to define the edge once. If we really do require a separate structure and we are talking about DAGs, why not have a map of all the nodes, where each node has a list of every other node they point to? Why should each element in the list be a pair instead of a list of nodes? The SO question you referenced is talking about a DAG. However, the DAG the user is talking about is more complicated than our use case here. His use case requires that the nodes and edges each have associated data. So the DAG representation is more complicated. We don't need that. Just a string being the hostname of a node pointing to another hostname string. Here is a SO question about DAGs in json that is just like our use case: https://stackoverflow.com/a/9899057/6379084 |
Add an ability to explicitly link nodes.
links
value is a list of 2-item lists.This will allow testing of large topologies where we define the graph fully and prevent arbitrary peering. This way, we can enforce number of hops between nodes and more efficiently detect regressions in block propagation times.
Configuration example:
When
private_mode
is set to "true", none of the bootstrap peers from the usual sources is configured in the node. Instead, only the links listed explicitly are configured.Previously I found that private-private node connections did not work. But today, I found that it was actually working in my topology, but not reliably.
We may want to configure trusted relationship between nodes to make sure connections get established reliably.After talking to devs, the trust is implicit when putting a peer inp2p.bootstrap-peers
so it may be a bug. With the example topology above, I expect every node to have 3 peers, but in practice, they can have anything between 0 and 3.