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

Discard child block with parent_hash not matching hash of imported block #1684

Merged
merged 4 commits into from
Apr 2, 2019

Commits on Apr 2, 2019

  1. Remove obsolete ConsensusEnsurer

    As a result of #1657 out-of-place parent blocks are marked as non-consensus
    more reliably, i.e. they will eventually be fetched even if first attempt is
    unsuccessful.
    
    The `ConsensusEnsurer` module, on the contrary, only tried refetching block
    once, and left it as-is if the refetch failed. Now it is not needed anymore.
    goodsoft committed Apr 2, 2019
    Configuration menu
    Copy the full SHA
    9dbf51d View commit details
    Browse the repository at this point in the history
  2. Expand non-consensus block regression test to test for race conditions

    Consider a root block `A`, old chain `-- B -- C` and new one `-- B' -- C'`.
    Due to asynchronous nature of realtime fetcher it is possible for block
    `B` to be imported _later_ than the entire chain `-- B' -- C'`.
    
    In this case we should discard block `C'` and let it be refetched.
    When that happens, block `B` gets discarded to make sure block `B'` gets
    eventually fetched and the chain becomes consistent.
    goodsoft committed Apr 2, 2019
    Configuration menu
    Copy the full SHA
    89430a5 View commit details
    Browse the repository at this point in the history
  3. Discard child block with parent_hash not matching hash of imported block

    Consider a root block `A`, old chain `-- B -- C` and new one `-- B' -- C'`.
    Due to asynchronous nature of realtime fetcher it is possible for block
    `B` to be imported _later_ than the entire chain `-- B' -- C'`.
    
    In this case we should discard block `C'` and let it be refetched.
    When that happens, block `B` gets discarded to make sure block `B'` gets
    eventually fetched and the chain becomes consistent.
    goodsoft committed Apr 2, 2019
    Configuration menu
    Copy the full SHA
    6450c3a View commit details
    Browse the repository at this point in the history
  4. Remove obsolete InvalidConsensus.Worker

    This worker only handled one of invalid consensus cases, i.e. when a parent
    block lost consensus, but the child one didn't.
    Even then it worked only when all blocks are reliably and sequentially
    imported (certainly not our case), and only once on indexer launch.
    
    Now this particular case is covered by previous commit, and we don't need
    this worker at all.
    goodsoft committed Apr 2, 2019
    Configuration menu
    Copy the full SHA
    0e15873 View commit details
    Browse the repository at this point in the history