snarkOS icon indicating copy to clipboard operation
snarkOS copied to clipboard

[HackerOne-2452182] Store `Proposal` and `SignedProposals` to disk and remove proposal expiration

Open raychu86 opened this issue 1 year ago • 0 comments

Motivation

This PR has two changes to address https://github.com/AleoHQ/snarkOS/issues/3171:

  1. Reverted proposal expiration introduced in https://github.com/AleoHQ/snarkOS/pull/3202.

    • This approach was unsafe because it violated the non-equivocation properties of our BFT protocol.
    • A community member @ghostant-1017 also highlighted this issue in a bug bounty finding [HackerOne-2452182].
  2. The ProposalCache (pending Proposal and SignedProposals) will be stored to a file on shutdown, loaded on bootup, and cleared with snarkos clean.

    • Ensures that honest validators do not create multiple proposals on the same round
    • Ensures that we do not sign additional validator proposals on the same round after a reboot.

Implications

  • If enough (a majority) of validators reboot their nodes at the same time, there could be a halting case.

    • If we signed proposals past our ledger round, but all nodes have thrown away their Storage, then we won't have the signatures required to reconstruct the original proposal state.
    • This will need to be remedied by having all validators delete their proposal_cache file and reboot.
  • Validators looking to swap machines will need to migrate their proposal_cache file between machines to ensure honest behavior.

Test Plan

Extensive local and burn-in testing will need to be performed.

Related PRs

Reverts: https://github.com/AleoHQ/snarkOS/pull/3202. An extension of: https://github.com/AleoHQ/snarkOS/pull/3200

TODO

  • [ ] Add unit tests for serialization
  • [ ] Add unit tests to ensure the enforcement properties with the new stored proposal.
  • [ ] Consider adding new log messages to inform validators of the importance of the storage.

raychu86 avatar Apr 30 '24 21:04 raychu86