Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for genesis block in replayer #6431

Merged
merged 1 commit into from
Oct 20, 2020

Conversation

psteckler
Copy link
Member

@psteckler psteckler commented Oct 19, 2020

In the replayer, check that the chain leading to the target state hash includes the genesis block, which occupies global slot 0.

The replayer starts with a genesis ledger, and if we replay commands from some block other than the genesis block, we'd get an invalid ledger.

Deepthi observed an archive db with gaps in the parent ids, which made it possible to try to replay against an invalid chain. The nonce check prevented the replayer from proceeding, but the new check in this PR makes it evident what the problem is.

Tested against that archive db using a target state hash which started at such a gap, and also with target state hash which led back to the genesis block.

Also added another log to indicate the number of commands being replayed.

Copy link
Member

@deepthiskumar deepthiskumar left a comment

Choose a reason for hiding this comment

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

Thank you!

@psteckler psteckler added ci-build-me Add this label to trigger a circle+buildkite build for this branch ready-to-merge Adding this label will trigger mergify and trigger CI to run and merge the PR labels Oct 19, 2020
@mergify mergify bot merged commit d7b914c into develop Oct 20, 2020
@mergify mergify bot deleted the feature/replayer-check-for-genesis branch October 20, 2020 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-build-me Add this label to trigger a circle+buildkite build for this branch ready-to-merge Adding this label will trigger mergify and trigger CI to run and merge the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants