-
Notifications
You must be signed in to change notification settings - Fork 132
multi: allow supply commit state machine to accept pending updates during state transition #1609
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
Draft
Roasbeef
wants to merge
17
commits into
supply-leaf-height-query
Choose a base branch
from
updates-mempool
base: supply-leaf-height-query
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3f50668
to
aff4830
Compare
bd5d0b4
to
37f23fa
Compare
aff4830
to
5d593a6
Compare
37f23fa
to
be0a52c
Compare
cf3e3d5
to
407e826
Compare
be0a52c
to
f2a69aa
Compare
407e826
to
e742cf7
Compare
e742cf7
to
c57141c
Compare
f2a69aa
to
93ed469
Compare
c57141c
to
f7c21e5
Compare
93ed469
to
633373a
Compare
f7c21e5
to
b4dc187
Compare
633373a
to
3ca1517
Compare
b4dc187
to
451e0ae
Compare
3ca1517
to
988837b
Compare
451e0ae
to
483f5fa
Compare
988837b
to
a9ef139
Compare
483f5fa
to
edabb47
Compare
a9ef139
to
ca7db9a
Compare
edabb47
to
b912c0c
Compare
ca7db9a
to
ec56941
Compare
b912c0c
to
d8b602c
Compare
ec56941
to
16f9f9a
Compare
d8b602c
to
b22596b
Compare
16f9f9a
to
059ed3f
Compare
In this commit, we add a new method to the SupplyTreeStore that is able to read out the leaves of a supply tree based on a start and end height. This will be useful for writing the new syncing state machine and the sub-system that serves the supply tree syncer.
…sitions In this commit, we allow dangling updates, as we want to be able to insert updates not associated with a state transition, then bind them later. We do this by allowing the transition_id to be NULL, and also adding a new frozen bool. This bool will be used later on to mark the point at whicih we'll create danging updates vs adding to the existing state transition.
This'll allow us to query for all the dangling updates for a given asset. Without this, if transition_id is NULL, then we can't do a join to query based on the group key.
We'll use these to properly freze a batch, query for the set of dangling updates, and also bind the set of dangling updates as well.
…ld, and group key param
…pdates In this commit, we update the supply update insertion logic to support dangling updates. To do this, we modify the main routine to: * Use an upfront query to determine if a transition exists or not: * If not, then we'll just make a new one and add the update. * Otherwise we check if it's frozen, if so, then we'll insert a dangling update. We also now allow insertions at any state, as we'll also update the main state machine to allow inserting updates at any state. With this change, we can always call insert supply updates, and know that they'll either be added to the current transition, or added as a dangling update.
After this point, any inserted updates will now be dangling.
… updates We'll now automatically loop back to the updates pending state if we have any dangling updates. After the next tick we'll then re run the main loop to create a new on-chain commitment.
5025c8c
to
acafde1
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR, we update the state machine to accept pending updates during a state transition. This takes a burden off of callers, as they can just continue to send in new events at will without needing to handle the error case.
To achieve this, we add a stage where we explicitly freeze a pending state transition. Once frozen, any other updates will be added as a dangling update (not pointing to a state transition). We then update the state machine to do a new transition where we'll query for dangling updates and bind them to a new state transition in an atomic step. We'll then create a new state transition with these dangling updates.
TODO