aurora-is-near / aurora-engine

⚙️ Aurora Engine implements an Ethereum Virtual Machine (EVM) on the NEAR Protocol.
https://doc.aurora.dev/develop/compat/evm
331 stars 82 forks source link

`evm-bully` fails on Ropsten testnet, block 11, tx 3 #127

Open frankbraun opened 3 years ago

frankbraun commented 3 years ago
Transaction Id 2YteBRDGcLvKAN7eVF2cgk4YD1WiCkwjByPYLb7rLkRQ
evm-bully: error: failure:
{
  "ActionError": {
    "index": 0,
    "kind": {
      "FunctionCallError": {
        "ExecutionError": "Smart contract panicked: ERR_STACK_UNDERFLOW"
      }
    }
  }
}

See replay failing transactions on how to replay ropsten-block-11-tx-3.tar.gz.

See also #2.

birchmd commented 3 years ago

This looks like a bug in sputnikVM (that's where the stack underflow error comes from). Seems like some instruction is being used without enough arguments, causing more elements to be popped off the stack than are actually there.

I don't know why this passes on real ethereum nodes (this tx succeeded according to etherscan).

I think the next step here is to capture this transaction as a unit test and try to follow the stack machine through the execution (the reason to distill down to a unit test first is that this would be pretty difficult to do in wasm). We could then try to compare this with geth or open ethereum to see where sputnik goes wrong.

birchmd commented 3 years ago

Coming back to this, I was wrong about the original transaction passing on the real Ropsten network. The transaction in question is this one: https://ropsten.etherscan.io/tx/0xc1c1799927976906ae45e6eaa6033507750115a3652bc16b690cdecf3f8f42ba which fails with the same error message (stack underflow).

I think the bully needs to be updated to handle expected failures.

Assigning to @strokovok to sort out with @frankbraun