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

Mixed messaging on transaction confirmation/failure #6951

Closed
wbt opened this issue Aug 2, 2019 · 5 comments
Closed

Mixed messaging on transaction confirmation/failure #6951

wbt opened this issue Aug 2, 2019 · 5 comments

Comments

@wbt
Copy link
Contributor

wbt commented Aug 2, 2019

If you have a sequence of several transactions and an early one fails, once you finish approving the others so you can see the buried failure message, it may not be clear whether it failed or not.

For example: Did this transaction fail, as indicated by the red "Failed" label, or succeed, as indicated by "Transaction confirmed" on the bottom?
Mixed messaging on success

I'm not sure. Also, if it did fail, why? Hovering over the "Failed" label, even for a long while, does not produce any tooltip explaining the error, as it sometimes does. My best guess is Out Of Gas, but MetaMask prevents me from seeing for sure.

(Finally, why the horizontal scrollbar? It's just all blank white space to the right. At the top, I can see more of a wide balance figure, but the most siginficant digits on the left end of that balance are still cut off.)

Environment:

  • OS: Windows 10
  • Browser: Chrome 75.0.3770.142 (Official Build) (64-bit)
  • MetaMask Version: 6.7.3
@bdresser
Copy link
Contributor

bdresser commented Aug 2, 2019

@wbt could you email your state logs to [email protected] to help us investigate? cc @tmashuang

@wbt
Copy link
Contributor Author

wbt commented Aug 2, 2019

Unfortunately not, but I can check specific values in the JSON if you'd like.

@bdresser
Copy link
Contributor

bdresser commented Aug 2, 2019

did the transaction actually go through? what does Etherscan tell you about the tx?

could you send just the blob in your state log that describes this tx and redact whatever info you're not comfortable sharing? we're not able to reproduce as-is

@wbt
Copy link
Contributor Author

wbt commented Aug 2, 2019

It was on a private chain, so it's not on Etherscan, despite all the links pointing to check out the transaction on Etherscan (Issue #5631). The transaction display doesn't make it clear what exactly the transaction was attempting to do, and it was part of a set of >100. Reviewing the events triggered on chain, I haven't yet noticed one missing, so it's possible that it went through, but it seems almost as likely that I might just not have noticed what exactly is missing.

This was associated with attempting to set up steps to reproduce for #6949 and those steps to reproduce might still work to get this one reproducing. Unfortunately, I haven't validated that yet and don't have the time to do so at this moment nor in the next few days, but anybody else in this open-source community is welcome to try. Setting the gas amount to a lower value than the gas actually required for a transaction (but probably over the minimum transaction gas amount) early in a set of transactions seems likely to be a key step in reliably triggering a failure, when this might be observed. Per the records below, it looks like I changed the gas limit from 132775 to 52775 on a transaction where the estimated gas consumption (hidden value) was 88517. Out-of-gas also seems consistent with why the gas limit = gas used in the screenshot above.

The inconsistency within MetaMask's messages signal pretty strongly to me that this is definitely a bug somewhere in MetaMask, even if there may be other factors contributing to why the transaction failed in the first place (if indeed it did fail).

The JSON for that transaction from state logs is below, with a few annotations on hex values for readability. Redacted values with the same redaction variable name have a consistent value; offsets are made explicit where applicable.

{
  "id": redactedIdVal,
  "time": redactedTimeVal,
  "status": "confirmed",
  "metamaskNetworkId": redactedNetworkIDVal,
  "loadingDefaults": false,
  "txParams": {
    "from": "redactedFromVal",
    "to": "redactedToVal",
    "nonce": "0x96d4",// decimal 38612
    "value": "0x0",
    "data": "redactedDataVal",
    "gas": "0xce27",//decimal 52775
    "gasPrice": "0x2540be400"//10 Gwei
  },
  "type": "standard",
  "transactionCategory": "contractInteraction",
  "history": [
    {
      "id": redactedIdVal,
      "time": redactedTimeVal,
      "status": "unapproved",
      "metamaskNetworkId": redactedNetworkIDVal,
      "loadingDefaults": true,
      "txParams": {
        "from": "redactedFromVal",
        "to": "redactedToVal",
        "data": "redactedDataVal"
      },
      "type": "standard",
      "transactionCategory": "contractInteraction"
    },
    [
      {
        "op": "add",
        "path": "/txParams/value",
        "value": "0x0",
        "timestamp": redactedTimeVal-1136
      },
      {
        "op": "add",
        "path": "/txParams/gas",
        "value": "0x206a7" //decimal 132775
      },
      {
        "op": "add",
        "path": "/txParams/gasPrice",
        "value": "0x3b9aca00" //1 Gwei
      },
      {
        "op": "replace",
        "path": "/loadingDefaults",
        "value": false
      },
      {
        "op": "add",
        "path": "/gasPriceSpecified",
        "value": false
      },
      {
        "op": "add",
        "path": "/gasLimitSpecified",
        "value": false
      },
      {
        "op": "add",
        "path": "/estimatedGas",
        "value": "159c5" //0x159c5 = decimal 88517
      }
    ],
    [
      {
        "op": "replace",
        "path": "/estimatedGas",
        "value": "159c5", //0x159c5 = decimal 88517
        "note": "#newUnapprovedTransaction - adding the origin",
        "timestamp": redactedTimeVal-1152
      },
      {
        "op": "add",
        "path": "/origin",
        "value": "redactedOriginVal"
      }
    ],
    [
      {
        "op": "replace",
        "path": "/txParams/gasPrice",
        "value": "0x0",
        "note": "confTx: user updated transaction",
        "timestamp": redactedTimeVal-19794
      }
    ],
    [
      {
        "op": "replace",
        "path": "/txParams/gasPrice",
        "value": "0x2540be400",//10 Gwei
        "note": "confTx: user updated transaction",
        "timestamp": redactedTimeVal-40655
      },
      {
        "op": "replace",
        "path": "/txParams/gas",
        "value": "0xce27"//decimal 52775
      }
    ],
    [],
    [
      {
        "op": "replace",
        "path": "/status",
        "value": "approved",
        "note": "txStateManager: setting status to approved",
        "timestamp": redactedTimeVal-44303
      }
    ],
    [
      {
        "op": "add",
        "path": "/txParams/nonce",
        "value": "0x96d4",// decimal 38612
        "note": "transactions#approveTransaction",
        "timestamp": redactedTimeVal-44364
      },
      {
        "op": "add",
        "path": "/nonceDetails",
        "value": {
          "params": {
            "highestLocallyConfirmed": 0,
            "highestSuggested": 38612,
            "nextNetworkNonce": 38612
          },
          "local": {
            "name": "local",
            "nonce": 38612,
            "details": {
              "startPoint": 38612,
              "highest": 38612
            }
          },
          "network": {
            "name": "network",
            "nonce": 38612,
            "details": {
              "blockNumber": "redactedBlockNum",
              "baseCount": 38612
            }
          }
        }
      }
    ],
    [
      {
        "op": "replace",
        "path": "/status",
        "value": "signed",
        "note": "transactions#publishTransaction",
        "timestamp": redactedTimeVal-44380
      },
      {
        "op": "add",
        "path": "/rawTx",
        "value": "redactedRawTxVal"
      }
    ],
    [],
    [
      {
        "op": "add",
        "path": "/hash",
        "value": "redactedHash",
        "note": "transactions#setTxHash",
        "timestamp": redactedTimeVal-44435
      }
    ],
    [
      {
        "op": "add",
        "path": "/submittedTime",
        "value": redactedTimeVal-44435,
        "note": "txStateManager - add submitted time stamp",
        "timestamp": redactedTimeVal-44436
      }
    ],
    [
      {
        "op": "replace",
        "path": "/status",
        "value": "submitted",
        "note": "txStateManager: setting status to submitted",
        "timestamp": redactedTimeVal-44441
      }
    ],
    [
      {
        "op": "add",
        "path": "/firstRetryBlockNumber",
        "value": "redactedBlockNum+0x14",
        "note": "transactions/pending-tx-tracker#event: tx:block-update",
        "timestamp": redactedTimeVal-45767
      }
    ],
    [
      {
        "op": "add",
        "path": "/txReceipt",
        "value": {
          "blockHash": "redactedBlockHash",
          "blockNumber": "redactedBlockNum+0x16",
          "contractAddress": null,
          "cumulativeGasUsed": "ce27", //0xce27 = decimal 52775
          "from": "redactedFromVal",
          "gasUsed": "ce27",  //0xce27 = decimal 52775
          "logs": [],
          "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
          "status": "0x0",
          "to": "redactedToVal",
          "transactionHash": "redactedHash",
          "transactionIndex": "0"
        },
        "note": "transactions#confirmTransaction - add txReceipt",
        "timestamp": redactedTimeVal-46911
      }
    ],
    [
      {
        "op": "replace",
        "path": "/txReceipt/transactionIndex",
        "value": "0",
        "note": "txStateManager: setting status to confirmed",
        "timestamp": redactedTimeVal-46917
      },
      {
        "op": "replace",
        "path": "/txReceipt/cumulativeGasUsed",
        "value": "ce27" //0xce27 = decimal 52775
      },
      {
        "op": "replace",
        "path": "/txReceipt/blockNumber",
        "value": "redactedBlockNum+0x16"
      },
      {
        "op": "replace",
        "path": "/status",
        "value": "confirmed"
      }
    ],
    [
      {
        "op": "replace",
        "path": "/txReceipt/transactionIndex",
        "value": "0",
        "note": "transactions#confirmTransaction - add txReceipt",
        "timestamp": redactedTimeVal-47189
      },
      {
        "op": "replace",
        "path": "/txReceipt/cumulativeGasUsed",
        "value": "ce27"//0xce27 = decimal 52775
      },
      {
        "op": "replace",
        "path": "/txReceipt/blockNumber",
        "value": "redactedBlockNum+0x16"
      }
    ],
    [
      {
        "op": "replace",
        "path": "/txReceipt/transactionIndex",
        "value": "0",
        "note": "txStateManager: setting status to confirmed",
        "timestamp": redactedTimeVal-47199
      },
      {
        "op": "replace",
        "path": "/txReceipt/cumulativeGasUsed",
        "value": "ce27" //0xce27 = decimal 52775
      },
      {
        "op": "replace",
        "path": "/txReceipt/blockNumber",
        "value": "redactedBlockNum+0x16"
      }
    ]
  ],
  "gasPriceSpecified": false,
  "gasLimitSpecified": false,
  "estimatedGas": "159c5", //0x159c5 = decimal 88517
  "origin": "redactedOriginVal",
  "nonceDetails": {
    "params": {
      "highestLocallyConfirmed": 0,
      "highestSuggested": 38612,
      "nextNetworkNonce": 38612
    },
    "local": {
      "name": "local",
      "nonce": 38612,
      "details": {
        "startPoint": 38612,
        "highest": 38612
      }
    },
    "network": {
      "name": "network",
      "nonce": 38612,
      "details": {
        "blockNumber": "redactedBlockNum",
        "baseCount": 38612
      }
    }
  },
  "rawTx": "redactedRawTxVal",
  "hash": "redactedHash",
  "submittedTime": redactedTimeVal-44435,
  "firstRetryBlockNumber": "redactedBlockNum+0x14",
  "txReceipt": {
    "blockHash": "redactedBlockHash",
    "blockNumber": "redactedBlockNum+0x16",
    "contractAddress": null,
    "cumulativeGasUsed": "ce27",  //0xce27 = decimal 52775
    "from": "redactedFromVal",
    "gasUsed": "ce27",  //0xce27 = decimal 52775
    "logs": [],
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "status": "0x0",
    "to": "redactedToVal",
    "transactionHash": "redactedHash",
    "transactionIndex": "0"
  }
}

@tmashuang
Copy link
Contributor

I am going to close this and link another issue that is more high level which involves tx failures, subsequent transactions, and tx activity as a whole, #9053.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@wbt @bdresser @tmashuang and others