Commit Graph

47 Commits

Author SHA1 Message Date
Ivan Martinez
0d29b2cd91 Makes test naming consistent across codebase (#1636) 2019-02-22 07:11:26 -08:00
Raul Jordan
19abe81472
Implement Randao Reveal Signing in Proposer Client (#1650)
* finish the BLS API wrapper

* all tests passing

* unexported comment

* gofmt tests for bls

* block processing test into own package to avoid cycle

* randao tests pass

* blocks test passing

* use common deposit generator

* helper

* resolved import cycle

* setup initial

* builds

* almost done with blockchain tests

* fix blockchain tests

* getting through with chaintests

* revert client change

* lint

* sync master conflict gazelle

* randao test fixes

* randao proposer impl

* tests pass
2019-02-20 12:58:34 -06:00
Raul Jordan
b0f5324303
Implement BLS Based RANDAO (#1633)
* finish the BLS API wrapper

* all tests passing

* unexported comment

* gofmt tests for bls

* block processing test into own package to avoid cycle

* randao tests pass

* blocks test passing

* use common deposit generator

* helper

* resolved import cycle

* setup initial

* builds

* almost done with blockchain tests

* fix blockchain tests

* getting through with chaintests

* revert client change

* lint

* sync master conflict gazelle

* randao test fixes
2019-02-19 23:07:28 -06:00
Raul Jordan
2425bef5c7
Update Configuration, Naming, and GenesisStart to Accommodate Randao (#1647)
* signature on startup configuration

* remove ref to hash32s for randao

* completed changes
2019-02-19 14:24:00 -06:00
Raul Jordan
ab511cb022
Move Deposit Encoding to Helpers Package (#1644)
* move deposits

* finish moving deposit helpers
2019-02-19 12:05:34 -06:00
terence tsao
8c04ced1a6 Name Changes to Align with V0.3 (#1621)
* fixed epoch_processing

* penalize->slash

* exit -> voluntary_exit

*  SEED_LOOKAHEAD -> MIN_SEED_LOOKAHED

* ENTRY_EXIT_DELAY -> ACTIVATION_EXIT_DELAY

* `INCLUDER_REWARD_QUOTIENT` -> `ATTESTATION_INCLUSION_REWARD_QUOTIEN`

* LatestIndexRoots -> LatestActiveIndexRoots

* `MIN_VALIDATOR_WITHDRAWAL_EPOCHS` -> `MIN_VALIDATOR_WITHDRAWAL_DELAY`

* MAX_WITHDRAWALS_PER_EPOCH -> MAX_EXIT_DEQUEUES_PER_EPOCH

* ETH1_DATA_VOTING_PERIOD -> EPOCHS_PER_ETH1_VOTING_PERIOD

* SLOT_DURATION -> SECONDS_PER_SLOT

* EPOCH_LENGTH -> SLOTS_PER_EPOCH

* SLOT_DURATION -> SECONDS_PER_SLOT take 2

* rest of the misc fixes for config name changes

* remove tools/bootnode/.!74296!bootnode.go

* `current_epoch_start_shard` -> `current_shuffling_start_shard`, `current_shuffling_epoch`, `current_shuffling_see`

* go fmt

* fixed comment

* updated pseudocode comments

* merged master
2019-02-18 10:52:16 -06:00
Raul Jordan
1d72cee59c Revive Our Demo Config for Local Testing (#1602) 2019-02-14 15:01:07 -08:00
Raul Jordan
ae13bb5c83
Use Tree Hashing Algorithm Everywhere for Block Roots and State Root (#1577)
* begin using tree hash instead of hash for state and blocks

* replace with ssz

* rem references to vote cache

* replace all instances of state/block hash with root

* goimports

* almost every test in the world fails

* goimports

* all tests pass, tree hash across repo
2019-02-14 14:04:47 -06:00
terence tsao
4cadd534db
Update Genesis Slot and Epoch (#1537) 2019-02-10 23:09:35 +01:00
Raul Jordan
12524ae8dd
Update RANDAO to Match Spec (#1533)
* fix bug in eth1 data vote count increases

* updating attester slashings

* is double vote and attester pseudocode

* attester slashing revamp complete

* exits processing complete

* all block operations aligned to spec

* completed test revamp

* builds properly

* all done FINALLY

* deprecate all instances of old randao logic

* fix all broken tests and cleanup randao references across repo

* builds but tests failing

* fixing broken chaintests

* only chaintests fail now

* randao fully updated

* add bls todo

* lint

* travis

* fix unresolved property in struct

* remove used randao var
2019-02-09 14:35:51 -06:00
terence tsao
c46a583acb
Update MaxDeposit Config Names (#1539) 2019-02-09 14:09:09 +01:00
Raul Jordan
7ae19ec370
Align Block Operations to Spec (#1512)
* fix bug in eth1 data vote count increases

* updating attester slashings

* is double vote and attester pseudocode

* attester slashing revamp complete

* exits processing complete

* all block operations aligned to spec

* completed test revamp

* builds properly

* all done FINALLY

* address comms

* comment

* no more confusing is double vote function

* surround
2019-02-08 15:53:36 -06:00
Nishant Das
b07a3c3bb8 Update Deposit Contract (#1494)
* Update deposit Contarct

* updating deposit trie

* add verifyMerkleBranch

* fix test

* fixed all tests

* fix other tests

* fixing a test

* All tests are fixed

* lint

* fix lint
2019-02-08 11:01:15 -06:00
terence tsao
b099f5d216 Aligning ETH2.0 spec - Update Validator Fields (#1513)
* remove ValidatorRegistryDeltaBlock

* fixed tests after changing validator functions to epoch first

* gaz
2019-02-06 15:46:05 -06:00
Nishant Das
c48f9c96e0
Allow Simulated Backend to Advance Chain (#1445)
* initialize beacon state separately

* extracting out testcase into another func

* creating function for simulated objects

* creating simulated object struct

* final clean up

* documentation

* lint

* adding chain advancer

* review comments

* replacing lib

* adding initialization for chain and new vars in struct

* added func

* fixing tests and all other bugs

* fixing tests

* docs

* adding a new nil block function

* adding test

* remove check for nil blocks

* godoc

* fixing merge conflicts, tests

* fix test
2019-02-06 10:18:55 +08:00
terence tsao
21ac564631
Aligning ETH2.0 spec - Make Epoch First Citizen (Package: Validators) (#1460) 2019-02-04 21:34:33 +01:00
terence tsao
176aa2688e
Implement Attestation Pool for Fork Choice (#1402) 2019-02-04 00:05:34 +01:00
Nishant Das
9a4418c990
Clean Up Simulated Backend (#1433)
* initialize beacon state separately

* extracting out testcase into another func

* creating function for simulated objects

* creating simulated object struct

* final clean up

* documentation

* lint

* review comments
2019-02-03 18:58:36 +08:00
Ivan Martinez
5b209a2b18 Update DepositRoot to Eth1Data (#1403)
* update proto fileds

* Start writing ProcessETH1Data function

* More progress on tests

* Continue more work on tests

* Fix almost all the tests

* Fix all tests

* Fix everything

* Fix after rebase

* Fix for suggestions and fix per-epoch operation

* Remove method usage

* Fix build

* Fix suggestions

* Fix merge issues and suggestions

* Fix rebase issues

* Remove the error from ProcessETH1Data

* WIP write test

* Update test to reach crosslinks

* Revert "Update test to reach crosslinks"

This reverts commit 5ff9177f96c12c98c54eafffcfb385bd966b0888.

* Revert "WIP write test"

This reverts commit f7e7ed715c4af6b7e3c95643f7ebf85830caf638.
2019-02-02 16:24:42 -05:00
Raul Jordan
cec6c8de83 Standardize Naming of Shared Packages, Remove Deprecated Packages (#1435)
* rem txpool

* standardize repo shared utils, remove deprecated items

* complete

* package lvl godoc
2019-01-31 10:53:58 +08:00
Raul Jordan
425ec4eee1
Add NoSigVerification Option to State Transition (#1434)
* no sig verify

* gofmt
2019-01-30 13:45:01 +01:00
terence tsao
c0f36e467b
Eliminate Custody Logic for Phase 0 (#1408) 2019-01-30 11:11:13 +01:00
Ivan Martinez
e9cfc08549 Update all beacon constants to latest in spec (#1407)
* Update all beacon constants

* Fix documentation

* Fix sync time in config

* Fix some names
2019-01-29 12:16:50 +08:00
Ivan Martinez
8d88394b28 Hotfix/rename caspervotes (#1384)
* Begin renaming

* Missing goimports

* Continue rename

* Fix errors and mismatches

* Run proto script

* Fix proto

* Fix some more issues

* Fix tests
duh

* Fix goimports
2019-01-28 14:13:37 +08:00
terence tsao
af1c382828
Remove Shard Committees 5 - Align Core Package (#1379) 2019-01-25 08:20:02 -08:00
Nishant Das
7ff544fddf
Fix travis and Other Linter Errors (#1356)
* fix travis and other linter errors

* remove megacheck
2019-01-21 13:35:34 +08:00
Raul Jordan
d47db5e834
Advance Beacon State Transition Part 6: Simulate Validator Exits (#1302)
* deposit definition according to latest spec

* ssz decode input data tests

* fix todo

* ignore XXX fields in struct

* fix

* timestamp

* gazelle run processing

* process deposit complete

* all logic complete

* verify merkle branch

* gazelle

* process deposit func

* diff cov 1005

* add todo"

* all test cases written down

* most tests complete

* ttl timestamp fail

* 100% code coverage in deposits

* fix params

* encode deposit data helper func

* state transition with no slots failing with panic at calcnewblockhashes

* smaller deposits for chain start

* state advancement benches

* ran go tests

* bazel

* improve the thing

* lint

* works works works

* all conflicts fixed

* edit readme to specify tests format

* edit readme to specify tests format

* skip slots works yay

* gazelle

* edit readme to specify tests format

* wrapped up all randao simulation

* fix

* passing

* goimports

* move to slices pkg

* deadcode

* deposit yaml tests

* created deposit trie implementation in Go

* created deposit trie implementation in Go

* gazelle

* merkle branch generation

* merkle branch generation

* more merkle debugging

* fix deposit trie

* include new merkle trie functions

* update all deposit operations

* capitalize

* advancing deposits fully works, grows the validator set

* wrap up time formatting

* lint fix

* include all information in the README

* edit conf

* revert

* clean up before merge

* successfully e2e test proposer slashings

* casper advancement

* wrap up casper slashings

* gazelle

* fix conf

* fix comments

* advance validator exits complete

* wrap up readme
2019-01-15 01:02:49 +08:00
Raul Jordan
e25436557a Advance Beacon State Transition Part 5: Simulate Casper Slashings (#1298)
* deposit definition according to latest spec

* ssz decode input data tests

* fix todo

* ignore XXX fields in struct

* fix

* timestamp

* gazelle run processing

* process deposit complete

* all logic complete

* verify merkle branch

* gazelle

* process deposit func

* diff cov 1005

* add todo"

* all test cases written down

* most tests complete

* ttl timestamp fail

* 100% code coverage in deposits

* fix params

* encode deposit data helper func

* state transition with no slots failing with panic at calcnewblockhashes

* smaller deposits for chain start

* state advancement benches

* ran go tests

* bazel

* improve the thing

* lint

* works works works

* all conflicts fixed

* edit readme to specify tests format

* edit readme to specify tests format

* skip slots works yay

* gazelle

* edit readme to specify tests format

* wrapped up all randao simulation

* fix

* passing

* goimports

* move to slices pkg

* deadcode

* deposit yaml tests

* created deposit trie implementation in Go

* created deposit trie implementation in Go

* gazelle

* merkle branch generation

* merkle branch generation

* more merkle debugging

* fix deposit trie

* include new merkle trie functions

* update all deposit operations

* capitalize

* advancing deposits fully works, grows the validator set

* wrap up time formatting

* lint fix

* include all information in the README

* edit conf

* revert

* clean up before merge

* successfully e2e test proposer slashings

* casper advancement

* wrap up casper slashings

* gazelle

* fix conf

* fix comments
2019-01-14 23:54:27 +08:00
Raul Jordan
3c5f5cfcd3
Advance Beacon State Transition Part 4: Simulate Proposer Slashings (#1297)
* deposit definition according to latest spec

* ssz decode input data tests

* fix todo

* ignore XXX fields in struct

* fix

* timestamp

* gazelle run processing

* process deposit complete

* all logic complete

* verify merkle branch

* gazelle

* process deposit func

* diff cov 1005

* add todo"

* all test cases written down

* most tests complete

* ttl timestamp fail

* 100% code coverage in deposits

* fix params

* encode deposit data helper func

* state transition with no slots failing with panic at calcnewblockhashes

* smaller deposits for chain start

* state advancement benches

* ran go tests

* bazel

* improve the thing

* lint

* works works works

* all conflicts fixed

* edit readme to specify tests format

* edit readme to specify tests format

* skip slots works yay

* gazelle

* edit readme to specify tests format

* wrapped up all randao simulation

* fix

* passing

* goimports

* move to slices pkg

* deadcode

* deposit yaml tests

* created deposit trie implementation in Go

* created deposit trie implementation in Go

* gazelle

* merkle branch generation

* merkle branch generation

* more merkle debugging

* fix deposit trie

* include new merkle trie functions

* update all deposit operations

* capitalize

* advancing deposits fully works, grows the validator set

* wrap up time formatting

* lint fix

* include all information in the README

* edit conf

* revert

* clean up before merge

* successfully e2e test proposer slashings

* fix comments
2019-01-12 10:11:43 +08:00
Raul Jordan
4b775e76d5 Advance Beacon State Transition Part 3: Simulate Validator Deposits (#1276)
* deposit definition according to latest spec

* ssz decode input data tests

* fix todo

* ignore XXX fields in struct

* fix

* timestamp

* gazelle run processing

* process deposit complete

* all logic complete

* verify merkle branch

* gazelle

* process deposit func

* diff cov 1005

* add todo"

* all test cases written down

* most tests complete

* ttl timestamp fail

* 100% code coverage in deposits

* fix params

* encode deposit data helper func

* state transition with no slots failing with panic at calcnewblockhashes

* smaller deposits for chain start

* state advancement benches

* ran go tests

* bazel

* improve the thing

* lint

* works works works

* all conflicts fixed

* edit readme to specify tests format

* edit readme to specify tests format

* skip slots works yay

* gazelle

* edit readme to specify tests format

* wrapped up all randao simulation

* fix

* passing

* goimports

* move to slices pkg

* deadcode

* deposit yaml tests

* created deposit trie implementation in Go

* created deposit trie implementation in Go

* gazelle

* merkle branch generation

* merkle branch generation

* more merkle debugging

* fix deposit trie

* include new merkle trie functions

* update all deposit operations

* capitalize

* advancing deposits fully works, grows the validator set

* wrap up time formatting

* lint fix

* include all information in the README

* revert

* clean up before merge

* nishant comments
2019-01-12 09:10:39 +08:00
Raul Jordan
5258f3d3d1
Advance Beacon State Transition Part 2: Simulate Block Randao at Every Slot (#1252) 2019-01-11 18:55:01 +08:00
Raul Jordan
c86bd54ad1
Simulated Backend State Transition Tests Part 1 (#1221) 2019-01-06 09:25:43 -06:00
terence tsao
141a8dba87
Reformat Configs for Readability (#1256) 2019-01-05 20:36:05 -08:00
terence tsao
074ac07dc8
Replace Validator Status Code With Activation/Exit Slot (#1233) 2019-01-04 22:39:07 -08:00
terence tsao
8d1718edf9 Helper Functions to Retrieve Total Validator Balances (#1087)
* helper functions to get active validator total balances

* forgot to * params.BeaconConfig().Gwei

* tests

* GetEffectiveBalance comments & MaxDepositInGwei in config

* format
2018-12-13 15:46:44 +08:00
terence tsao
ecbf50c2fe Use Validator Status in Proto (#1082)
* use validator status code in proto

* typo & constant casing
2018-12-11 22:40:17 -06:00
terence tsao
071cc85bc6
Update Shuffle Function (#1055) 2018-12-09 11:21:23 -08:00
Nishant Das
954af67882
Change to Golang Crypto Library (#1054)
* deprecate hashutil

* Revert "deprecate hashutil"

This reverts commit 6ee40f916c6fcf73fe372b980ba5645fe0456f9d.

* changing to golang crypto lib

* Add comment

* add test
2018-12-07 01:01:51 +08:00
terence tsao
52a987ee44 Change Hashing Function from Blake2b to Sha3 (#1045)
* switched from blake2b to sha3

* fixed test

* use sha3 from eth1.0
2018-12-05 12:13:33 +08:00
terence tsao
b8a9e839e7
clean up BeaconBlock's validator fields (#1037) 2018-12-03 19:05:22 -08:00
terence tsao
57038551d6
Update ValidatorRecord Proto (#1030) 2018-12-02 18:17:48 -08:00
Nishant Das
e0d13ec304 goimports (#882) 2018-11-21 06:27:04 -05:00
terence tsao
cb65c556d6
Config Updates to Latest Spec (#868) 2018-11-20 17:41:20 -08:00
Jie Hou
bd400707c2 Implement YAML Based Shuffle Test (#815) 2018-11-18 22:54:04 -08:00
Nishant Das
f46ee335bd
Allow Sync Service to Query State Of Network (#787)
* adding proto messages

* adding fields

* adding new service

* new changes

* checking in file from syncFix

* fixing test

* add test

* adding to node

* goimports

* adding query service to sync services

* sync working

* finally works

* fix test

* lint

* fix build

* fix test
2018-11-19 09:59:11 +08:00
Andrei Ivasko
85653335f1 Standartize params for BeaconChain and Validator projects (#796)
* Standardize params for BeaconChain and Validator projects

* gofmt

* various changes to bring up to standards

* lint

* linter 2, not sure why travis complains

* revert service_test.go
2018-11-19 00:39:35 +08:00
Raul Jordan
6476fb54af
Dynamic Chain Test Language Package With YAML Parser (#681) 2018-11-07 14:07:41 -05:00