Skip to content

Conversation

@spalladino
Copy link
Contributor

This PR splits TxReceipt.status into two separate fields to
better distinguish between block finalization level and transaction
execution outcome.

New TxStatus values (block finalization level):

  • DROPPED - Tx dropped by P2P node
  • PENDING - Tx pending in mempool
  • PROPOSED - Tx included in a proposed block
  • CHECKPOINTED - Block checkpointed on L1
  • PROVEN - Checkpoint proven on L1
  • FINALIZED - Proven on a finalized L1 block

New TxExecutionResult enum (execution outcome):

  • SUCCESS - Transaction executed successfully
  • APP_LOGIC_REVERTED - App logic reverted
  • TEARDOWN_REVERTED - Teardown phase reverted
  • BOTH_REVERTED - Both app logic and teardown reverted

This PR also adds an option to waitForTxReceipt so that the user can choose the finalization status of the receipt. This is set to default to CHECKPOINTED, so we can preserve old behaviour where we do not proceed with an action until the tx was checkpointed to L1.

Key changes:

  • Updated TxReceipt class with new fields and helper methods
    (isSuccess(), isReverted(), isMined(), isPending(),
    isDropped())
  • Added finalized block tracking to archiver with
    getFinalizedL2BlockNumber() and getCheckpointedL2BlockNumber()
    methods
  • Updated getSettledTxReceipt in BlockStore to determine proper
    finalization level based on archiver state
  • Set default waitForStatus to CHECKPOINTED

🤖 Generated with Claude Code

@spalladino spalladino added the ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure label Jan 19, 2026
@spalladino spalladino force-pushed the palla/inclusion-status-in-tx-receipt branch 2 times, most recently from c10c9e3 to c2217cb Compare January 20, 2026 15:01
Comment on lines +832 to +840
if (blockNumber <= finalizedBlockNumber) {
status = TxStatus.FINALIZED;
} else if (blockNumber <= provenBlockNumber) {
status = TxStatus.PROVEN;
} else if (blockNumber <= checkpointedBlockNumber) {
status = TxStatus.CHECKPOINTED;
} else {
status = TxStatus.PROPOSED;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Feels like this is going to be used in multiple places in the codebase so maybe it should be a utility in foundation (alongside getFinalizedL2BlockNumber() so that it's easy to change in the future?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah ok, I see this is the source for the 'finalized' definition. Ignore the part about creating helpers in foundation.

// );

expect(txReceipt.status).toBe(TxStatus.SUCCESS);
expect(txReceipt.isMined() && txReceipt.isSuccess()).toBe(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, are these flags orthogonal?

Copy link
Contributor

Choose a reason for hiding this comment

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

ooo mined=included in a block while success=executed correctly. I'd rename isSuccess to make it clearer. Maybe hasExecutedSuccessfully?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's weird because separating the status like this makes think an unmined but successfully executed tx is possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. Renamed to hasExecutionSucceeded and hasExecutionReverted.

@spalladino spalladino force-pushed the palla/inclusion-status-in-tx-receipt branch 2 times, most recently from 59968d2 to 342c421 Compare January 21, 2026 18:25
@spalladino spalladino added this pull request to the merge queue Jan 21, 2026
@spalladino spalladino removed this pull request from the merge queue due to a manual request Jan 21, 2026
@spalladino spalladino force-pushed the palla/inclusion-status-in-tx-receipt branch from 342c421 to fc1c705 Compare January 21, 2026 19:11
@spalladino spalladino enabled auto-merge January 21, 2026 19:12
@spalladino spalladino added this pull request to the merge queue Jan 21, 2026
Merged via the queue into next with commit efeffb8 Jan 21, 2026
16 checks passed
@spalladino spalladino deleted the palla/inclusion-status-in-tx-receipt branch January 21, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants