-
Notifications
You must be signed in to change notification settings - Fork 213
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
Model ledgerBranches sparsely. #6138
Conversation
@@ -63,11 +62,11 @@ RwTxExecuteAction == | |||
\* that it can be picked up by the current leader or any former leader | |||
/\ \E view \in DOMAIN ledgerBranches: | |||
ledgerBranches' = [ledgerBranches EXCEPT ![view] = | |||
Append(@,[view |-> view, tx |-> history[i].tx])] | |||
@ @@ (Max(DOMAIN ledgerBranches[view] \cup {0})+1) :> [view |-> view, tx |-> history[i].tx]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have this pattern in multiple places, can we pull it out and name it?
SparseLen(s) == Max(DOMAIN s \cup {0})
SparseAppend(s, e) == s @@ (SparseLen(s) + 1 :> e)
For the others that don't have multiple callers its less clear-cut, but maybe still more readable to introduce SparseSelectSeq
and SparseSubSeq
?
Let's hold off until we have the trace validation matching to make changes to the model that directly help the trace validate. |
So interestingly, making the branches sparse may not be a the clear simplicity win I expected, because although it means we can probably remove With the dense models, we have to add two backfill actions, but every action from the trace can directly call its namesake in the spec. |
I don't understand what you mean by "choose the txid"? |
I forgot we could use conditions on future states to constrain the state, so perhaps we could do:
But that does not seem work.
The framework exposes the KV read version, which is dependent on all previous transactions, not just transactions to that key. To match that, we either need to insert a single Tx at read versions, where they don't match one of the model's Tx (because it's a signature, some governance, yadda yadda), or modify the application code to return an applicative read version that's really the version of last previous write. |
Summary of discussion with @lemmy yesterday:
For the time being, because the validation passes, this is not urgent. |
This is now ~6 months old, and unlikely to result in a merge. The consistency TV is more than fast enough in its current state. |
Refactor modeling of ledgerBranch[i] from seq into function.