Keep pending actions in actionQueue #7102
Labels
cosmic-swingset
package: cosmic-swingset
enhancement
New feature or request
vaults_triage
DO NOT USE
Milestone
What is the Problem Being Solved?
For #3769, we're replicating the swingset side of the swingstore in vstorage. However we have host data in the swingstore as well, that is not part of the export mechanism (see #6773). Most of this data is there for handling hangover inconsistency, which doesn't apply to state-sync and can be restored, or initialized to default values. However the inbound queue (#6221) is currently stored in the host section of the swingstore, which wouldn't be exported or restored.
One advantage of the inbound queue living in swingstore is that we can keep processing entries between blocks (#6741), which wouldn't be possible if entries stayed in vstorage.
The inbound queue is populated by consuming all entries of the action queue at the beginning of the block, and pushing them onto the inbound queue. The inbound queue also annotates the actions with an identifier composed of the blockHeight and an index in that block (
inboundNum
).Description of the Design
Keep pending actions in the actionQueue, but replicate them into the swingstore. For execution (including between blocks), keep processing elements from the swingstore queue. At end block synchronize the consumption into the action queue (update the head).
The consumption needs to be careful not to delete the tail pointer as cosmos may push more information into the action queue.
To avoid the queue forever growing, cosmos can reset the queue if after endblock it's empty (question of consistency with swingstore queue?)
State-sync restore would simply replicate the action queue back into the swingstore. A question remains on how to regenerate the inboundNum.
Security Considerations
Scaling Considerations
Test Plan
The text was updated successfully, but these errors were encountered: