Open jferrant opened 11 months ago
Reviewing here for my own sake, "The StackerDB contract is read and loaded to each stacks node once at the start of a reward cycle" reads to me that each node loads a new StackerDB boot contract near the end of ever cycle.
Is that right? Or should we have a persistent StackerDB contract that is instead updated through a privileged contract such as PoX-4?
Reviewing here for my own sake, "The StackerDB contract is read and loaded to each stacks node once at the start of a reward cycle" reads to me that each node loads a new StackerDB boot contract near the end of ever cycle.
Is that right? Or should we have a persistent StackerDB contract that is instead updated through a privileged contract such as PoX-4?
This means there is one persistent StackerDB contract that is updated through a privileged contract. It just means that the stacks nodes that have their databases running will at the start of every reward cycle make a read only contract call to the persistent stackers-signers-stacker-db contract and load the updated info.
Latest update on #3977
Latest update here: https://github.com/stacks-network/stacks-blockchain/tree/add-storage-contracts
Focus has been on getting DR over the finish line, looping back next week.
Periodically reviewing w/ Jacinta & Sayak.
PR #4007 in stacks-blockchain now a WIP version of this.
For signers to communicate with each other, they need to have access to a deployed stacker db contract.
A stackerdb contract must contain the following two functions (update accordingly):
The stackerdb contract is read and loaded to each stacks node once at the start of a reward cycle.
The signer's stackerdb would be partitioned into two sets of slots: one for the current stackers, and a corresponding one for the new stackers. Which partition a stacker gets assigned to would be a function of reward cycle count. For example, if the reward cycle is even, the current stackers use the first partition and the new stackers use the second partition. But if it's odd, then the current stackers would use the second partition and the new stackers would use the first.
As the signer stackerdb contract config is only read and loaded into a stacks node once per reward cycle, the new set of stackers for reward cycle N + 1 MUST overwrite the stackers N - 1 PRIOR to the end of reward cycle N so that at the START of reward cycle N+1, the contract contains the stackers N and stackers N+1.
Related to https://github.com/stacks-network/stacks-blockchain/issues/3948