Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Enable sealing when engine is ready #10938

Merged
merged 1 commit into from
Aug 6, 2019
Merged

Conversation

grbIzl
Copy link
Collaborator

@grbIzl grbIzl commented Aug 2, 2019

This PR fixes the following scenario appeared after #10529 and #10745 :

  1. If the node in POA network is not a proposer on this round, its sealing state set to SealingState::NotReady and consequently miner's sealing is set to disabled.
  2. After it the local transaction comes, this code https://github.com/paritytech/parity-ethereum/blob/master/ethcore/src/miner/miner.rs#L989 is trying to prepare and update sealing, sealing state of the engine is SealingState::Ready (because some work is required), but unfortunately sealing state of the miner is still disabled and attempt to prepare_and_update_sealing fails at the beginning.

Solution: try re-enable sealing state of the miner, if sealing state of the engine is SealingState::Ready

Closes #10936

@grbIzl grbIzl requested a review from dvdplm August 2, 2019 14:58
@grbIzl grbIzl added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. B1-patch-beta 🕷🕷 labels Aug 2, 2019
Copy link
Collaborator

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

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

LGTM, good catch.
The prepare_and_update_sealing code is a bit scary to touch and I wonder if we can remove the call to maybe_enable_sealing() from inside the prepare_pending_block and instead move it to the top of prepare_and_update_sealing now that all three branches need the call? It would make the code a little less painful to read. I haven't checked for other code that calls prepare_pending_block though.

@dvdplm dvdplm added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Aug 5, 2019
@ordian ordian closed this Aug 5, 2019
@ordian ordian reopened this Aug 5, 2019
@ddorgan ddorgan closed this Aug 5, 2019
@ddorgan ddorgan reopened this Aug 5, 2019
@dvdplm dvdplm merged commit 13ccb9f into master Aug 6, 2019
dvdplm added a commit that referenced this pull request Aug 6, 2019
* master:
  Allow default block parameter to be blockHash (#10932)
  Enable sealing when engine is ready (#10938)
  Fix some warnings and typos. (#10941)
ordian added a commit that referenced this pull request Aug 7, 2019
* master:
  journaldb changes (#10929)
  Allow default block parameter to be blockHash (#10932)
  Enable sealing when engine is ready (#10938)
  Fix some warnings and typos. (#10941)
  Updated security@parity.io key (#10939)
  Change the return type of step_inner function. (#10940)
  get rid of hidden mutability of Spec (#10904)
  simplify BlockReward::reward implementation (#10906)
  Kaspersky AV whitelisting (#10919)
  additional arithmetic EVM opcode benchmarks (#10916)
  [Cargo.lock] cargo update -p crossbeam-epoch (#10921)
  Fixes incorrect comment. (#10913)
  Add file path to disk map write/read warnings (#10911)
s3krit pushed a commit that referenced this pull request Aug 14, 2019
ordian added a commit that referenced this pull request Aug 15, 2019
* master:
  [evmbin] fix compilation (#10976)
  Update to latest trie version. (#10972)
  [blooms-db] Fix benchmarks (#10974)
  Fix ethcore/benches build. (#10964)
  tx-pool: accept local tx with higher gas price when pool full (#10901)
  Disable unsyncable expanse chain (#10926)
  Extract Machine from ethcore (#10949)
  removed redundant state_root function from spec, improve spec error types (#10955)
  Add support for Energy Web Foundation's new chains (#10957)
  [evmbin] add more tests to main.rs (#10956)
  Fix compiler warnings in util/io and upgrade to edition 2018 Upgrade mio to latest (#10953)
  unify loading spec && further spec cleanups (#10948)
  refactor: Refactor evmbin CLI (#10742)
  journaldb changes (#10929)
  Allow default block parameter to be blockHash (#10932)
  Enable sealing when engine is ready (#10938)
  Fix some warnings and typos. (#10941)
  Updated security@parity.io key (#10939)
  Change the return type of step_inner function. (#10940)
@niklasad1 niklasad1 deleted the EnableSealingWhenEngineIsReady branch September 13, 2019 13:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Authority nodes are not mining transactions and blocks.
5 participants