[secretcli] [secret-secret] Fail to read the output of succeed contract tx

Hi, I’m trying secret-secret(https://github.com/enigmampc/secret-secret) on my own docker local testnet.
My machine is sgx disabled Ubuntu.

When query a failed contract tx, cli returns json data successfully as following.

root@d8f40836e884:~# secretcli tx compute execute $CONTRACT '{"create_viewing_key": {}}' --from a --gas 30000000
{
  "chain_id": "enigma-testnet",
  "account_number": "3",
  "sequence": "23",
  "fee": {
    "amount": [
      {
        "denom": "uscrt",
        "amount": "7500000"
      }
    ],
    "gas": "30000000"
  },
  "msgs": [
    {
      "type": "wasm/MsgExecuteContract",
      "value": {
        "sender": "secret1gxj2peaxqvvkzjqla6lqrh4mtf39a9y7djkl2q",
        "contract": "secret18vd8fpwxzck93qlwghaj6arh4p7c5n8978vsyg",
        "msg": "fN5cZQhW0uDDMBa9Y1uXREO4UIf5cywxsh8CiAHQRudpN+B9drYkgIvwHntDGlYnW6lUZP+zmFc5ubMjdAWGJCqcLkTxLST9O8aaRKmddb014l3QoSsGcHujTQAtEMkNpjzpKex+WdgDMwqGdBfenhCPASEB21yolAP42+xQFlRqKG58NjuQ37zxw6+zfmEPDeAQroUrzhKjbM9+z0T/KvfKBmIdGnjLf2g=",
        "callback_code_hash": "",
        "sent_funds": [],
        "callback_sig": null
      }
    }
  ],
  "memo": ""
}

confirm transaction before signing and broadcasting [y/N]: y
{
  "height": "0",
  "txhash": "50E79F8407C9FA5AE5DE4EC90C78371D5E95DD30F1C112AACA3B9299BF5F963A",
  "raw_log": "[]"
}
root@d8f40836e884:~# secretcli q compute tx 50E79F8407C9FA5AE5DE4EC90C78371D5E95DD30F1C112AACA3B9299BF5F963A
{
  "type": "execute",
  "input": "827a8aecc9474b8cc0176e804762e4a92d18f4d2c6b289adf6c733a316b2d47c{\"create_viewing_key\": {}}",
  "output_data": "",
  "output_data_as_string": "",
  "output_log": [],
  "output_error": {
    "parse_err": {
      "target": "secret_secret::msg::HandleMsg",
      "msg": "missing field `entropy`"
    }
  },
  "plaintext_error": ""
}

Although, when query a succeeded tx, cli returns error as following

root@d8f40836e884:~# secretcli tx compute execute $CONTRACT '{"create_viewing_key": {"entropy": "1"}}' --from a --gas 30000000
{
  "chain_id": "enigma-testnet",
  "account_number": "3",
  "sequence": "24",
  "fee": {
    "amount": [
      {
        "denom": "uscrt",
        "amount": "7500000"
      }
    ],
    "gas": "30000000"
  },
  "msgs": [
    {
      "type": "wasm/MsgExecuteContract",
      "value": {
        "sender": "secret1gxj2peaxqvvkzjqla6lqrh4mtf39a9y7djkl2q",
        "contract": "secret18vd8fpwxzck93qlwghaj6arh4p7c5n8978vsyg",
        "msg": "Y0Pduem96ZGrlL4VuzWyJxAYJO8xi1Dc5za55fGsgcZpN+B9drYkgIvwHntDGlYnW6lUZP+zmFc5ubMjdAWGJNU7gtc8tjm6/WuZGpD/RdZgSqJKW0T6cD8kXuv+eS7L2UqLzUE6YwbyvYfCUSs0fkWv+f/+ZiTh1zAvTaEi328hq34SLhasFsV25xjH2mntWWjYvuUWVp/J0i/JhFisadZSog/cIbw5xlkidkOGn0Z+JuqtxAhjng==",
        "callback_code_hash": "",
        "sent_funds": [],
        "callback_sig": null
      }
    }
  ],
  "memo": ""
}

confirm transaction before signing and broadcasting [y/N]: y
{
  "height": "0",
  "txhash": "35EE593CE1E6B48C8A93D3904ACDA217D47CC7921A294CFDBAF70A795F80B4F6",
  "raw_log": "[]"
}
root@d8f40836e884:~# secretcli q compute tx 35EE593CE1E6B48C8A93D3904ACDA217D47CC7921A294CFDBAF70A795F80B4F6
ERROR: error while trying to decode the encrypted output data from base64: illegal base64 data at input byte 0

The docker container wrote following to stdout, so I think the tx indeed succeeded.

TRACE [wasmi_runtime_enclave::wasm::io] Output before encryption: "{\"Ok\":{\"messages\":[],\"log\":[],\"data\":\"eyJjcmVhdGVfdmlld2luZ19rZXkiOnsia2V5IjoiYXBpX2tleV81WHByV3l1TjBkK2pDRnZpMXdHUlRYME82T3Mwemx3RGdqcXJ5Y1VxOXhNPSJ9fSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIA==\"}}"

Is it a known bug?
Are there any ways to avoid this problem to get viewing key?

Can you share the name of the image you’ve been using? Looks like a bug we fixed a while back

Hi @Cashmaney,
The docker image is enigmampc/secret-network-bootstrap-sw:latest and its digest is sha256:868ccbdc67415d2777f99d9d4adaedcd4d149b583fa18c64ce529d7b7105d979.

Can you try using enigmampc/secret-network-sw-dev:v1.0.2? It should be working

1 Like

Yes, it works! thank you, @Cashmaney.

1 Like