-
Notifications
You must be signed in to change notification settings - Fork 65
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
Reproduce attack and implement fix for liveness issue with ABA/commoncoin #12
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #12 +/- ##
===================================================
- Coverage 98.50917% 98.49138% -0.01779%
===================================================
Files 18 18
Lines 872 928 +56
Branches 122 130 +8
===================================================
+ Hits 859 914 +55
Misses 11 11
- Partials 2 3 +1 |
d8821c2
to
b2b297a
Compare
|
||
from honeybadgerbft.exceptions import RedundantMessageError, AbandonedNodeError | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
CONF_PHASE = strtobool(environ.get('CONF_PHASE', '1')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are environment variables documented anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason to disable the conf phase except for testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll remove the switch. It was put there temporarily to ease the demonstration of the attack.
By putting the CONF
phase logic in a function we could also simply mock that function in order to demonstrate the attack.
@amiller The This test should demonstrate the liveness issue, and consequently should only be invoked for demonstration purposes. Consequently invoking the test requires passing the option pytest -v -m demo test/demo_attack_issue59.py -s So, the following two alternatives won't work: # file not picked up by default because it does not start with "test_"
pytest -v -m demo -s # option "-m demo" missing
pytest -v test/demo_attack_issue59.py -s |
This looks ready to go to me. |
Addresses amiller/HoneyBadgerBFT#59:
NOTES
The adversarial network scheduler is currently limited to the minimal case of 4 nodes with one node being the attacker.
Modifying the network scheduler to support multiple nodes should not be too difficult, and is currently work in progress.
Logging was added for troubleshooting purposes. It is currently only meant to be used when testing, and future work will extend this work so that logging is available when the application is run in real scenarios.
Reproducing the Attack
Run: