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

Keep pending actions in actionQueue #7102

Closed
mhofman opened this issue Mar 1, 2023 · 0 comments · Fixed by #7115
Closed

Keep pending actions in actionQueue #7102

mhofman opened this issue Mar 1, 2023 · 0 comments · Fixed by #7115
Assignees
Labels
cosmic-swingset package: cosmic-swingset enhancement New feature or request vaults_triage DO NOT USE
Milestone

Comments

@mhofman
Copy link
Member

mhofman commented Mar 1, 2023

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

@mhofman mhofman added enhancement New feature or request cosmic-swingset package: cosmic-swingset labels Mar 1, 2023
@mhofman mhofman self-assigned this Mar 1, 2023
@mhofman mhofman changed the title Keep keep pending actions in actionQueue Keep pending actions in actionQueue Mar 1, 2023
@ivanlei ivanlei added this to the Vaults EVP milestone Mar 2, 2023
@ivanlei ivanlei added the vaults_triage DO NOT USE label Mar 2, 2023
@mergify mergify bot closed this as completed in #7115 Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cosmic-swingset package: cosmic-swingset enhancement New feature or request vaults_triage DO NOT USE
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants