Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Handle validation failures when fast importing blocks #741

Merged
merged 4 commits into from Feb 3, 2019

Conversation

ajsutton
Copy link
Contributor

@ajsutton ajsutton commented Feb 1, 2019

PR description

When a fast import block fails validation we need to halt the import and retry. Previously we incorrectly ignored the failure and continued trying to import future blocks (which would also fail validation because the parent doesn't exist).

}

@Test
public void shouldReturnExceptionallyCompletedFutureWhenBlockImportFails() {
Copy link
Contributor

Choose a reason for hiding this comment

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

(optional) Might also be good to have a test that imports a sequence of blocks and fails early in that sequence. Then we can check that fastImportBlock doesn't get called for the blocks after the failure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. Done.

@ajsutton ajsutton merged commit 9045ce1 into PegaSysEng:master Feb 3, 2019
@ajsutton ajsutton deleted the NC-2212 branch February 3, 2019 01:50
rain-on pushed a commit to rain-on/pantheon that referenced this pull request Feb 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants