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

core: check Chain Attack using Penalty System #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hackmod
Copy link
Member

@hackmod hackmod commented Jan 6, 2019

WIP
based on the PirlGuard by Pirl Team.

Ideas

  • make core.BadHashes configurable.
  • warning system for admin/exchanges

See also

cc: @masterdubs, @0x1337coding
cc: @magnalucus @kimmyeonghun

@hackmod hackmod force-pushed the penalty-system branch 3 times, most recently from 34985e9 to 67356f0 Compare January 8, 2019 06:41
@hackmod
Copy link
Member Author

hackmod commented Jan 8, 2019

image

@hackmod hackmod force-pushed the penalty-system branch 3 times, most recently from 288f92c to 0fa8224 Compare January 8, 2019 21:46
masterdubs and others added 2 commits January 9, 2019 06:49
based on the PirlGuard by Pirl Team <[email protected]>

Original authors:
 - 0x1337coding <[email protected]>
 - masterdubs <[email protected]>

See also Penalty System by Horizon(Zencash)

manually applied by hackmod <[email protected]> Sun Jan 6 22:55:53 2019 +0900
 * extract routines as core/penaltysystem.go
 * small fix for geth-1.8.21 develop branch

Co-authored-by: 0x1337coding <[email protected]>
Co-authored-by: hackmod <[email protected]>
- remove not used difficultyWeight()
- remove sort, blocks already sorted
- check syncing status like as eth.syncing
- use core.BadHashes to save possible attack hash
@hackmod
Copy link
Member Author

hackmod commented Jan 9, 2019

attack detected (delayed chain detected. log BAD BLOCK)
image

bad hash detected (after delayed chain detected, bad hash at the fork block tip registered into the core.BadHashes
image

 * log and metric some information
 * exit immediatly after CheckDelayedChain(chain) error
@hackmod hackmod self-assigned this Jan 9, 2019
@hackmod hackmod added the work in progress work in progress label Jan 9, 2019
@hackmod
Copy link
Member Author

hackmod commented Jan 10, 2019

for DelayedBlock < 20 or some threadshold, only log messages are printed.
(and we can see some reorg metrics with --metrics option paramter)
image

- call CheckDelayedChain in reorg()
- always log Chain split/reorg
- add chain/reorg/add,drop metrics
@hackmod
Copy link
Member Author

hackmod commented Jan 10, 2019

call CheckDelayedChain() in reorg() and add some detail info.
image

@hackmod
Copy link
Member Author

hackmod commented Jan 11, 2019

"chain/reorg/add,drop" metrics added
image

geth monitor --attach http://127.0.0.1:8545 "chain/reorg"
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work in progress work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants