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

InstantSeal fix #6223

Merged
merged 1 commit into from
Aug 4, 2017
Merged

InstantSeal fix #6223

merged 1 commit into from
Aug 4, 2017

Conversation

debris
Copy link
Collaborator

@debris debris commented Aug 3, 2017

@arkpar 's fix for stackoverflow in InstantSeal engine

frame #297: 0x00000001024bc874 parity`ethcore::miner::miner::{{impl}}::update_sealing(self=0x0000000109edfa10, chain=&MiningBlockChainClient @ 0x00007000181fae90) + 2196 at miner.rs:1138
    frame #298: 0x00000001024be995 parity`ethcore::miner::miner::{{impl}}::chain_new_blocks(self=0x0000000109edfa10, chain=&MiningBlockChainClient @ 0x00007000181fcc50, imported=&[ethcore_bigint::hash::H256] @ 0x00007000181fcc60, _invalid=&[ethcore_bigint::hash::H256] @ 0x00007000181fcc70, enacted=&[ethcore_bigint::hash::H256] @ 0x00007000181fcc80, retracted=&[ethcore_bigint::hash::H256] @ 0x00007000181fcc90) + 1589 at miner.rs:1236
    frame #299: 0x00000001024489e4 parity`ethcore::client::client::{{impl}}::import_sealed_block(self=0x0000000109e46010, block=SealedBlock @ 0x00007000181fd188) + 1908 at client.rs:1837
    frame #300: 0x00000001024b1f11 parity`ethcore::miner::miner::{{impl}}::seal_and_import_block_internally::{{closure}}(sealed=SealedBlock @ 0x00007000181fe668) + 257 at miner.rs:532
    frame #301: 0x0000000101fe1fa1 parity`core::result::{{impl}}::map<ethcore::block::SealedBlock,ethcore::error::BlockError,bool,closure>(self=Result<ethcore::block::SealedBlock, ethcore::error::BlockError> @ 0x00007000181ff718, op=closure @ 0x00007000181ffbc0) + 417 at result.rs:458
    frame #302: 0x00000001024b1a2f parity`ethcore::miner::miner::{{impl}}::seal_and_import_block_internally(self=0x0000000109edfa10, chain=&MiningBlockChainClient @ 0x0000700018201388, block=ClosedBlock @ 0x0000700018201398) + 2319 at miner.rs:529
    frame #303: 0x00000001024bc874 parity`ethcore::miner::miner::{{impl}}::update_sealing(self=0x0000000109edfa10, chain=&MiningBlockChainClient @ 0x0000700018204b70) + 2196 at miner.rs:1138
    frame #304: 0x00000001024ba3ad parity`ethcore::miner::miner::{{impl}}::import_own_transaction(self=0x0000000109edfa10, chain=&MiningBlockChainClient @ 0x0000700018206a60, pending=PendingTransaction @ 0x0000700018206a70) + 3069 at miner.rs:958
    frame #305: 0x000000010024303b parity`parity_rpc::v1::helpers::dispatch::{{impl}}::dispatch_transaction<ethcore::client::client::Client,ethcore::miner::miner::Miner>(self=0x0000700018208950, signed_transaction=PendingTransaction @ 0x0000700018207e68) + 347 at dispatch.rs:164

@5chdn 5chdn added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Aug 3, 2017
@gavofyork
Copy link
Contributor

code looks fine, what's the explanation of the fix?

@debris
Copy link
Collaborator Author

debris commented Aug 4, 2017

The bug occurred when I sent 2 transactions one after another. They caused miner to enter endless loop of sealing and updating new block. Returning { Seal::None } when there are no more transactions to seal makes miner exit the loop.

Is it correct @arkpar ?

@5chdn 5chdn requested a review from arkpar August 4, 2017 10:25
@arkpar
Copy link
Collaborator

arkpar commented Aug 4, 2017

InstantSeal would mine a new block instantly after a new block has been imported. All it took is a single transaction to trigger an infinite loop. The fix just prevents InstantSeal from sealing empty blocks.

@arkpar arkpar added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Aug 4, 2017
@debris debris merged commit 62153b1 into master Aug 4, 2017
@debris debris deleted the instant_seal_fix branch August 4, 2017 10:47
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.

4 participants