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

test: Spawn the next leader first #425

Merged

Conversation

youngjoon-lee
Copy link
Contributor

@youngjoon-lee youngjoon-lee commented Sep 20, 2023

Solves the second bullet of #415 (comment).

Still the ten_nodes_happy won't pass, like below. To resolve this, I'm going to open another PR.

waiting... 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0
waiting... 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0
waiting... 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0
...

// all nodes that will be subsequently spawned.
// If not, the leader will miss votes from nodes spawned before itself.
// This issue will be resolved by devising the block catch-up mechanism in the future
let mut nodes = vec![Self::spawn(configs.swap_remove(next_leader_idx)).await];
let listening_addr = nodes[0].get_listening_address().await;
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be nodes[next_leader_idx].get_listening_address() if we want next leader to be available to other nodes before spawning (as initial_peer)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the nodes vector has only one element at line 211~212, we should use nodes[0] (which is the next leader spawned at line 211). But yeah, it's little not intuitive. Let me refactor this now.

Copy link
Member

Choose a reason for hiding this comment

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

Okay, now I see, we append to the nodes array.

// all nodes that will be subsequently spawned.
// If not, the leader will miss votes from nodes spawned before itself.
// This issue will be resolved by devising the block catch-up mechanism in the future
let mut nodes = vec![Self::spawn(configs.swap_remove(next_leader_idx)).await];
let listening_addr = nodes[0].get_listening_address().await;
Copy link
Member

Choose a reason for hiding this comment

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

Okay, now I see, we append to the nodes array.

@youngjoon-lee youngjoon-lee merged commit f57bfc8 into nomos-node-tree-overlay Sep 21, 2023
13 checks passed
@youngjoon-lee youngjoon-lee deleted the nomos-node-tree-overlay-first-node branch September 21, 2023 02:51
bacv added a commit that referenced this pull request Oct 5, 2023
* Use tree overlay in nomos node

* Use tree overlay in tests module

* Handle unexpected consensus vote stream end in tally

* Spawn the next leader first (#425)

* Report unhappy blocks in happy path test (#430)

* report unhappy blocks in the happy path test

* Make threshold configurable for TreeOverlay (#426)

* Modified test, so that all nodes don’t all connect to the first node only (#442)

* merge fix

---------

Co-authored-by: Youngjoon Lee <taxihighway@gmail.com>
Co-authored-by: Al Liu <scygliu1@gmail.com>
bacv added a commit that referenced this pull request Oct 5, 2023
* Use tree overlay in nomos node

* Use tree overlay in tests module

* Handle unexpected consensus vote stream end in tally

* Add defaults for retry and delay in mixnet client

* Add missing entries in config.yaml

* Spawn the next leader first (#425)

---------

Co-authored-by: Youngjoon Lee <taxihighway@gmail.com>
Co-authored-by: Al Liu <scygliu1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants