Permission moveFundsBetweenPots properly for voting#956
Merged
kronosapiens merged 9 commits intodevelopfrom May 20, 2021
Merged
Permission moveFundsBetweenPots properly for voting#956kronosapiens merged 9 commits intodevelopfrom
kronosapiens merged 9 commits intodevelopfrom
Conversation
52812f4 to
06ad490
Compare
8d9163c to
264571b
Compare
264571b to
26b9c58
Compare
kronosapiens
approved these changes
May 20, 2021
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.
This is my take at fixing up
moveFundsBetweenPotsso that what movement of funds are allowed is consistent regardless of whether the function is being executed directly or a motion has been made.I tried a couple of other ways, but there just simply isn't enough information provided in the combination of the existing action and the existing motion creation function. You have to prove:
The domain I have the permission in is a parent of the 'fromPot' domain
The domain I have the permission in is a parent of the 'toPot' domain
The domain the vote is taking place in is a parent of the 'fromPot' domain
The domain the vote is taking place in is a parent of the 'toPot' domain
But we only have three proofs, between
createMotionand the action if we create special functions to extract the second proof from the action. The action would provide the first two, but there's no way to prove both of the second with a single proof.Stepping back, I realised that we're in this predicament is because there is an ambiguity in the general case for
moveFundsBetweenPotsas to which domain we're acting in. Consider the domain hierarchy:Let's say I have the permission explicitly in A, and I want to move funds from C to D. What domain am I acting in? We could say it's A by convention, but that would mean it would be impossible to have a vote in B about this, which clearly should be allowed. There's no way to specify which domain we're acting in. So the solution I've implemented here adds a new
moveFundsBetweenPotsthat removes this ambiguity. It still includes multiple domain proofs, but those now prove that the domain we're acting in is a parent of C and a parent of D and so don't need to be considered for the creation of the motion, nor do they need to meet the unofficial standard we've adopted (which the proof for 'which domain we're acting in' does, and therefore plays nicely with the motions and disputes).