Skip to content

Fix: handle NOT_VALIDATED status in ledger.Status() - #1417

Merged
adecaro merged 1 commit into
LFDT-Panurus:mainfrom
atharrva01:fix/fabricx-ledger-not-validated-status
Mar 11, 2026
Merged

Fix: handle NOT_VALIDATED status in ledger.Status()#1417
adecaro merged 1 commit into
LFDT-Panurus:mainfrom
atharrva01:fix/fabricx-ledger-not-validated-status

Conversation

@atharrva01

Copy link
Copy Markdown
Contributor

Problem

I noticed that ledger.Status() in the FabricX package doesn’t handle the NOT_VALIDATED state. When a transaction is still waiting to be committed (which can happen during normal block processing or orderer delays), it falls into the default case and gets marked as Invalid , even though it hasn’t failed.

// Before - NOT_VALIDATED falls into default
switch protoblocktx.Status(tx.ValidationCode()) {
case protoblocktx.Status_COMMITTED:
    return driver.Valid, nil
default:
    return driver.Invalid, nil
}

Interestingly, the finality service in the same package already handles this correctly:

case protoblocktx.Status_NOT_VALIDATED:
    return fdriver.Unknown

So right now two parts of the system interpret the same state differently.


Impact

  • Pending transactions may be reported as Invalid even though they are still in-flight
  • The consistency checker could potentially raise warnings like “transaction record is valid for vault but not for the ledger” for transactions that haven’t finalized yet
  • Callers of Ledger.Status() might interpret the result as a failure, even though the transaction is simply not validated yet

Fix

I added the missing NOT_VALIDATED case so pending transactions return Unknown. It’s a small change but keeps ledger.Status() consistent with the finality service and avoids false failure signals.

Signed-off-by: atharrva01 <atharvaborade568@gmail.com>
@atharrva01

Copy link
Copy Markdown
Contributor Author

hi @adecaro I noticed ledger.Status() didn’t handle the NOT_VALIDATED state, which could cause pending transactions to be reported as Invalid. This adds the missing case so they return Unknown, matching the behavior of the finality service.

@adecaro adecaro added the bug Something isn't working label Mar 11, 2026
@adecaro adecaro added this to the Q1/26 milestone Mar 11, 2026
@adecaro

adecaro commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Hi @atharrva01, nice catch. I'll review ASAP. Thanks for submitting this.

@adecaro
adecaro self-requested a review March 11, 2026 08:51

@adecaro adecaro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks 👍

@adecaro
adecaro merged commit 8ca60c0 into LFDT-Panurus:main Mar 11, 2026
97 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants