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

Make sure to update speculative chain head in accept. #437

Merged
merged 1 commit into from
Jul 30, 2018
Merged

Conversation

joelburget
Copy link
Contributor

The scenario is covered in
#428, but in short, if
we're mining but two new blocks come in over the network:

(1) The first will clear the speculative chain.
(2) The second previously would have been a noop here --
removeProposedTxes does nothing in this case, but we need to update
the speculative chain head to the new block.

The important invariant identified by @guojian1234 that this now
maintains is
minter.speculativeChain.head.blockNumber >= minter.chain.head.blockNumber.

Fixes #428.

The scenario is covered in
#428, but in short, if
we're mining but two new blocks come in over the network:

(1) The first will clear the speculative chain.
(2) The second previously would have been a noop here --
    `removeProposedTxes` does nothing in this case, but we need to update
    the speculative chain head to the new block.

The important invariant identified by @guojian1234 that this now
maintains is
`minter.speculativeChain.head.blockNumber >= minter.chain.head.blockNumber`.

Fixes #428.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants