feat(Wallet): add execution ordering via git-style branching#3
Merged
feat(Wallet): add execution ordering via git-style branching#3
Conversation
bba49d7 to
fbf2243
Compare
fbf2243 to
e99328e
Compare
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
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.
What I did
Prior to this PR, we did not have a way of ensuring that
Modify/Executemessages were executed in a specific order. This is important because there needs to be a way to ensure that we can enforce an off-chain ordering to the way that messages should be executed on-chain. The classical way of doing this would have been to use a "nonce" (self-incrementing integer value), allowing multiple messages to queue up at the same nonce height, allowing the ability to replace a badly-formatted transaction prior to attempting to commit it. However, this value also serves as an important representation of the transactions pending in the current queue (and their dependencies), and thus need to have a clearer correspondence to the intent of the proposer(s).How I did it
Here we have implemented a branching-style, hash-based mechanism for off-chain ordering, where the EIP712 message hash of the last message to be committed is referenced in the message itself. This enforces a natural ordering to how messages must be committed, and also gives a few nicer capabilities:
There is however a cost when "replacing" a transaction from the middle of a branch of transactions intended to be executed in sequence, as the later transactions will have to be "rebased" once the replacement is added, which could be somewhat annoying to signers. However, this sort of enforces revisiting the transaction sequence to ensure they are still valid, which could have a benefit of avoiding further invalid transactions being committed.
How to verify it
The change is fairly simple, adding the method
head()used to obtain the last committed transaciton. Module transactions (which bypass signature validation) do not use this feature.Checklist
- [ ] Documentation is complete