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 sealing synchronous #833

Merged
merged 1 commit into from
Oct 3, 2019
Merged

Make sealing synchronous #833

merged 1 commit into from
Oct 3, 2019

Conversation

prd-fox
Copy link
Contributor

@prd-fox prd-fox commented Oct 2, 2019

There exists some race condition when minting blocks with IBFT/Clique.

This is where a block is created, but then discarded to try again. The state is reverted and txpool reset, but fails. This also happens as we are performing operations on a constantly changing global state, instead of copies of state.

A few issues that can happen:

  • Mining stops due to the miner and txpool encountering an error. Waits for a new block to enter the network and tries again, meaning this issue only occurs on a single node network (a questionable premise).
  • a panic where the state db cannot be reverted to a prior snapshot, because the state has already been recreated for the next block
  • concurrent map iteration/write issues

Fixes #830

miner/worker.go Outdated Show resolved Hide resolved
miner/worker.go Outdated Show resolved Hide resolved
@prd-fox prd-fox force-pushed the bugfix/make-sealing-synchronous branch 2 times, most recently from b80e53f to 3a031ff Compare October 3, 2019 08:55
Fix private tx receipt setting on tasks
Remove now unnecessary locking when writing state
Move delay creation outside of goroutine to mimic Clique sealing
Handle errors appropriately
@prd-fox prd-fox force-pushed the bugfix/make-sealing-synchronous branch from fbb63d5 to 2dd2a28 Compare October 3, 2019 09:01
Copy link
Contributor

@trung trung left a comment

Choose a reason for hiding this comment

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

LGTM

Related to #830
And also would help reverting PR #684, hence permanently fix #676 and #653

@jbhurat jbhurat self-requested a review October 3, 2019 15:36
Copy link
Contributor

@jbhurat jbhurat left a comment

Choose a reason for hiding this comment

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

LGTM

Verified by running the tests that failed in #653

@jpmsam jpmsam merged commit 0c2bada into master Oct 3, 2019
@prd-fox prd-fox deleted the bugfix/make-sealing-synchronous branch October 4, 2019 12:50
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.

"Missing trie node XXX (path )" when IBFT block proposer commits block
5 participants