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

Store batch proposal to disk on shutdown #3200

Closed

Conversation

ljedrz
Copy link
Collaborator

@ljedrz ljedrz commented Apr 2, 2024

This PR persists the current batch proposal to the disk on shutdown, and loads it on startup when available, deleting it afterwards.

Filing as a draft until it's sufficiently tested.

Closes https://github.com/AleoHQ/snarkOS/issues/3171.

@ljedrz
Copy link
Collaborator Author

ljedrz commented Apr 2, 2024

Some open questions:

  • should we distinguish between production and dev modes?
  • should we consider the network IDs?
  • should the creation of the file path be dedicated to a function to deduplicate code a little bit?

@raychu86
Copy link
Contributor

raychu86 commented Apr 2, 2024

The file path should definitely be differentiated by dev_mode and network ID. Especially in the case of local devnets being run.

In addition, snarkos clean should also remove these files.

@ljedrz
Copy link
Collaborator Author

ljedrz commented Apr 2, 2024

Addressed the points in the previous comment.

@raychu86
Copy link
Contributor

raychu86 commented Apr 3, 2024

This logic may need to be more comprehensive:

Given a scenario where the latest block is at round 50:

  1. A node shuts down and stores its proposal at round 52 (before committing a new block).

  2. On bootup the node will sync up with the ledger blocks and advance storage to round 50.

  3. Then the node will try to load the proposal for round 52, but won't have the certificates in Storage to properly advance to round 52. Nor will it have the certificates used to create the proposal in round 52.

    • The node will need to request the certificates for round 51 from its peers and properly advance to round 52.

Signed-off-by: ljedrz <ljedrz@gmail.com>
@ljedrz
Copy link
Collaborator Author

ljedrz commented Apr 8, 2024

Rebased.

@raychu86
Copy link
Contributor

raychu86 commented May 3, 2024

Closing in favor of https://github.com/AleoHQ/snarkOS/pull/3239

@raychu86 raychu86 closed this May 3, 2024
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.

[Feature] Store batch proposal to disk on shutdown
2 participants