Zilliqa / zq2

Zilliqa 2.0 code base
Apache License 2.0
9 stars 0 forks source link

Z2-Converter API Mainnet : GetTransaction #1666

Open chetan-zilliqa opened 3 weeks ago

chetan-zilliqa commented 3 weeks ago

Issue Summary:

Here are the URLs for ZQ1 and ZQ2. ZQ2 : http://34.124.218.159:4201/ ZQ1 : http://34.124.185.137:4201/

Calling GetTransaction on the ZQ1 and ZQ2 has the following diff.

Result:

Missing keys:

Keys present in ZQ1 but missing in ZQ2:
  root['result']['receipt']['event_logs']

Different Keys:

Values that differ between ZQ2 and ZQ1:
  root['result']['data']:
    ZQ2: 87bb6c6f
    ZQ1: 87BB6C6F
  root['result']['nonce']:
    ZQ2: 24
    ZQ1: 25
  root['result']['receipt']['cumulative_gas']:
    ZQ2: 0
    ZQ1: 55
  root['result']['senderPubKey']:
    ZQ2: 0x030b38f396c737863b5e9df983a17c8263bfaf440c30d78840a7c447c740ff33ab
    ZQ1: 0x030B38F396C737863B5E9DF983A17C8263BFAF440C30D78840A7C447C740FF33AB
  root['result']['signature']:
    ZQ2: 0xa6207c7a9ed2357b77a55b1488ea4b3a224fde23c73652946345b095649f204f14444ee7ba5786b0ffc92a186c7b06e0bfde6205346a9717acb468d30776311300
    ZQ1: 0xA6207C7A9ED2357B77A55B1488EA4B3A224FDE23C73652946345B095649F204F14444EE7BA5786B0FFC92A186C7B06E0BFDE6205346A9717ACB468D307763113
  root['result']['version']:
    ZQ2: 2147549186
    ZQ1: 65538

Observations: 1) nonce is increased by 1 on the converted persistence. 2) The cumulative gas parameter is set to 0. 3) The version field is different. 4) The event_logs filed is missing in ZQ2. This is expected as it is a scilla transaction. 5) format of values in lowercase which is fine.

Conclusion: If the above differences are expected and align with the migration to ZQ2, no further action is required. However, if these differences are unexpected, they may indicate issues that must be addressed.

chetan-zilliqa commented 6 days ago

ZQ1:

curl --request POST \
  --url http://34.124.185.137:4201/ \
  --header 'Content-Type: application/json' \
  --data '{
    "id": "1",
    "jsonrpc": "2.0",
    "method": "GetTransaction",
        "params": ["0x4964bf50c8f598f6deedaed6c34cc5d739f8a9a8aecf8eb548206af8594e6c89"]
}'

Output:

