Commit Graph

127 Commits

Author SHA1 Message Date
terence tsao
4bc324dc95
Make Getting Epoch Assignment Generic (#1746) 2019-02-27 17:16:05 -08:00
terence tsao
9f950211d8
Rename Shard Block Root to Crosslink Data Root (#1743) 2019-02-27 15:07:39 -08:00
Ivan Martinez
136950e0c5 Update some of client to v0.3 spec (#1733)
* Update validator to v0.3 spec

* Fix typos with rename
2019-02-27 12:21:15 -08:00
Raul Jordan
f5178ef4a6 registry change fix (#1713) 2019-02-25 20:19:24 -08:00
Raul Jordan
20803b4c9d
Revert Usage of ssz.TreeHash Across Repo (#1711)
* revert using ssz.TreeHash

* gazelle
2019-02-25 21:42:31 -06:00
Raul Jordan
84142477ea
Utilize New UpdateRegistry Function (#1710)
* fix current boundary issue

* gazelle

* test fix

* deprecate old epoch processing justified hash indices

* finality fixes

* fmt

* pseudocode

* underflow conditions

* add back att fix

* remove off by one fix

* fix most tests

* fix all tests

* logging proposers

* use the update registry function

* outdated tests

* fixed check reg change

* gazelle

* tests pass

* registry change flag
2019-02-25 18:37:55 -06:00
Raul Jordan
f1114ca35c
Align Epoch Processing With Spec (#1703)
* fix current boundary issue

* gazelle

* test fix

* deprecate old epoch processing justified hash indices

* finality fixes

* fmt

* pseudocode

* underflow conditions

* add back att fix

* remove off by one fix

* fix most tests

* fix all tests
2019-02-25 15:16:12 -06:00
terence tsao
b6cc79fa2a
Save Validator Public Key -> Index in DB (#1690) 2019-02-25 09:37:02 -08:00
Raul Jordan
e19920aec1
Miscellaneous Runtime Fixes & Improvements - Raul (#1674)
* fatal if impossible to receive chainstart

* fix tests

* fix

* custom delay

* completed custom delay

* errors

* better logs, nothing at genesis

* use demo in val

* add gazelle

* log

* starting to log stuff

* pass in ops

* avoid printing the large #s for debug, still working on tests..

* all around better logging

* fixed build error in epoch process

* fixed state transiton tests

* fixed block tests

* lint

* verify sigs in randao

* ready for inclusion falg

* only print waiting when slot is not valid

* fix build

* mod config

* fixed last justified slot issue

* fix inclusion

* fixed attestation issue

* using zero hash from params instead

* fix tests

* update balance

* removed swp

* more `- genesis_slot` for logs

* rem unused log

* fix broken tests

* account for skip slots in state root computation

* fixes done

* validator guide bug fixes - 671

* epoch boundary at the last slot of the epoch

* fix epoch issue

* more balance cal logs for debugging

* greater balance

* attestaton fixes

* fixes

* addressed testrun

* fixed ejection balance

* fix tests with far future epoch

* revert sync change

* revert initial sync change

* fix changes

* off by one att fix

* revert the att fix

* address comments

* format

* fix build

* rem file
2019-02-24 20:09:45 -06:00
Nishant Das
f5c88e1bcb
Test Syncing with Another Fully Synced Service (#1594)
* clean up test

* adding test setup

* add chainstart check to sync querier

* goimports

* goimports

* backend cleanup

* adding getters

* lint

* moving to db

* gazelle

* adding more services setup

* adding more changes

* adding different test setups

* other merge issues

* imports

* fixing keys

* get intial sync able to be set up

* new changes and gazelle

* use simulated p2p

* everything finally works

* unexport fields

* revert changes from merge

* remove mock server

* add documentation

* gazelle

* add another node

* review comments

* fix tests
2019-02-23 11:36:20 +05:30
Ivan Martinez
0d29b2cd91 Makes test naming consistent across codebase (#1636) 2019-02-22 07:11:26 -08:00
Raul Jordan
dcc0672a19
Fatal if ChainStart Receiving Fails (#1665)
* fatal if impossible to receive chainstart

* fix tests
2019-02-20 15:58:23 -06:00
terence tsao
06bfda24d5 Revert "Remove Redundant Committee Assignment Getters in Validator RPC Service (#1655)" (#1664)
This reverts commit 15f8b6a10d.
2019-02-20 14:46:30 -06:00
terence tsao
15f8b6a10d
Remove Redundant Committee Assignment Getters in Validator RPC Service (#1655) 2019-02-20 11:53:49 -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
9bee695a3b
Implement Eth1Data RPC Server Functionality (#1615)
* eth1 data comments

* eth1 data RPC server side impl

* logic is data objects is empty

* finished eth1 server logic

* update comments

* fmt

* big int comparisons

* begin adding eth1 data tests

* empty data votes test runs

* all tests complete with every code branch triggered, behavior correct

* fmt, imports

* address comments

* wrapped up tests

* addressed all comments
2019-02-20 11:57:02 -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
terence tsao
c30bef0812
Implement Next Epoch Committee Assignment for RPC Server (#1641) 2019-02-19 15:31:04 -08: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
Raul Jordan
3e46381b3f
Fetch the Correct Chain Head During AttestHead (#1596)
* correct attester view of chain head and prioritize proposer

* fix attempt not working

* revise with correct logic

* attester fixess to root fetching, spec did not make sense

* comments to match code

* fix attester responsibility

* comments
2019-02-18 23:49:56 -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
c032b0f6b5
Pending Attestations RPC Server/Client Implementation (#1617)
* complete tests for integrating the attestations pool

* fix broken build
2019-02-15 18:36:40 -06:00
terence tsao
de4c8667fd Fixed Get Block Root (#1616)
* fixed epoch_processing

* test p2p

* fixed get block root and tests

* in test nightmare, yay

* fixed all the tests

* lint
2019-02-15 17:19:36 -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
89b451cb6e Move Validator Helper Functions to Helper Package (#1584)
* fixed epoch_processing

* test p2p

* refactored validator helpers to helper package

* increased validator test cov
2019-02-13 15:04:31 -06:00
Raul Jordan
f707f14cb2
Change BLS Public Key Length Check in Beacon RPC Server (#1571) 2019-02-13 12:08:25 -06:00
Raul Jordan
c4ad6f220d
Wait to Send Genesis Time to Validators Until After Genesis State is Initialized (#1568)
* add state initialized feed to send to rpc service

* rpc tests pass by using mock initializer

* verifies the chain start send and receive

* chain start chan sub test

* goimports
2019-02-13 11:51:57 -06:00
Raul Jordan
5dc5f1d1c8 Update Contract to Use Little Endian And Encoding Across Entire Repo (#1536)
* using little endian and tests for encoding dep inputs

* use decode value and timestamp method in state

* updated comments to match serialization format

* latest compiled contract, abi, bytecode, and bindings

* to little endian everywhere

* fix all tests except for contract tests

* include contract changes

* address broken build

* compile with vyper v8

* update readme

* fix pkg name

* add skip chainstart delay

* skip chainstart delay tests pass

* to little endian timestamp
2019-02-12 09:27:00 +05:30
Raul Jordan
3d8bb73f15
Attester RPC Server Functions (#1505)
* initial validator attesthead rewrite based on proposer rewrite

* proceed with fetching committees and tree hashing the canonical head at assigned attester slot

* complete filling the properties of attestation data and all associated root hashes

* add when to attest todo

* finish entire attester client logic

* tests with mocks checked in

* tests passing in client

* stubbed out server implementation

* fixed build due to old property

* regen mocks with new mockgen version

* fixed broken tests

* complete bazel build fix

* address some review comments

* deep proto test

* server implementation logic

* attestation info tests

* completed passing tests, tree hash still blocked by error with nil fields unfortunately

* fix todo failure

* gazelle rerun and master merge

* testing full behavior of attestation info server

* finished all required server tests and implementation

* break loop

* fix tests due to genesis slot updates
2019-02-11 10:15:25 -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
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
Preston Van Loon
05c6689c9d Pending Deposits RPC Server Implementation (#1508)
* Add impl for pending deposits via gRPC

* Add test for pending deposits RPC
2019-02-06 12:06:31 -06:00
Raul Jordan
61026103c6
Validator Attester Rewrite (#1487)
* initial validator attesthead rewrite based on proposer rewrite

* proceed with fetching committees and tree hashing the canonical head at assigned attester slot

* complete filling the properties of attestation data and all associated root hashes

* add when to attest todo

* finish entire attester client logic

* tests with mocks checked in

* tests passing in client

* stubbed out server implementation

* fixed build due to old property

* regen mocks with new mockgen version

* fixed broken tests

* complete bazel build fix

* address some review comments

* deep proto test

* tests passing after checking for empty committee and crosslink root

* address nishant comments
2019-02-06 10:20:38 -06:00
terence tsao
506db55be5
Aligning ETH2.0 spec - Make Epoch First Citizen (Shuffling and GetCrosslinkAtSlot) (#1488) 2019-02-05 19:52:14 +01:00
Preston Van Loon
2a0eae163e
Handle idx panic (#1492)
* fix panic on empty first committee

* fix issue in validator server too
2019-02-05 11:15:54 -05:00
Preston Van Loon
4add403335
Validator Proposer Rewrite (#1462)
* WIP - with TODOs

* interface w/ test

* basic test for broadcast

* Add computeStateRoot funciton

* remove custody challenge

* resolve TODO lint issues

* more TODOs

* revert new line in types.proto

* broadcaster comment

* one of several failure condition tests

* Add test cases

* handle compute state error test case

* fix config in validator helpers

* fix tests too

* fix conflict

* partial PR feedback

* remove p2p

* gazelle

* package comment

* Better godoc
2019-02-05 08:47:25 -05:00
Andrei Ivasko
4672859832 Create RPC health check (#1385)
* rpcHealth

* TestBadEndPoint not passed

* Crasher and TestCrasher()

* panic and recover

* assertPanic , TestBadEndPoint failed because of panic in goroutine

* log not found: Starting go routine

* TestLogger implementation

* Testlogger with map  and overriden Fatalf

* rebased

* testLogger - modified the severity of message - added TestStatus - goimports

* fix test issues

* fmt
2019-02-04 15:54:30 -06:00
terence tsao
720c80d8ee Aligning ETH2.0 spec - Make Epoch First Citizen (Package: Committee) (#1477)
* able to bazel build beacon chain.. yay

* fixed package validator tests

* fixed a few more package tests (epoch, blockops, forkchoice)

* fixed all the tests! and lint. Woohoo

* moving committee helpers to own package

* more fixes at epoch processing

* fixed rewards and penalties tests

* fixed rest of the tests. yay
2019-02-04 15:27:28 -06:00
Raul Jordan
088507af66
Initialize State from ChainStart Deposits in POWChainService (#1474)
* tests passing once again in db package

* fixed all tests

* revert some weird p2p changes made accidentally

* fix repeated code

* build fixed

* fix p2p

* fix all tests
2019-02-03 16:44:48 -06:00
terence tsao
8c355497ee
Beacon Block Operation Pool to store Attestation (#1444) 2019-01-31 19:54:24 +01: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
Raul Jordan
ec9240106e
Implement WaitForChainStart RPC Server and Client (#1421) 2019-01-30 13:28:53 +01:00
terence tsao
c0f36e467b
Eliminate Custody Logic for Phase 0 (#1408) 2019-01-30 11:11:13 +01:00
Raul Jordan
07c0387be1
Validator Epoch Assignments RPC Implementation (#1419)
* begin reorder

* move into beacon server

* add proposer server

* fix

* add proposer server

* wrap up rpc reorder

* eliminated deprecated RPC endpoints

* formatted nicely

* RPC protos

* fix lint

* integrate hash proto

* epoch assignments

* deprecated committee code

* remove deprecated messages

* fixed mocks, added tests for validator epoch assignments

* gazelle

* fix broken bazel

* nishant comment
2019-01-29 13:56:14 +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