-
Notifications
You must be signed in to change notification settings - Fork 105
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
Fix setExpenditureValues with metatransactions #1252
Conversation
@area can you clarify what is meant by "there are no arguments in the function call"? Do you mean that there are no arguments after the metatransaction flag? Or no arguments entirely? |
Also, in a multicall world, could we not dispense with |
371b5c4
to
19d7aa7
Compare
19d7aa7
to
bccd58c
Compare
No arguments to the function that the contract is calling on itself. In the original implementation, Unfortunately, we now have a scenario where
This is true, but not how things have been implemented on the front-end. |
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.
Looks good to me. I don't see significant risk to the metatransaction functionality, as most of the shuffling is taking place in ColonyExpenditure
. The refactor in MetaTransactionMsgSender
didn't have any issues I could see.
I would like to deprecate setExpenditureValues
in the future and shift to multicall for this sort of behavior, though, as ultimately this is sort of a hack built on top of a previous hack.
Deliberately haven't squashed the last commit to serve as a reminder to us how easily critical errors can be made, and how innocuous they can look. |
Thanks to @jakubcolony's efforts, this is now how things have been implemented on the frontend, so maybe this PR should now be replaced by one to remove |
Wonderful! I wouldn't mind hanging on to the new constant though, especially after risking death to introduce it. |
That's fair. Once it's confirmed that everything works via multicall and it's successfully deployed, I'll close this and open a new one. |
Superseded by #1259 |
Metatransactions do not work as-is with, specifically,
setExpenditureValues
.This is because the assumption we made when implementing metatransactions to accommodate our self-calling functions is not true for one particular call to
setExpenditurePayouts
we make after introducing setExpenditureValues. Specifically, the assumption that if one of our contracts is calling itself, there are no arguments in the function call (represented by theindex >= 52
here).This PR makes one attempt to fix it, but there could be others I've not considered - I am very much open to other suggestions if there is a better one we can arrive at. The solution is similar to how we treat metatransactions in multicalls, however.
As with everything that touches metatransactions, a particularly careful review would be appropriate, as the failure case for metatransactions is catastrophic.