Skip to content

dashmate: Tenderdash keeps transient CheckTx rejections forever (keep-invalid-txs-in-cache = true) #5803

Open

Description

@PastaPastaPasta

dashmate's Tenderdash template hard-codes keep-invalid-txs-in-cache = true (packages/dashmate/templates/platform/drive/tenderdash/config.toml.dot). Tenderdash documents the setting as safe only when "it's not possible for any invalid transaction to become valid again in the future" (config/config.go). Platform has rejections that do not meet that condition. The clearest is consensus error 10506 (InvalidAssetLockProofCoreChainHeightError): CheckTx refuses a ChainLock asset-lock proof whose height is above Platform's last_committed_core_height, and the same bytes become valid as soon as Platform's Core view catches up.

What happens today on a node that refused such a transition:

  • Tenderdash's rejected-transaction cache (internal/mempool/cache.go, v1.7.0–v1.8.2) has no timestamps. An entry leaves it only by LRU eviction (cache-size = 15000 in dashmate), Remove, a mempool flush, or a node restart. A resubmission refreshes it.
  • ttl-duration (24 h on mainnet and testnet) and purgeExpiredTxs apply to admitted transactions only, never to refused ones.
  • A refused transaction is never gossiped, so only the node that ran CheckTx holds its hash.
  • With Tenderdash 1.8 and rs-dapi, resubmitting the same bytes to that node fails before CheckTx ("create a new state transition with different hash"). feat(mempool)!: return cached CheckTx rejection for resubmitted transactions tenderdash#1530 (unreleased) answers with the cached rejection instead, still without re-running CheckTx.

So once a node refuses a transition for a transient reason, it never admits those bytes again. Clients can work around it only by building new signed bytes. The SDK does this for asset-lock funding: it raises user_fee_increase, then uses a ChainLock proof at a new height. Small networks (devnets, regtest, a few endpoints) still get stuck when every reachable node holds the hash, and each workaround spends part of the asset lock on fees.

Assess and choose one:

  1. Set keep-invalid-txs-in-cache = false in dashmate (or make it configurable, defaulting to false). Measure the cost: how often CheckTx re-runs for resubmitted invalid transactions, and whether that opens a DoS cost that the cache currently absorbs.
  2. In dashpay/tenderdash, revalidate transient rejections: let the ABCI application mark a CheckTx rejection as transient (for example, by code or by a response field) so that Tenderdash does not cache it, or caches it with an expiry, while permanent rejections stay cached as today.

Done when a node that refused a transition with a transient error, such as 10506, admits the same bytes once the condition clears, without a restart. Clients keep their current fresh-bytes recovery for nodes that have not upgraded.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions