-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
Swarm config refactoring #12117
Swarm config refactoring #12117
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
121f989
to
0a8bef8
Compare
0a8bef8
to
ca1566a
Compare
ca1566a
to
46da9c8
Compare
46da9c8
to
ec63ea3
Compare
// Converts a /ip{4,6}/-/tcp/-[/-] Multiaddr to SocketAddr. | ||
// Useful when an external library only accepts SocketAddr, e.g. to start a local server. | ||
// See `client::endpoint_from_multiaddr()` for converting to Endpoint for clients. | ||
pub fn to_socket_addr(&self) -> Result<SocketAddr> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-functional-change
/// Get a list of nodes that we don't want to kill in the crash recovery tests. | ||
/// This includes the client node which is the node that is running the test, as well as | ||
/// rpc fullnode which are needed to run the benchmark. | ||
fn get_keep_alive_nodes(cluster: &TestCluster) -> HashSet<sui_simulator::task::NodeId> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is added such that crash recovery tests don't kill the rpc fullnode
@@ -0,0 +1,140 @@ | |||
// Copyright (c) Mysten Labs, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a rename of utils.rs, but also with consolidated ip management for both simtest and non-simtest
genesis_config: Option<GenesisConfig>, | ||
reference_gas_price: Option<u64>, | ||
additional_objects: Vec<Object>, | ||
with_swarm: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of fields are deleted since they are never needed
ec63ea3
to
d4438e5
Compare
d4438e5
to
88f37e5
Compare
88f37e5
to
68e6b67
Compare
68e6b67
to
1f9e8fa
Compare
fn get_key_path(key_pair: &AuthorityKeyPair) -> String { | ||
let public_key: AuthorityPublicKeyBytes = key_pair.public().into(); | ||
let mut key_path = Hex::encode(public_key); | ||
key_path.truncate(12); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: make this 12 a constant? or comment what it is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied this from old code. It's just to name the directory name of the validator using validator's public key, but make it shorter
SocketAddr::V4(v4) => format!("/ip4/{}/udp/{}", v4.ip(), v4.port()), | ||
SocketAddr::V6(v6) => format!("/ip6/{}/udp/{}", v6.ip(), v6.port()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intended to only be used for udp addresses and not tcp ones?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is out-of-dated code, removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some small comments - LGTM otherwise
|
||
pub async fn spawn_new_fullnode(&mut self, config: NodeConfig) -> SuiNodeHandle { | ||
let name = config.protocol_public_key(); | ||
let node = Node::new(config); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be great if we could add something to the name of the fullnode nodes so that they can be distinguished from validators in the logs
1f9e8fa
to
25b48bd
Compare
25b48bd
to
8169ced
Compare
This PR does a series of refactoring on how we construct node config and swarm configs to make it cleaner:
This this PR, we should be able to start removing all the code that spawns individual nodes instead of inside a container.