stacks-network / stacks-core

The Stacks blockchain implementation
https://docs.stacks.co
GNU General Public License v3.0
3k stars 658 forks source link

Integrate signer sortition state tracking into the signer binary #4880

Open kantai opened 2 weeks ago

kantai commented 2 weeks ago

Signer sortition state tracking was implemented in:

https://github.com/stacks-network/stacks-core/pull/4801

But it wasn't integrated into the signer binary yet.

The signer runloop should integrate this by holding a SortitionsView option in the RunLoop struct. Integration should be fairly straight forward -- I think roughly:

  1. Add the sortition_state: Option<SortitionsView> field to RunLoop
  2. On receiving a block proposal, if sortitions_view is None, reload it via fetch_view(). Then invoke check_proposal (in addition to the existing checks).
  3. On receiving a burn block event, set sortitions_view to None.