cloudwalk / stratus

An EVM compatible blockchain using rocksdb as storage. It was written for performance, suited for in house use.
https://doc.stratus.cloudwalk.io/
MIT License
116 stars 4 forks source link

Yield tests sometimes fail due to reversion without data #517

Closed mayconamaroCW closed 6 months ago

mayconamaroCW commented 7 months ago

This needs investigation example

1) Contract 'YieldStreamer'
       Function 'claim()'
         Executes as expected if token balances are according to case 1 and
           The amount equals a half of the possible primary yield:
     Error: missing revert data in call exception; Transaction reverted without a reason string 
[ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data="0x", transaction=
{"from":"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"to":"0xdB05A386810c809aD5a77422eb189D36c7f24402",
"data":"0x70a08231000000000000000000000000f66cfdf074d2ffd6a4037be3a669ed04380aef2b",
"accessList":null}, error={"name":"HeadersTimeoutError","code":"UND_ERR_HEADERS_TIMEOUT",
"message":"Headers Timeout Error"}, code=CALL_EXCEPTION, version=providers/5.7.2)
carneiro-cw commented 7 months ago

This is a total shot in the dark, but this might have something to do with the differences between how evm_setNextBlockTimestamp works in stratus and hardhat. In hardhat each produced block timestamp is always one second after the previous block (I think ???).

mayconamaroCW commented 7 months ago

At least is a place to start, thank you 🙏

mayconamaroCW commented 7 months ago

Investigation updates:

I'll try to increase the timeout as suggested in mentioned issue

mayconamaroCW commented 7 months ago

Another error happened https://github.com/cloudwalk/stratus/actions/runs/8605836237/job/23582964905


       Function 'claim()'
         Executes as expected if token balances are according to case 1 and
           The amount equals a half of the possible primary yield:
     Error: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] 
(method="balanceOf(address)", data="0x", errorArgs=null, errorName=null, errorSignature=null, 
reason=null, code=CALL_EXCEPTION, version=abi/5.7.0)
      at Logger.makeError (node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
      at Logger.throwError (node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
      at Interface.decodeFunctionResult (node_modules/@ethersproject/abi/src.ts/interface.ts:427:23)
      at Contract.<anonymous> (node_modules/@ethersproject/contracts/src.ts/index.ts:400:44)
      at step (node_modules/@ethersproject/contracts/lib/index.js:48:23)
      at Object.next (node_modules/@ethersproject/contracts/lib/index.js:29:53)
      at fulfilled (node_modules/@ethersproject/contracts/lib/index.js:20:58)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)```
mayconamaroCW commented 7 months ago

Start point to investigation

https://docs.ethers.org/v5/troubleshooting/errors/#help-CALL_EXCEPTION

Common Causes

  • The code does not exist on-chain. This may happen if you failed to wait until the contract was deployed, the address is incorrect or if you are connected to a different network than the contract has been deployed. Check the code exists using provider.getCode(address).
  • The wrong code is being accessed, for example if an artifact file was not correctly updated so an older instance of the contract is being called
  • The contract is failing during a require statement. For example, if a contract method requires an admin account to be used, but the contract is connected to another Signer.
  • The wrong ABI is being used to interact with a contract.
mayconamaroCW commented 6 months ago

Didn't seem to have happened again for one entire week