Skip to content
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

runtime tx unexpected fields #704

Closed
pro-wh opened this issue Jun 10, 2024 · 11 comments · Fixed by #746
Closed

runtime tx unexpected fields #704

pro-wh opened this issue Jun 10, 2024 · 11 comments · Fixed by #746
Labels
api-layer API layer-related issues. bug Something isn't working

Comments

@pro-wh
Copy link
Collaborator

pro-wh commented Jun 10, 2024

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

@pro-wh pro-wh added bug Something isn't working api-layer API layer-related issues. labels Jun 10, 2024
@lukaw3d
Copy link
Member

lukaw3d commented Jun 10, 2024

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

So:

  • status: should be success
  • amount / Value: should be 199.809878 ROSE
  • to_eth: should be 0xAaF64683099cF03c69007fdD39b21e91a32d05be (tho this is a native (non-EVM) transfer?)

@pro-wh
Copy link
Collaborator Author

pro-wh commented Jun 11, 2024

oh was this an encrypted transaction?

edit: explorer says plain 👀

@ptrus
Copy link
Member

ptrus commented Jun 17, 2024

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
Copy link
Member

kostko commented Jun 17, 2024

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

@csillag
Copy link
Contributor

csillag commented Jun 18, 2024

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

@csillag
Copy link
Contributor

csillag commented Jun 28, 2024

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
Copy link
Collaborator Author

pro-wh commented Jul 2, 2024

should step through the analyzer on this tx

@Andrew7234
Copy link
Collaborator

Andrew7234 commented Aug 13, 2024

Some early observations:

  • The transaction AuthProof module is empty. Nexus expects this to be evm.ethereum.v0 for eth transactions, for which it extracts the eth hash.
  • The sdk Call.Method is empty. Nexus currently expects this field to be populated, eg evm.Call. This is the primary reason why Nexus is unable to parse this transaction.

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
Copy link
Member

kostko commented Aug 14, 2024

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
Copy link
Collaborator Author

pro-wh commented Aug 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-layer API layer-related issues. bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants