0

I'm dry-running an operation with an xtz amount that is close to my max balance to an unrevealed tz2 account on mainnet to get the fees.

When estimating for fees I run two RPC endpoints at the same time:

  • /chains/main/blocks/head/helpers/scripts/run_operation with an empty 64 encoded byte array signature:
{
    "chain_id": "NetXdQprcVkpaWU",
    "operation": {
        "contents": [
            {
                "amount": "234023908",
                "storage_limit": "60000",
                "gas_limit": "800000",
                "kind": "transaction",
                "fee": "0",
                "destination": "tz2TrNfsT9zt1RW6oefQBrebLg8kMHbcvdRd",
                "source": "tz1...",
                "counter": "7613069"
            }
        ],
        "signature": "edsig...",
        "branch": "BLUJG76seoXDxuq8UBWDPvFPJv3StaVckxfijCtvemKmm3tzNYt"
    }
}

And

  • /chains/main/blocks/<branch>/helpers/forge/operations with this json:
 {
    "contents": [
        {
            "amount": "234023908",
            "storage_limit": "60000",
            "gas_limit": "800000",
            "kind": "transaction",
            "fee": "0",
            "destination": "tz2TrNfsT9zt1RW6oefQBrebLg8kMHbcvdRd",
            "source": "tz1...",
            "counter": "7613069"
        }
    ],
    "branch": "BLUJG76seoXDxuq8UBWDPvFPJv3StaVckxfijCtvemKmm3tzNYt"
}

To get the bytes needed for the storage fee.

I'm in a situation where I cannot check the response of each individual call but I know the error I get is:

Failed to parse the request body: No case matched:
  At /kind, unexpected string instead of endorsement
  At /kind, unexpected string instead of seed_nonce_revelation
  At /kind, unexpected string instead of double_endorsement_evidence
  At /kind, unexpected string instead of double_baking_evidence
  At /kind, unexpected string instead of activate_account
  At /kind, unexpected string instead of proposals
  At /kind, unexpected string instead of ballot
  At /kind, unexpected string instead of reveal
  At /kind, unexpected string instead of transaction
  At /kind, unexpected string instead of origination
  At /kind, unexpected string instead of delegation

Usually the real reason can be found in between the list but, in this case, nothing else is returned. Is there any way I can investigate further about this error and its cause?

If the problem would be the amount I'm giving is too high, I'd be getting a cannot_pay_storage_fee kind of error, so I'm guessing the problem is elsewhere?

6
  • I did not manage to reproduce this problem. Could you post the full json that you're sending, and the command you're using to send it? Also, the JSON you've posted is missing the signature and chain_id fields, is this on purpose?
    – arvidj
    Oct 26 '20 at 8:54
  • Sorry @arvidj , posted the json for the forge endpoint I run at the same time. Updated the message with the whole process, in case it's more clear.
    – MalenaLBC
    Oct 26 '20 at 18:05
  • Huh, how weird. So the error message seems to say that your message contains a "kind" which is not in the list of possibilities. However, from the json you post, your "kind" is transaction which is in that list. What do you mean with "Usually the real reason can be found in between the list but, in this case, nothing else is returned. Is there any way I can investigate further about this error and its cause?" Are you using tezos-client to send the RPC requests? If the problem is related to gas, can you try increasing the balance in the sender account?
    – arvidj
    Oct 27 '20 at 16:14
  • Usually the No case matched error is not enough to pinpoint the real cause of an error. If, for example, my error is related to sending to an invalid tz1 address, I'd get this error but the clarifying error cause ("Invalid contract notation") would be in between the stack (More)
    – MalenaLBC
    Oct 29 '20 at 10:29
  • (Continue) "At /kind, unexpected string instead of endorsement At /kind, unexpected string instead of seed_nonce_revelation ... At /kind, unexpected string instead of reveal At /destination: Unhandled error (Failure "Invalid contract notation.") At /kind, unexpected string instead of origination At /kind, unexpected string instead of delegation". I usually just filter through these when parsing error messages until I find "Unhandled error" or something of the kind.
    – MalenaLBC
    Oct 29 '20 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.