-
Notifications
You must be signed in to change notification settings - Fork 167
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
"logic eval error: fee too small" when upgrading to latest Reach (f33abc3d) #1387
Comments
Algorand does not support composability, so every client needs to know intimate details about servers they call. You have to encode this knowledge in your clients using the https://docs.reach.sh/rsh/consensus/#rsh_REMOTE_FUN If you compile with debugging on, then you should see a precis that lists the number of fees for each API call. But you can also just increment by one until it works. Different versions of Reach, or slight variations in your code, may cause different costs. Furthermore, if the costs change because of dynamic values, then when Reach simulates your txn, the resources given to it may be wrong when they actually hit the chain. I'm closing this because it is the expected behavior. However, I am extremely willing to help you figure out what arguments you need to provide to get this program working. |
Thanks @jeapostrophe! I will continue here for support, please let me know if you prefer to move this conversation to a different channel. I have compiled the called contract with debugging on and I got this output:
I can see that all API calls cost 2 fees. spp.SolarPowerPlant_increaseCapacity.ALGO({ fees: 2 })(power)
// ...
spp.SolarPowerPlant_increaseOutput.ALGO({ fees: 2 })(power) The first remote call is called when the calling contract is deployed before the
This is the output of the test with debugging on: https://gist.github.com/lorenzopolidori/e46f8191f692d6a100b23ff277c884a4 I have also tried with the following: spp.SolarPowerPlant_increaseCapacity.ALGO({ fees: 2, apps: [sppContractInfo] })(power)
// ...
spp.SolarPowerPlant_increaseOutput.ALGO({ fees: 2, apps: [sppContractInfo] })(power) but I got the same error. Can you please help me to identify what I am missing? |
Some comments as I'm reading...
|
Yes, that's expected. This is what I have been testing so far, and this test was working before I upgraded reach from |
I don't understand why you think the test is not working then? This error basically says "I expected to be in state 5, but aren't". In a non-race scenario, Reach can detect this before the call, but in this case it was wrong, so you get the raw network error |
Yes, that's right.
i.e. the previous version, either Alice or Bob manages to buy the token, and the other gets the error above, which is expected since the programme is not in that state anymore. After cleaning, when I run:
i.e. the latest version, neither of them manage to buy the token, both get the error above when calling the API, and the test gets stuck. |
Thank you for pushing me on this. I was wrong. This is a problem. I'm in the middle of fixing it |
Okay, I just pushed a fix. It should take about 20m to test and then we'll do a release ASAP. I am sorry for being difficult. The |
No problem, thanks for the quick fix! |
It was released yesterday! |
I confirm my tests work as expected after the latest release, thanks! |
Describe the error
After upgrading to the latest Reach version (hash
f33abc3d
), when calling an API from a frontend test script, I get alogic eval error: fee too small
. The API in the first contract calls an API in a second contract.To Reproduce
This is the gist with the debug logging: https://gist.github.com/lorenzopolidori/3db245caa9fb01c2e1891921c686a4c7
You can find the full source code of the two contracts here: https://github.com/terragrids/dapp/tree/dev/blockchain
The automated test code that I ran to generate the debug logging is here https://github.com/terragrids/dapp/blob/dev/blockchain/token-market/index.mjs
token-market
is the calling contract,solar-power-plant
is the called contract.To reproduce the issue:
blockchain/solar-power-plant/build/index.main.mjs
into./blockchain/token-market/build
Expected behavior
The API should be called without errors as in the previous version of Reach.
Extra information
Reach hash:
f33abc3d
Reach stslib:
0.1.11-rc.8
The text was updated successfully, but these errors were encountered: