oasisprotocol / nexus

Official indexer for the Oasis Network.
Apache License 2.0
13 stars 4 forks source link

runtime tx unexpected fields #704

Closed pro-wh closed 4 weeks ago

pro-wh commented 3 months ago

cc @matevz @csillag

https://explorer.oasis.io/mainnet/sapphire/tx/7224d59e6b74d9b2caf55ab40dfe0757cef4f71c66d3a7aba3de1d267d2ea409

this tx has error set while the status is unknown. api should clear out the error

also its method is blank, which isn't right. allegedly it's supposed to be accounts.Transfer

lukaw3d commented 3 months ago

Looks like a successful tx to me: it emitted events, and did transfer ROSE

So:

pro-wh commented 3 months ago

oh was this an encrypted transaction?

edit: explorer says plain :eyes:

lukaw3d commented 3 months ago

Hm this tx is causing issues to oasisscan too

ptrus commented 3 months ago

This is what oasis cli reports for the tx:

./cli paratime show 3995186 --paratime sapphire 4
...
=== Transaction 4 ===
Kind: oasis
Hash: 7224d59e6b74d9b2caf55ab40dfe0757cef4f71c66d3a7aba3de1d267d2ea409
Signer(s):
  1. AgGWYtk5tcLUzmh5XYrDn1iW3ZcyfLtfCHSgPnzAeaPp
     (signature: MEQCIClN4/jJvGNaFIuHz0QICbeXHRRsXFAzKj+Z6zPuccxsAiBmOu16GkZ5CQtQh3jWAZGC2kfRD4dHVPa3IeISKvmJGA==)
Content:
  Format: encrypted/x25519-deoxysii
  Body:
    {
      "data": "M+EtPEsK0Jx6YBWovQqDc8Vfmwy86L0EE66kv1++2RYxbXYj2zQsPmHPJLhC1VELHKVJQ/WKF+lTYhV3XhPdjTl1CiY8HiY7BcbL+t4nHB77mrGAeDBZV3nAJt4=",
      "nonce": "p8fnoq24sBge89XBVnvG",
      "pk": "ZDSfM+5QCZez+7fEjVOGmY2UlF82Q/KKR7Void3UHUQ="
    }
  Authorized signer(s):
    1. AgGWYtk5tcLUzmh5XYrDn1iW3ZcyfLtfCHSgPnzAeaPp (secp256k1eth)
       Nonce: 27
  Fee:
    Amount: 0.0012389 ROSE
    Gas limit: 12389
    (gas price: 0.0000001 ROSE per gas unit)

=== Result of transaction 4 ===
Status: unknown
Data:
  {
    "data": "9e845df1c05276f79f67b2d2f8eb68bc516438a473",
    "nonce": "00000000003cf63100000004000000"
  }

=== Events emitted by transaction 4 ===
Events: 2

  --- Event 0 ---
  Module: accounts
  Code:   1
  Data:
    [
      {
        "Burn": null,
        "Mint": null,
        "Transfer": {
          "amount": {
            "Amount": {},
            "Denomination": ""
          },
          "from": "oasis1qqugfeelqtp3qaxhdrwfv9nhpvwckjxr7yk369p7",
          "to": "oasis1qzy0yk6hwxx7e236cmawlt7xukpn8avtqq6le3l8"
        }
      },
      {
        "Burn": null,
        "Mint": null,
        "Transfer": {
          "amount": {
            "Amount": {},
            "Denomination": ""
          },
          "from": "oasis1qqugfeelqtp3qaxhdrwfv9nhpvwckjxr7yk369p7",
          "to": "oasis1qp3r8hgsnphajmfzfuaa8fhjag7e0yt35cjxq0u4"
        }
      }
    ]

  --- Event 1 ---
  Module: core
  Code:   1
  Data:
    [
      {
        "amount": 12389
      }
    ]

so it is indeed encrypted

kostko commented 3 months ago

Looks like an encrypted transaction, incorrectly interpreted by the explorer as plain?

csillag commented 3 months ago

Explorer recognizes encrypted transactions based on the presence of the encryption_envelope field, but here, we don't get one from nexus.

csillag commented 3 months ago

oh was this an encrypted transaction?

Yes this was.

edit: explorer says plain 👀

@pro-wh Yes it does, because Nexus is not including an encryption_envelope, which it usually does for encrypted TXs. Is there any chance to find out this reason for that?

pro-wh commented 3 months ago

should step through the analyzer on this tx

Andrew7234 commented 1 month ago

Some early observations:

If this transaction style is intentional, we'll need to figure out some new heuristic for Nexus to determine whether a tx is evm/non-evm. (or brute force it and just try every runtime tx)

kostko commented 1 month ago

The above transaction is not an Ethereum transaction (which is why the auth proofs are regular signatures).

It is an encrypted SDK transaction, see the above CLI dump. The method is empty as is the case with all non-Ethereum encrypted transactions. The actual method name is encrypted.

pro-wh commented 1 month ago

ok yeah this transaction style is intentional. we need something similar to EVMMaybeUnmarshalEncryptedData but for the oasis level of encryption