openzeppelin-labs icon indicating copy to clipboard operation
openzeppelin-labs copied to clipboard

Ensure that proxies bubble up error messages

Open spalladino opened this issue 7 years ago • 21 comments
trafficstars

Solidity 0.4.22 introduced support for error reasons on revert EVM operations, check that proxies correctlly forward the error reason to their clients.

As an example, let's assume we have a logic contract named Reverter:

contract Reverter {
    function willRevert() public {
        require(false, "This is an error message from the contract");
    }
}

If you deploy this contract and attempt to call willRevert, you get the following message. Note that the message includes the revert reason This is an error message from the contract.

transact to Reverter.willRevert errored: VM error: revert.
revert The transaction has been reverted to the initial state.
Reason provided by the contract: "This is an error message from the contract".
Debug the transaction to get more information. 

Now, if you create a Proxy for Reverter via ZeppelinOS, and attempt to call willRevert on the proxy, the returned error message must include the This is an error message from the contract legend. Add a test in zos-lib to ensure it works like this, and make any necessary changes in Proxy if needed.

Depends on https://github.com/zeppelinos/zos-lib/issues/162

spalladino avatar Apr 21 '18 23:04 spalladino

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 0.2 ETH (103.97 USD @ $519.84/ETH) attached to it.

gitcoinbot avatar Jun 15 '18 00:06 gitcoinbot

@yjkimjunior thanks for tackling this issue!! Note that the issue is not exactly what you're describing. I've just updated the description to better explain it. Please us me know if it's now clear, and if you're still willing to work on this after the clarification.

spalladino avatar Jul 02 '18 14:07 spalladino

Thanks for the clarification, @spalladino, that makes sense. So make sure that error messages are retrieved/bubbled up from calls made to contracts through the proxies, right? I can modify/add the helper assertRevertWithErrMsg.js for this and assert error.message has a Reason provided by the contract: in the string.

pmespresso avatar Jul 03 '18 01:07 pmespresso

Here are my two cents on that, we could add an optional argument to the current assertRevert expecting it to assert a revert with a custom message when given and assert a revert without a message when not.

facuspagnuolo avatar Jul 03 '18 12:07 facuspagnuolo

@yjkimjunior Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] warning (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot avatar Jul 08 '18 16:07 gitcoinbot

Looks like this is blocked for now by these issues at Truffle/Ganache:

https://github.com/trufflesuite/truffle/issues/976 https://github.com/trufflesuite/ganache-core/pull/106

pmespresso avatar Jul 10 '18 02:07 pmespresso

@yjkimjunior Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] warning (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot avatar Jul 14 '18 16:07 gitcoinbot

Still blocked by Trufflesuite/truffle#976

pmespresso avatar Jul 14 '18 18:07 pmespresso

@yjkimjunior Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] warning (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot avatar Jul 20 '18 16:07 gitcoinbot

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


@yjkimjunior due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

  • [x] warning (3 days)
  • [x] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot avatar Jul 23 '18 16:07 gitcoinbot

Hey @yjkimjunior have you looked at https://github.com/trufflesuite/truffle/issues/976#issuecomment-408164018? It may actually be possible to get around that blocking issue.

spm32 avatar Aug 22 '18 22:08 spm32

Hey @spalladino are you still looking to get this one fulfilled?

smitrajput avatar Sep 30 '18 04:09 smitrajput

@smitrajput sure! It seems to require a new version of truffle to work, so we may not yet include it in zeppelinos/zos, but it'd be interesting to check if the assembly for delegating calls in the proxy work properly.

Not sure if @yjkimjunior is still working on it though. @yjkimjunior could you confirm if it's ok for @smitrajput to tackle this issue?

spalladino avatar Oct 01 '18 20:10 spalladino

Hey all, sorry I've been busy with other things and haven't been working on this. @smitrajput feel free to take the baton!

pmespresso avatar Oct 05 '18 05:10 pmespresso

hey @smitrajput - Frank from Gitcoin here - are you still working on this issue?

frankchen07 avatar Oct 24 '18 23:10 frankchen07

No, not anymore. You may start working on it.

On Thu, Oct 25, 2018 at 4:35 AM Frank [email protected] wrote:

hey @smitrajput https://github.com/smitrajput - Frank from Gitcoin here

  • are you still working on this issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zeppelinos/labs/issues/102#issuecomment-432857727, or mute the thread https://github.com/notifications/unsubscribe-auth/AVYwtkQhTSALRsKcgiPkritzvJ025gjIks5uoPJEgaJpZM4TeqeZ .

smitrajput avatar Oct 25 '18 01:10 smitrajput

hey @spalladino - the issue is currently expired on Gitcoin - is it still open to the public?

frankchen07 avatar Oct 26 '18 17:10 frankchen07

Hey @frankchen07! I'm not sure about the bounty on gitcoin, but you're welcome to work on this if interested! Note that it may be the case that we don't actually need to code anything, and revert reasons are indeed working on the current implementation.

spalladino avatar Nov 12 '18 15:11 spalladino

hey @spalladino - I see. I'm on the Gitcoin team, and just checking in on the issue :). We'll leave it up in open status, but currently it's expired, so whoever is up next to help out on the issue may reach out!

frankchen07 avatar Nov 16 '18 08:11 frankchen07

Thanks @frankchen07! I wasn't aware that you were on the gitcoin team, thanks for all the help around here, and for checking in on this issue!

spalladino avatar Nov 16 '18 13:11 spalladino

Issue Status: 1. Open 2. Cancelled


The funding of 0.2 ETH (35.14 USD @ $175.71/ETH) attached to this issue has been cancelled by the bounty submitter

gitcoinbot avatar Oct 17 '19 15:10 gitcoinbot