Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

SCP-3343 fixed intermittent rollback failures in PAB #305

Merged
merged 1 commit into from
Feb 11, 2022
Merged

Conversation

bwbush
Copy link
Collaborator

@bwbush bwbush commented Feb 7, 2022

The cause of the rollback failure was that Plutus.ChainIndex.UtxoState.rollbackWith computes the current tip of the index as the slot of the last transaction, ignoring the fact that there may be empty blocks after that. When a rollback with a target falls within such a sequence of empty blocks, the rollbackWith function misinterprets this as a TipMismatch.

This change simply checks to see if the rollback is unnecessary because it is
through a sequence of empty blocks ending at the former tip.

This was manually tested on the private Marlowe testnet, where we verified that rollback failures no long occur when they just rollback through empty blocks.

Pre-submit checklist:

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
    • Relevant tickets are mentioned in commit messages
    • Formatting, materialized Nix files, PNG optimization, etc. are updated
  • PR
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

The cause of the rollback failure was that `Plutus.ChainIndex.UtxoState.rollbackWith`
computes the current tip of the index as the slot of the last transaction, ignoring
the fact that there may be empty blocks after that. When a rollback with a target
falls within such a sequence of empty blocks, the rollbackWith function
misinterprets this as a TipMismatch.

This change simply checks to see if the rollback is unnecessary because it is
through a sequence of empty blocks ending at the former tip.
@bwbush bwbush marked this pull request as ready for review February 7, 2022 23:19
Copy link
Contributor

@sjoerdvisscher sjoerdvisscher left a comment

Choose a reason for hiding this comment

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

LGTM. @raduom can you verify?

@bwbush bwbush merged commit 46d22fa into main Feb 11, 2022
@bwbush bwbush deleted the SCP-3343mrd branch February 11, 2022 12:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants