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

[Tech Debt] Allow nodes to rejoin by saving index and config #2168

Merged
merged 6 commits into from
Dec 9, 2023

Conversation

rob-maron
Copy link
Collaborator

@rob-maron rob-maron commented Dec 5, 2023

Closes #2135

This PR:

Allows nodes to rejoin consensus after stopping and dropping off completely.

  • Adds from_file and to_file to the NetworkConfig implementation
  • Adds from_file_or_orchestrator to the above implementation, which takes an orchestrator client and returns both the configuration and the source (so we don't make the Ready call to the orchestrator every time)
  • Cleans up a lot of OrchestratorClient code

There are also some unrelated changes that make running the examples easier.

This PR does not:

  • Edit any example functionality
  • Add a default config file for examples that run the orchestrator, webserver, and nodes (all_xxxx)

Key places to review:

  • config.rs - the NetworkConfig implementations
  • examples/mod.rs - for how we use the new NetworkConfig API in our examples

@rob-maron rob-maron requested review from sveitser and jbearer and removed request for sveitser and jbearer December 5, 2023 23:40
@rob-maron rob-maron marked this pull request as ready for review December 6, 2023 13:01
@rob-maron rob-maron marked this pull request as draft December 6, 2023 13:02
@rob-maron rob-maron marked this pull request as ready for review December 6, 2023 15:34
@rob-maron rob-maron marked this pull request as draft December 7, 2023 21:35
dailinsubjam
dailinsubjam previously approved these changes Dec 8, 2023
Copy link
Contributor

@dailinsubjam dailinsubjam left a comment

Choose a reason for hiding this comment

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

LGTM!

crates/orchestrator/src/config.rs Show resolved Hide resolved
Copy link
Member

@shenkeyao shenkeyao left a comment

Choose a reason for hiding this comment

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

LGTM, just a few minor comments.

crates/hotshot/examples/combined/multi-validator.rs Outdated Show resolved Hide resolved
crates/hotshot/examples/webserver/multi-validator.rs Outdated Show resolved Hide resolved
crates/orchestrator/src/config.rs Show resolved Hide resolved
crates/hotshot/examples/libp2p/multi-validator.rs Outdated Show resolved Hide resolved
Copy link
Member

@shenkeyao shenkeyao left a comment

Choose a reason for hiding this comment

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

LGTM!

@rob-maron rob-maron merged commit 2d46f02 into main Dec 9, 2023
6 of 8 checks passed
@rob-maron rob-maron deleted the rm/node-config-rejoin branch December 9, 2023 02:30
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.

[TECH-DEBT] - Allow nodes to fully stop, lose all memory state, restart, and properly rejoin the network
3 participants