-
Notifications
You must be signed in to change notification settings - Fork 682
Forking mainnet results in erroneous revert reason #571
Comments
Yes we have been experiencing this a lot recently (on both mainnet and ropsten now). We had seen similar issues before with delete wiping the fork state, leading to refetching the data in future calls instead of returning 0. We patched this here: compound-finance#5, but figured this was probably inappropriate as a general solution. Reproducing the issue for us generally involves our entire stack, which is why we haven't reported thus far - now here is a nice self-contained instance of the issue, hoping yall can help us track down what is wrong - happy to help if we can. |
Note that this issue is popping up again, even with our patched version, so there seems to be another related issue. |
OK I take it back, after further investigation the issue is not popping up using the patched version (compound-finance#5), it was using a different version. I've added a test to that PR to help reproduce the issue (and shows that the patch fixes it) in case someone attempts an 'ultimate fix', but at least if anyone else is blocked by this issue, they can use our branch for now. |
I think I'm seeing this issue in my tests too. I'm getting a revert on re-entrancy in one of my tests where that doesn't make sense. Should I provide it as an example? |
Same here, thanks @jflatow for some improvements over this, but I still get it :/ |
You sure you are using the fork? We don't have the problem anymore using it, but if you can you should try to give a repro, in case there's another issue. |
Edit: Sorry, wrong ganache-cli ... 😅Thanks again for your patch |
Does anyone know when this patch will be merged? |
Hey @davidlucid I'm looking into the issue now and proposed patch from compound-finance#5, so hopefully soon! |
As an FYI to this thread, the proposed fix in compound-finance#5 was non-generic and would cause other issues. #612 modifies the usage of |
This was just officially released in [email protected] / [email protected] |
I'm using ganache-core 2.11.3-beta.0, and it seems I'm still seeing this bug in certain cases. Steps to reproduce:
In step 4, only two tests in
The reentrant call error is from the zkSync contract, found here. The full console output from the error is below:
It seems this has something to do with the use of I also just noticed I'm missing some |
@mds1, apologize for the delay. I had to focus on some Truffle Teams issues. I can reproduce your issue! Thank you for the detailed write up and reproduction steps. I'm going to continue discussing this on #611 as I'm fairly certain they're the same issue. Looking at your original issue report here, this is also likely the same issue you were getting when you first made this issue. I'll keep this one closed as we did solve a different use cause for a similar symptom with the Compound-proposed fixes |
@seesemichaelj I know this issue is closed, but we've had a very similar re-entrancy guard issue with ganache forking. This update fixed our issue in release You can repro the issue in this repo: https://github.com/UMAprotocol/launch-emp by tweaking the version of ganache-cli in the package.json. We've found we get re-entrancy breakages in Once you have pulled the repo and tweaked the version: yarn
yarn ganache-cli --fork YOUR_INFURA_NODE -l 12000000 In a different shell: node index.js --gasprice 100 |
Unfortunately @mrice32, I'm no longer with truffle and won't be able to help you out. @davidmurdoch is the point person for all ganache issues going forward. Best of luck! |
@seesemichaelj ahh, good to know. Thanks for the quick reply! @davidmurdoch, would be great to get your insight here! |
I am having this issue too with the latest ganache version. Anyone? |
This issue has been noticed by the Compound team before when forking the mainnet, and can be reproduced using the tests in this commit.
Steps to Reproduce
npm install
npx oz compile && npx mocha --exit --timeout 0 test/endaoment-test.js
Explanation
In the file
endaoment-test.js
we are failing in the test called "should allow a membership proposal & vote" at the lineawait this.instance.processProposal(0, {from: summoner});
This line calls the function
processProposal()
inEndaoment.sol
. The failure occurs in the following section of that function:This line is calling the
deposit()
function inGuildBank.sol
. This function is shown below for convenience:Now, the statement
if (0 == mintCode)
is incorrect, and really should beif (0 != mintCode)
. However, this mistake in the code means the function should return false and therefore the contract should error solely with the error message "Endaoment::processProposal - token transfer to guild bank failed".Instead, you can see the cToken error message of "re-entered" is included. This is from the
nonReentrant
modifier of cTokens, but because there is no reentrancy here this should not have been triggered.The text was updated successfully, but these errors were encountered: