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

[Ready 1/2] Fork choice rewrite #865

Merged
merged 22 commits into from
Apr 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
088181b
initial fork-choice refactor
mratsim Apr 2, 2020
7759055
Add fork_choice test for "no votes"
mratsim Apr 3, 2020
b2c7034
Initial test with voting: fix handling of unknown validators and pare…
mratsim Apr 6, 2020
cc712b7
Fix tiebreak of votes
mratsim Apr 6, 2020
e9d9c73
Cleanup debugging traces
mratsim Apr 6, 2020
6e2e28b
Complexify the vote test
mratsim Apr 6, 2020
a2e41b9
fakeHash use the bigEndian repr of number + fix tiebreak for good
mratsim Apr 6, 2020
8af3440
Stash changes: found critical bug in nimcrypto `==` and var openarray
mratsim Apr 6, 2020
051b0e9
Passing fork choice tests with varying votes
mratsim Apr 6, 2020
1d0b408
Add FFG fork choice scenario + fork choice to the test suite
mratsim Apr 6, 2020
30bcbb1
Not sure why lmdb / rocksdb reappeared in rebase
mratsim Apr 6, 2020
4947db0
Add sanity checks to .nimble file + integrate fork choice tests to th…
mratsim Apr 6, 2020
17d9ed3
Cleanup debugging echos
mratsim Apr 7, 2020
133b6fd
nimcrypto fix https://github.com/status-im/nim-beacon-chain/pull/864 …
mratsim Apr 7, 2020
10848b7
Turn fork choice exception-free
mratsim Apr 7, 2020
211901a
Cleanup "result" to ensure early return is properly used
mratsim Apr 7, 2020
d3227b0
Add a comment on private/public error code vs Result
mratsim Apr 7, 2020
925ab9f
result -> results following https://github.com/status-im/nim-beacon-c…
mratsim Apr 7, 2020
22eebc8
Address comments:
mratsim Apr 7, 2020
e12b89f
re-enable all sanity checks
mratsim Apr 7, 2020
b5355ca
tag no raise for process_attestation
mratsim Apr 7, 2020
5aba3b5
use raises defect everywhere in fork choice and fix process_attestati…
mratsim Apr 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion AllTests-mainnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ OK: 2/2 Fail: 0/2 Skip: 0/2
+ Multiaddress to ENode OK
```
OK: 2/2 Fail: 0/2 Skip: 0/2
## Fork Choice + Finality [Preset: mainnet]
```diff
+ fork_choice - testing finality #01 OK
+ fork_choice - testing finality #02 OK
+ fork_choice - testing no votes OK
+ fork_choice - testing with votes OK
```
OK: 4/4 Fail: 0/4 Skip: 0/4
## Honest validator
```diff
+ Attestation topics OK
Expand Down Expand Up @@ -234,4 +242,4 @@ OK: 4/4 Fail: 0/4 Skip: 0/4
OK: 8/8 Fail: 0/8 Skip: 0/8

---TOTAL---
OK: 145/148 Fail: 3/148 Skip: 0/148
OK: 149/152 Fail: 3/152 Skip: 0/152
10 changes: 9 additions & 1 deletion AllTests-minimal.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ OK: 2/2 Fail: 0/2 Skip: 0/2
+ Multiaddress to ENode OK
```
OK: 2/2 Fail: 0/2 Skip: 0/2
## Fork Choice + Finality [Preset: minimal]
```diff
+ fork_choice - testing finality #01 OK
+ fork_choice - testing finality #02 OK
+ fork_choice - testing no votes OK
+ fork_choice - testing with votes OK
```
OK: 4/4 Fail: 0/4 Skip: 0/4
## Honest validator
```diff
+ Attestation topics OK
Expand Down Expand Up @@ -261,4 +269,4 @@ OK: 4/4 Fail: 0/4 Skip: 0/4
OK: 8/8 Fail: 0/8 Skip: 0/8

---TOTAL---
OK: 160/163 Fail: 3/163 Skip: 0/163
OK: 164/167 Fail: 3/167 Skip: 0/167
5 changes: 4 additions & 1 deletion beacon_chain.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ task test, "Run all tests":
# price we pay for that.

# Minimal config
buildBinary "proto_array", "beacon_chain/fork_choice/", "-d:const_preset=minimal"
buildBinary "fork_choice", "beacon_chain/fork_choice/", "-d:const_preset=minimal"
buildBinary "all_tests", "tests/", "-d:chronicles_log_level=TRACE -d:const_preset=minimal"
# Mainnet config
buildBinary "proto_array", "beacon_chain/fork_choice/", "-d:const_preset=mainnet"
buildBinary "fork_choice", "beacon_chain/fork_choice/", "-d:const_preset=mainnet"
buildBinary "all_tests", "tests/", "-d:const_preset=mainnet"

# Generic SSZ test, doesn't use consensus objects minimal/mainnet presets
Expand All @@ -69,4 +73,3 @@ task test, "Run all tests":
# State sim; getting into 4th epoch useful to trigger consensus checks
buildBinary "state_sim", "research/", "", "--validators=1024 --slots=32"
buildBinary "state_sim", "research/", "-d:const_preset=mainnet", "--validators=1024 --slots=128"

5 changes: 5 additions & 0 deletions beacon_chain/fork_choice/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Fork choice implementations

References:
- https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/fork-choice.md
- https://github.com/protolambda/lmd-ghost
Loading