-
Notifications
You must be signed in to change notification settings - Fork 12
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
Report malice on sibling blocks from the same validator #196
Conversation
I fixed gnosischain/posdao-test-setup#60 a bit and tried to use that for manual testing this PR. Unfortunately, it seems that the duplicated node is not reported. The steps to reproduce:
In
|
Fixed in poanetwork/posdao-contracts@570f377
|
This was originally written by @vkomenda, then squashed for easier rebasing on master. Cleanup of `received_step_hashes` was moved to `verify_block_family`, since `on_prepare_block` does not exist on master, and a unit test was added. Original commit messages: added the map of received block header hashes do not return an error and remove older received block records optimised older record removal block hash comparison optimisation and the weak client ref fix SIBLING_MALICE_DETECTION_PERIOD constant review comments using step numbers instead of block numbers
Co-Authored-By: David <[email protected]>
Regarding this error:
Sorry, it seems that was my fault: after POSDAO contracts refactoring the |
This comment is still actual: #196 (comment) But I noticed that works sometimes: I tried to launch the test about 10 times but only caught the right behavior 2 times. Both times I saw the warning In both cases I started the duplicated node on block number I don't know if that is expected behavior, because the condition https://github.com/poanetwork/parity-ethereum/blob/afck-siblings/ethcore/src/engines/authority_round/mod.rs#L1552 didn't work immediately and took place only sometimes. |
That's strange; could you try again, with sibling_malice_detection_period set to, say, 1000? I'd just like to make sure that it's not just because our LRU cache is too small. |
Unfortunately, that didn't help: I hardcoded But I still see the following warning for some blocks as expected:
This time I caught the error Maybe the reason is that the If that's the reason, then maybe use |
I'm attaching node logs, hope they might be helpful. The |
So if I understand correctly, you run the network with multiple nodes for a single validator, but without any special code to create bad blocks?
In the log files you uploaded, it looks like the latter happened. Did the reporting work in that case? It should be fine if nodes don't report themselves. After all, most real attackers wouldn't do that either. |
Yes, there are three validators (
Yes. I just meant that happened not immediately after I had launched the duplicated node (
Yes, the But I mean that I didn't see the error for every block the
OK, so the reason that I didn't see the error for every block is that the two nodes ( Is that correct? |
I think so, yes. So it may be working as expected. |
Three (node1, node2, node3). Others are just candidates (we could just turn them off).
If you open the logs I attached, you will see So, I guess everything is OK here and we can merge this. |
Ah, great, I had missed that! That makes sense. I think it's working fine then. |
Backport of openethereum#11160