celestia-core icon indicating copy to clipboard operation
celestia-core copied to clipboard

Propagate an error message when a tx already exists in the mempool

Open rootulp opened this issue 1 year ago • 7 comments

Context

https://github.com/rollkit/rollkit/issues/725

Problem

When clients attempt to PayForData in celestia-app, celestia-core doesn't return a full error message when a tx already exists in the mempool. The celestia-appd binary will log:

6:26PM ERR Error on broadcastTxCommit err="tx already exists in cache" module=rpc

but celestia-core returns to celestia-app something like

[rootulp] txResp: tx_response:<txhash:"7AE1E7393D312FFA9E9965DD5958FE83E0A741A0F3345B68A2F7F6039EECB396" codespace:"sdk" code:19 > , err <nil>

[rootulp] core_access.go SubmitPayForData response: code: 19
codespace: sdk
data: ""
events: []
gas_used: "0"
gas_wanted: "0"
height: "0"
info: ""
logs: []
raw_log: ""
timestamp: ""
tx: null
txhash: 7AE1E7393D312FFA9E9965DD5958FE83E0A741A0F3345B68A2F7F6039EECB396
, err: <nil>

which means celestia-app can't forward a full error message to celestia-node or rollkit.

Proposal

Modify the txResponse to include a descriptive error message or return an error. Prior to making any changes, investigate if the relevant code path has been modified from vanilla tendermint/tendermint.

rootulp avatar Feb 07 '23 04:02 rootulp