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

ethcore: don't validate difficulty when ignoring seal check #9470

Merged
merged 3 commits into from
Sep 6, 2018

Conversation

andresilva
Copy link
Contributor

Should fix #9461. We weren't validating the PoW itself but were immediately rejecting the block based on its difficulty.

@andresilva andresilva added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Sep 4, 2018
Copy link
Collaborator

@sorpaas sorpaas left a comment

Choose a reason for hiding this comment

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

LGTM overall. @andresilva I think we should add a short docs in both Engine::verify_block_basic and Engine::verify_block_unordered, stating that those two functions won't be called if check_seal is false. Just in case those caught us in surprise when writing new engine impls.

@5chdn 5chdn added this to the 2.1 milestone Sep 5, 2018
@andresilva
Copy link
Contributor Author

@sorpaas Good idea, added a comment about it.

Copy link
Collaborator

@ordian ordian left a comment

Choose a reason for hiding this comment

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

LGTM. Should we wait for confirmation in #9461 before merging?

@ordian ordian added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Sep 5, 2018
@5chdn 5chdn merged commit 39a1262 into master Sep 6, 2018
@5chdn 5chdn deleted the andre/fix-no-seal-check branch September 6, 2018 02:37
@thefallentree
Copy link
Contributor

This change misses 1 place, where it still checks "SealArity" when --no-seal-check is passed and nullEngine is specfied.

see logs here

018-10-10 03:51:16 UTC IO Worker #1 TRACE ethcore_sync::chain::handler  Resetting downloads for NewBlocks
2018-10-10 03:51:16 UTC IO Worker #0 WARN client  Stage 1 block verification failed for 0x2691…9410: Error(Block(InvalidSealArity(Mismatch { expected:
0, found: 2 })), State { next_error: None, backtrace: InternalBacktrace { backtrace: Some(stack backtrace:
   0:     0x55c50be87dac - <no info>
   1:     0x55c50be87322 - <no info>
   2:     0x55c50bb1a977 - <no info>
   3:     0x55c50bb1ac84 - <no info>
   4:     0x55c50b6bb886 - <no info>
   5:     0x55c50b6b8ca3 - <no info>
   6:     0x55c50b54b511 - <no info>
   7:     0x55c50b4df43a - <no info>
   8:     0x55c50b4799fb - <no info>
   9:     0x55c50b1e1355 - <no info>
  10:     0x55c50b1bf45f - <no info>
  11:     0x55c50b1b0760 - <no info>
  12:     0x55c50b19ab65 - <no info>
  13:     0x55c50b197283 - <no info>
  14:     0x55c50b20943e - <no info>
  15:     0x55c50b23456b - <no info>
  16:     0x55c50b1e487b - <no info>
  17:     0x55c50b1e5116 - <no info>
  18:     0x55c50bf10569 - <no info>
  19:     0x55c50b1f1a12 - <no info>
  20:     0x55c50bee870a - <no info>
  21:     0x55c50bee6205 - <no info>
  22:     0x7f230e9636b9 - <no info>
  23:     0x7f230e48341c - <no info>
  24:                0x0 - <no info>) } })
2018-10-10 03:51:16 UTC IO Worker #0 ERROR client
Bad block detected: InvalidSealArity(Mismatch { expected: 0, found: 2 })
RLP: f9025bf90256a0c4dd91199f2c825898cb34d2fa0af638b52dedbc8bbfc944092f278e74928210a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a04ea3c53618ea61c8e1671321175efe7ec2b7f65ca29d0e8eefa52751012133baa056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002018347c94c80845bb419ebb861d683010810846765746886676f312e3131856c696e7578000000000000000000c7d0e8d6647fafd02589a2bdaabc23243e7f8e0142651687d5b17583eafd3924439706658d5bca5b279efadfc7c1506794e39c9040da702e2d0692236d8d969601a00000000000000000000000000000000000000000000000000000000000000000880000000000000000c0c0
Header: Header { parent_hash: 0xc4dd91199f2c825898cb34d2fa0af638b52dedbc8bbfc944092f278e74928210, timestamp: 1538529771, number: 1, author: 0x0000000000000000000000000000000000000000, transactions_root: 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421, uncles_hash: 0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347, extra_data: [214, 131, 1, 8, 16, 132, 103, 101, 116, 104, 134, 103, 111, 49, 46, 49, 49, 133, 108, 105, 110, 117, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, 208, 232, 214, 100, 127, 175, 208, 37, 137, 162, 189, 170, 188, 35, 36, 62, 127, 142, 1, 66, 101, 22, 135, 213, 177, 117, 131, 234, 253, 57, 36, 67, 151, 6, 101, 141, 91, 202, 91, 39, 158, 250, 223, 199, 193, 80, 103, 148, 227, 156, 144, 64, 218, 112,
46, 45, 6, 146, 35, 109, 141, 150, 150, 1], state_root: 0x4ea3c53618ea61c8e1671321175efe7ec2b7f65ca29d0e8eefa52751012133ba, receipts_root: 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421, log_bloom: 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, gas_used: 0, gas_limit: 4704588, difficulty: 2, seal: [[160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [136, 0, 0, 0, 0, 0, 0, 0, 0]], hash: Some(0x2691730337f6440ba774279a55a3d99b83449d5328df44777fd9ebbdc2389410) }
Uncles:
Transactions:

@thefallentree
Copy link
Contributor

If this is fixed, I think parity will be able to use nullEngine and --no-seal-check to connect to GETH clique chains.

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.

PoW check despite using no-seal-check during import
5 participants