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

Bugs in block production #1570

Closed
mrBliss opened this issue Feb 4, 2020 · 2 comments
Closed

Bugs in block production #1570

mrBliss opened this issue Feb 4, 2020 · 2 comments
Assignees
Labels
bug Something isn't working consensus issues related to ouroboros-consensus
Milestone

Comments

@mrBliss
Copy link
Contributor

mrBliss commented Feb 4, 2020

  1. If our current chain fragment is empty at the time we produce a block, due to data corruption or due to a clock change (moved backwards), we would connect the block we produce to Genesis instead of the tip of the ImmutableDB.

    Details

    We wouldn't actually have been able to produce this block, as ChainDB.getPastLedger would have not been able to return the ledger for the Genesis (it would exit block production with TraceNoLedgerState). Even if it could return that ledger, this block wouldn't ever be adopted. Moreover, this block would likely have been empty anyway, as the Mempool would likely have been empty because it is unlikely that we would have received transaction already but not yet blocks. Furthermore, its possible contents would have been validated against the wrong (genesis) ledger.

  2. If we must strip off a block (because we received a block for the same slot from another node) and the current chain fragment is empty after that (because we're at the start of the blockchain or because of data corruption), then we'd produce a block connected to genesis.
    a. If our chain is really empty after stripping, i.e., we're at genesis, then we would produce a block with the wrong block number.
    b. If our chain is not really empty but just truncated because of corruption, then we would produce a block connected to genesis with the wrong block number (similar to case 1).

@nfrisby
Copy link
Contributor

nfrisby commented Feb 4, 2020

I clarified on Slack: the action item here is essentially to finish PR 1544. We'd ideally exercise more of these cases during tests, but that's going to be quite difficult and moreover will almost certainly cause most of our existing consensus-focused properties to fail. Therefore, these might be candidates for the first "unrestricted threadnet tests" where we ensure many fewer invariants in the test configuration (eg we do not ensure k+ blocks in 2k slots) and only check for extreme/fatal failures.

@mrBliss
Copy link
Contributor Author

mrBliss commented Feb 6, 2020

Fixed by #1544. Related: #1584, fixed by #1589.

@mrBliss mrBliss closed this as completed Feb 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working consensus issues related to ouroboros-consensus
Projects
None yet
Development

No branches or pull requests

2 participants