zeta-chain / localnet

MIT License
3 stars 1 forks source link

Revert on EVM fails #23

Closed fadeev closed 3 weeks ago

fadeev commented 4 weeks ago
yarn hardhat deposit-and-call --message bob --network localhost --revert-address 0x9A676e781A523b5d0C0e43731313A708CB607508 --revert-message "123" --call-on-revert --contract 0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82 --amount 2
[EVM]: Gateway: 'Deposited' event emitted

[ZetaChain]: Universal contract 0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82 executing onCrossChainCall (context: {"origin":"0x610178dA211FEF7D417bC0e6FeD39F05609AD788","sender":"0x735b14BB79463307AAcBED86DAf3322B1e6226aB","chainID":1}), zrc20: 0x9fd96203f7b22bCF72d9DCb40ff98302376cE09c, amount: 2000000000000000000, message: 0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003626f620000000000000000000000000000000000000000000000000000000000)
eth_sendTransaction

    Transaction: 0xec360d8c235799450d2e5a3ea3386deee9bb0653f26619034601d0bbeaa2095c
    Gas used: 75314
    Error: reverted with: EvmError: Revert

    Block Number: 25
    Block Hash: 0x5f7e74561ec224109b41a9a362d53deb01291042c2429f37351e5c6c91359c13
    Block Time: "Wed, 21 Aug 2024 18:50:02 +0000"

[ZetaChain]: Error executing onCrossChainCall: Error: transaction execution reverted (action="sendTransaction", data=null, reason=null, invocation=null, revert=null, transaction={ "data": "", "from": "0x735b14BB79463307AAcBED86DAf3322B1e6226aB", "to": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788" }, receipt={ "_type": "TransactionReceipt", "blobGasPrice": "1", "blobGasUsed": null, "blockHash": "0x5f7e74561ec224109b41a9a362d53deb01291042c2429f37351e5c6c91359c13", "blockNumber": 25, "contractAddress": null, "cumulativeGasUsed": "75314", "from": "0x735b14BB79463307AAcBED86DAf3322B1e6226aB", "gasPrice": "10000000000", "gasUsed": "75314", "hash": "0xec360d8c235799450d2e5a3ea3386deee9bb0653f26619034601d0bbeaa2095c", "index": 0, "logs": [  ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "root": "0x006416a6c9cd84f09aa006149c41dc69cf3abf55cb50e480f21883b9690249ab", "status": 0, "to": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788" }, code=CALL_EXCEPTION, version=6.13.2)
[EVM]: Contract 0x9A676e781A523b5d0C0e43731313A708CB607508 executing onRevert (context: {"asset":"0x0000000000000000000000000000000000000000","amount":0,"revertMessage":"0x313233"})

    Transaction: 0x6c663e653423037b3402be7d9d3b61a8809cf85fb30aee4440aab9bb476316d5
    Gas used: 30633
    Error: reverted with: custom error e2517d3f:000000000000000000000000f39fd6e5…51e47079d4fa96875938e2c27c451deb (64 bytes)

    Block Number: 26
    Block Hash: 0x55e7d751bf9035aa82e99ad9edadd007e342e81f4810365e0270ca249f21baf5
    Block Time: "Wed, 21 Aug 2024 18:50:03 +0000"

[EVM]: Gateway: Call onRevert failed: Error: transaction execution reverted (action="sendTransaction", data=null, reason=null, invocation=null, revert=null, transaction={ "data": "", "from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", "to": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0" }, receipt={ "_type": "TransactionReceipt", "blobGasPrice": "1", "blobGasUsed": null, "blockHash": "0x55e7d751bf9035aa82e99ad9edadd007e342e81f4810365e0270ca249f21baf5", "blockNumber": 26, "contractAddress": null, "cumulativeGasUsed": "30633", "from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", "gasPrice": "10040545014", "gasUsed": "30633", "hash": "0x6c663e653423037b3402be7d9d3b61a8809cf85fb30aee4440aab9bb476316d5", "index": 0, "logs": [  ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "root": "0xb10c6d7d636dba21e07fa4a4c81649f2b65f39374dc98ce33d84be9fd9182909", "status": 0, "to": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0" }, code=CALL_EXCEPTION, version=6.13.2)
skosito commented 4 weeks ago

@fadeev from first look, the only custom error with args is related to wrong role, something might be lost in merge conflicts, but executeRevert should be called by tss (i added that in this PR https://github.com/zeta-chain/localnet/pull/18/files#diff-0bc125b6009685a22a8b3a093e9b90a708498971b0a9e5551a5a13e1738262d1R359) but i see on main it is still called by deployer

fadeev commented 3 weeks ago

@skosito thanks! This works!