snarkOS icon indicating copy to clipboard operation
snarkOS copied to clipboard

[Feature] Track reason for failed txs

Open vicsn opened this issue 2 months ago • 1 comments

🚀 Feature

I see two main options to enable this:

  1. validators track abort and reject reasons, and propagate the error code in blocks.
  2. all nodes only track reject reasons and store them locally. Because unconfirmed rejected transactions are in a block, clients can replay the rejection reason locally.

Advantages of 1: more comprehensive reporting Advantages of 2: less bandwidth usage

In both cases, data is stored to disk and returned via API. We would benefit from merging the compact blocks feature first, which touches this logic too.

alternative

We could run speculative finalization on broadcasted transactions, but this would give both false positive and false negatives, so is of unclear utility.

vicsn avatar Oct 14 '25 17:10 vicsn

Seems quite beneficial, if integrated properly, I can't think of any real downsides to this besides general state bloat.

2 things to consider:

  1. Design should properly reflect a default error code for the rejected and aborted transactions before this migration
  2. Might be some overlap on potentially adding Events or Logs of sorts to the DB

raychu86 avatar Oct 20 '25 16:10 raychu86