{
    "id": "1",
    "jsonrpc": "2.0",
    "result": {
        "ID": "4964bf50c8f598f6deedaed6c34cc5d739f8a9a8aecf8eb548206af8594e6c89",
        "amount": "0",
        "data": "{\"_tag\": \"assign_stake_reward\", \"params\": [{\"vname\": \"ssnreward_list\", \"type\": \"List SsnRewardShare\", \"value\": [{\"constructor\": \"SsnRewardShare\", \"argtypes\": [], \"arguments\": [\"0x812dd251d3ef36ba94acc4f2803ce090386cff91\", \"274794\"]}, {\"constructor\": \"SsnRewardShare\", \"argtypes\": [], \"arguments\": [\"0xe411ab7119664cbae57f67601851edc08c569a0f\", \"274794\"]}]}, {\"vname\": \"reward_blocknum\", \"type\": \"Uint32\", \"value\": \"710000\"}]}",
        "gasLimit": "10000",
        "gasPrice": "1000000000",
        "nonce": "59",
        "receipt": {
            "accepted": false,
            "cumulative_gas": "3414",
            "epoch_num": "710003",
            "event_logs": [
                {
                    "_eventname": "SSN assign reward",
                    "address": "0xd62bdccb7cfd8d564e645fb74a0d10741e73a4f2",
                    "params": [
                        {
                            "type": "ByStr20",
                            "value": "0xe411ab7119664cbae57f67601851edc08c569a0f",
                            "vname": "ssn_address"
                        },
                        {
                            "type": "Uint128",
                            "value": "602824509000000000",
                            "vname": "total_reward"
                        }
                    ]
                },
                {
                    "_eventname": "SSN assign reward",
                    "address": "0xd62bdccb7cfd8d564e645fb74a0d10741e73a4f2",
                    "params": [
                        {
                            "type": "ByStr20",
                            "value": "0x812dd251d3ef36ba94acc4f2803ce090386cff91",
                            "vname": "ssn_address"
                        },
                        {
                            "type": "Uint128",
                            "value": "16762434000000000",
                            "vname": "total_reward"
                        }
                    ]
                }
            ],
            "success": true,
            "transitions": [
                {
                    "accepted": false,
                    "addr": "0x38cef22914277a24993235eef92c4a0b3e7e42ed",
                    "depth": 0,
                    "msg": {
                        "_amount": "0",
                        "_recipient": "0xd62bdccb7cfd8d564e645fb74a0d10741e73a4f2",
                        "_tag": "assign_stake_reward",
                        "params": [
                            {
                                "type": "List (SsnRewardShare)",
                                "value": [
                                    {
                                        "argtypes": [],
                                        "arguments": [
                                            "0x812dd251d3ef36ba94acc4f2803ce090386cff91",
                                            "274794"
                                        ],
                                        "constructor": "SsnRewardShare"
                                    },
                                    {
                                        "argtypes": [],
                                        "arguments": [
                                            "0xe411ab7119664cbae57f67601851edc08c569a0f",
                                            "274794"
                                        ],
                                        "constructor": "SsnRewardShare"
                                    }
                                ],
                                "vname": "ssnreward_list"
                            },
                            {
                                "type": "Uint32",
                                "value": "710000",
                                "vname": "reward_blocknum"
                            },
                            {
                                "type": "ByStr20",
                                "value": "0x412b55a0ebc1001f930aba8dc107022a3a2ba484",
                                "vname": "initiator"
                            }
                        ]
                    }
                }
            ]
        },
        "senderPubKey": "0x039CCA4E7D77EC58F597A43DBBFD872ED3A274F21BE8FE0A213C8F89DC994ACAEE",
        "signature": "0x1FDDFBFF576AD415C9C8A5A1561714800CE1AB50BCA5EEC02C59BF063289AA0054086F64B8AA00E16F3A850BD0538D104CAC186B18EA8D699394A6F91992071E",
        "toAddr": "38cef22914277a24993235eef92c4a0b3e7e42ed",
        "version": "65537"
    }
}

vs ZQ2

curl --request POST \
  --url http://34.124.218.159:4201/ \
  --header 'Content-Type: application/json' \
  --data '{
    "id": "1",
    "jsonrpc": "2.0",
    "method": "GetTransaction",
        "params": ["0x4964bf50c8f598f6deedaed6c34cc5d739f8a9a8aecf8eb548206af8594e6c89"]
}'

output:

{
    "jsonrpc": "2.0",
    "id": "1",
    "result": {
        "ID": "4964bf50c8f598f6deedaed6c34cc5d739f8a9a8aecf8eb548206af8594e6c89",
        "version": "65537",
        "nonce": "58",
        "toAddr": "38cef22914277a24993235eef92c4a0b3e7e42ed",
        "senderPubKey": "0x039cca4e7d77ec58f597a43dbbfd872ed3a274f21be8fe0a213c8f89dc994acaee",
        "amount": "0",
        "signature": "0x1fddfbff576ad415c9c8a5a1561714800ce1ab50bca5eec02c59bf063289aa0054086f64b8aa00e16f3a850bd0538d104cac186b18ea8d699394a6f91992071e",
        "receipt": {
            "cumulative_gas": "8",
            "epoch_num": "710003",
            "success": true
        },
        "gasPrice": "1000000000",
        "gasLimit": "10000",
        "data": "{\"_tag\": \"assign_stake_reward\", \"params\": [{\"vname\": \"ssnreward_list\", \"type\": \"List SsnRewardShare\", \"value\": [{\"constructor\": \"SsnRewardShare\", \"argtypes\": [], \"arguments\": [\"0x812dd251d3ef36ba94acc4f2803ce090386cff91\", \"274794\"]}, {\"constructor\": \"SsnRewardShare\", \"argtypes\": [], \"arguments\": [\"0xe411ab7119664cbae57f67601851edc08c569a0f\", \"274794\"]}]}, {\"vname\": \"reward_blocknum\", \"type\": \"Uint32\", \"value\": \"710000\"}]}"
    }
}

If we notice here following fields are missing in ZQ2:

eys present in ZQ1 but missing in ZQ2:
  root['result']['receipt']['accepted']
  root['result']['receipt']['event_logs']
  root['result']['receipt']['transitions']

cc @maxconway