Commit Graph

276 Commits

Author SHA1 Message Date
Preston Van Loon
a19cb1864e Tracing additions (#1747) 2019-02-27 19:55:47 -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
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
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
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
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
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
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
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
ec9240106e
Implement WaitForChainStart RPC Server and Client (#1421) 2019-01-30 13:28:53 +01:00
Raul Jordan
b86388410d
Restructure RPC Server Into Individual Servers (#1393)
* begin reorder

* move into beacon server

* add proposer server

* fix

* add proposer server

* wrap up rpc reorder

* gazelle

* lint fix

* fix broken build
2019-01-28 16:40:40 +01:00
Preston Van Loon
956721fe43 Simplified validator workflow 2 - updateAssignments (#1371)
* Add attestation p2p messages

* first pass refactor

* lint

* viz fix

* comment unused const for now

* Add opentracing spans

* PR feedback

* added updateAssignments implementation

* update proto

* handle error in runner

* only do updates on epoch start

* gazelle

* goimports
2019-01-25 11:26:03 +08:00
Ed Mazurek
10b237e72d db methods: remove Get prefix (#1351)
* db methods: remove Get prefix for getter functions

* db methods: consistent test names by removing Get
2019-01-21 17:34:11 +08:00
terence tsao
463cd58171
Implement Process Penalties and Exit Logic (#1291)
* implemented process pentalties and exit logic

* tests

* add MaxWithdrawalsPerEpoch to config

* preston's feedback, replaced index with idx

* s/e/penalizedEpoch

* removed blank line
2019-01-15 21:52:57 -08:00
Preston Van Loon
592c5c3d92 Refactor hashing of beaconblock to shared (#1315)
* Add beacon block hash function

* Refactor/remove old hash method

* gazelle
2019-01-15 00:41:20 +08:00
terence tsao
e313e97666
Implement Validator Rotation Logic (#1279) 2019-01-13 12:52:31 -08:00
Preston Van Loon
b7b2e51450
Add reflection gRPC service to beacon-chain gRPC server (#1313)
* Add reflection gRPC service to beacon-chain gRPC server

* Move reflection to end of server bootstrap
2019-01-13 11:58:52 -05:00
Preston Van Loon
ddf454a04d Ignore empty public keys in gRPC request (#1309)
* Ignore empty public keys in gRPC request

* Remove log
2019-01-13 12:44:28 +08:00
Nishant Das
09d4c3b25d
Modifying Block Proposals for Validator Clients (#1224)
* adding rpc method

* permissions

* adding functions

* gazelle

* adding new methods

* gomocks and test

* tests again

* new changes

* fix tests

* tests and godoc

* gazelle

* lint

* nosec

* addressing review comments

* addressing more review comments

* fix merge issues
2019-01-10 10:56:26 +08:00
terence tsao
060a311a14 Core Package Clean up Part 2 (#1268)
* comments on core package declarations

* fixed sentence

* cap

* no extra line

* fixed tests

* gazelle
2019-01-10 07:49:50 +08:00
Raul Jordan
4bb6196f4f
Wrap Up Data Structure Renaming (#1270)
* spec renames

* fix goimports

* fix items
2019-01-09 03:49:17 -06:00
terence tsao
138bc37a60
Renaming Poc_ and Pow_receipt_ fields (#1271) 2019-01-08 20:42:42 -08:00
Raul Jordan
7e1af4fceb
Remove Use of Proto .GetX for Value Getters (#1235) 2019-01-04 21:58:19 -06:00
Nishant Das
204b5ac594
Remove Special Records and Timestamp (#1223)
* remove dep fields

* permissions
2019-01-03 16:04:12 +08:00
Nishant Das
f305ee7fe6
Remove Deprecated Fields from Beacon State (#1222)
* remove fields

* remove deadcode
2019-01-02 13:23:03 +08:00
Preston Van Loon
a901a154dc
Health check endpoints for services (#1183)
* /healthz part1

* lint, fix

* lints and todos

* add p2p status test

* Add test for service registry Statuses

* fix my fake errors for the linter

* Test healthz handler

* Run gazelle
2018-12-30 16:20:43 -05:00
Raul Jordan
5d26efcfaa
Deprecate types.BeaconState with pb.BeaconState Generated Proto (#1164) 2018-12-23 16:51:04 -06:00
Preston Van Loon
10f45744d6
Use gogo protobuf as the protoc compiler (#1165)
* first commit, remote att types

* no more agg attestation proto

* regen mock

* only attestations

* proto

* att process

* fix att references

* more tests passing

* use att protos

* complete

* change visibility

* use gogoprotobu
2018-12-23 15:34:59 -05:00
Raul Jordan
1065617087 Replace Attestation Type Primitive With Proto Generated Type (#1149)
* first commit, remote att types

* no more agg attestation proto

* regen mock

* only attestations

* proto

* att process

* fix att references

* more tests passing

* use att protos

* complete

* Update dependency com_github_deckarep_golang_set to v1 (#1159)

* Update dependency com_github_edsrzf_mmap_go to v1 (#1160)

* Update dependency com_github_go_stack_stack to v1 (#1161)

* Update dependency com_github_rs_cors to v1 (#1162)

* Update dependency in_gopkg_urfave_cli_v1 to v1 (#1163)

* change visibility
2018-12-22 15:30:59 -05:00
Raul Jordan
e49a190754
Replace Types of Block Primitives With Proto Generated Types (#1137)
* refactor repo to use protos

* removed block successfully in types

* db package updated

* db, core passing

* chain service done

* no more block instances

* all pass

* deprecate all block protos

* tests pass
2018-12-20 17:00:38 -05:00
terence tsao
122ad6ef3c
Implemented Get_block_root Helper Function (#1096) 2018-12-13 11:35:11 -08:00
terence tsao
b8a9e839e7
clean up BeaconBlock's validator fields (#1037) 2018-12-03 19:05:22 -08:00
terence tsao
121654ff12
Removed Deprecated BeaconBlock Fields (#1035) 2018-12-03 08:10:47 -08:00
Raul Jordan
a99de08562
Merge Active/Cystallized State (#1019) 2018-12-01 16:09:12 -06:00
terence tsao
391eacd1d7
Refactor Casper Validators Into Core/Validators Stateless Package (#875) 2018-11-20 22:44:04 -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
f6c1864d6d
Cleanup of Miscellaneous Items Around the Repo (#790) 2018-11-16 12:01:41 -05:00
terence tsao
80d6c60769 fixed error strings (#708) 2018-10-31 23:05:55 +01:00
Yutaro Mori
c00a1d3132 Replace LevelDB with Bolt (#666) 2018-10-17 01:11:24 -05:00
terence tsao
b98d30cf18
Implement RANDAO From Spec (#651) 2018-10-15 17:02:00 -07:00
Yutaro Mori
8bffae1316 Various cleanup and bugfixes around validator/RBC interaction (#657) 2018-10-14 10:29:57 -05:00
Yutaro Mori
d1eefa5cc7 Use consistent hash formatting (#650) 2018-10-12 08:35:49 -07:00
Yutaro Mori
04c7a89f1d [WIP] Partial fix for the validator code (#647) 2018-10-11 23:41:17 -05:00
terence tsao
efeb6976d1
Align Block and State Field Names with Spec (#628) 2018-10-09 19:34:50 -07:00
Yutaro Mori
ce99bd7605 Refactor to Create DB Package (#582) 2018-10-05 13:14:50 -04:00
Preston Van Loon
8bcddf5fdc
Migrate dependencies on @com_github_ethereum_go_ethereum//event (#601)
* Add go-ethereum's event and

* remove swp file

* goimports

* remove unused code

* fix gazelle
2018-10-02 21:49:01 -04:00
Raul Jordan
593e3dcdf9
Beacon Node Determines Slot From Genesis Block if ChainState Detected (#606) 2018-10-02 15:07:33 -05:00
terence tsao
d5bf733948 Fixed Simulator Can't get ParentSlot (#602) 2018-10-02 13:34:26 -05:00
Raul Jordan
1abed55bdd Update Beacon/Validator Flags to Disable Reward/Cross-Link Checking by Default (#597)
* flag updates

* enable att validity, cross links, rewards

* tests all pass

* fix race

* fix cov

* fix flag

* fix conf

* fix race

* fix gazelle
2018-10-02 10:04:37 +08:00
Preston Van Loon
6e2b6229fe
Revert "Fixed Sync With Simulator (#588)" (#600)
This reverts commit 085b45626e.
2018-10-01 20:54:45 -04:00
terence tsao
085b45626e Fixed Sync With Simulator (#588) 2018-10-01 14:14:10 -05:00
Nishant Das
c4ea6b8e13
adding attestation (#590) 2018-09-29 17:09:05 +08:00
terence tsao
d65e2a4157
Implemented Dev Flag to Use Demo Config (#586) 2018-09-27 23:48:39 -07:00
terence tsao
2566687db7
Validator Client Use Assignment Stream to Determine Responsibility (#566) 2018-09-27 14:46:07 -07:00
Raul Jordan
e10baf7c80
Validator Assignment RPC Beacon Node Stream (#563) 2018-09-26 21:34:35 -05:00
Nishant Das
542ddef9e8
fixing error (#574) 2018-09-27 01:06:45 +08:00
Jie Hou
c37ad4b446 Initialize ActiveStateHash and CrystallizedStateHash for Genesis BeaconBlock (#518) 2018-09-26 08:34:23 -07:00
Raul Jordan
78ccea9865 Refactor ValidatorSlot RPC and Casper to Return ValidatorSlotAndResponsibility (#565)
* slot responsibility casper refactor

* fix
2018-09-24 23:18:27 +08:00
terence tsao
1aeb0e6b10 Part 1 of Attestation Service - [sync -> blockchain -> rpc] (#548)
* Revert "Add Skip Coverage Condition in Coverage.sh (#416)"

This reverts commit 72a5dd1cf4.

* add coverage.sh back

* beginning sig aggregation routine

* fixed errors

* fixed existing tests

* merged master

* add attestation build.bazel

* private visibility

* tests for attestation service

* lint

* bazel gazelle

* add validator beacon file

* lint

* tests for sync service

* removed tmp.go

* bazel gazelle
2018-09-24 09:22:09 +08:00
Raul Jordan
673c4f840f
Streaming Validator Assignment Service Definition (#554) 2018-09-22 13:19:34 -05:00
Raul Jordan
419cff2512
--Dev Mode Flag for Local Demo/Development (#537) 2018-09-21 16:02:17 -05:00
Raul Jordan
190a976d3d
Validator Clients Use an Internal Clock to Determine Slot Responsibility (#467) 2018-09-21 09:32:20 -05:00
terence tsao
ddfe1715c9 RPC methods for Validators to Get ShardID, Index and Slot (#526) 2018-09-17 22:36:09 -04:00
Nishant Das
cddae7a306
Implement RPC Messaging Between Validators (#475)
* Adding Proto files

* Move to shared package

* adding attestation sub

* gazelle

* attestation check

* proposal finished

* Add in attesters responsibilities

* fixing dependency issues

* adding topics

* refactoring tests

* Adding more tests

* adding more changes

* gazelle

* removing attester p2p

* remove mock

* changing to new proposer model

* changing tests

* making changes

* gazelle

* adding gomock

* adding rpc methods, reverting changes to other proto files

* gazelle and test changes

* adding tests

* adding mocks and tests

* gazelle

* fixing merge issues

* lint

* lint
2018-09-16 09:12:36 +08:00
terence tsao
861b960ed9
Implement Attester Responsibilities for Demo (#487) 2018-09-11 10:08:31 -07:00
Raul Jordan
ee91be2c4a
validator: Implementing Partial Implementation of Proposer Responsibility (#441)
* implementing basic proposer functionality

* checked in gomocks

* fix typo

* refactor using feeds

* use event feeds for assignment

* sending the latest beacon block over announcement chan

* 100 coverage, using feeds

* gazelle

* include parent hash from prev canonical block and slot number + 1

* including all other prop fields

* fix build

* proposer rpc method tests, implemented in beacon chain side

* godoc
2018-09-04 23:35:32 -04:00
Ivan Martinez
d30d81a608 Rename all mentions of height to slot (#456)
#442
2018-09-01 12:01:53 -04:00
Raul Jordan
4a1b5db07b
beacon: Store Incoming Blocks and Calculated States in DAG (#422)
* begin with a block/state dag approach in prep for fork choice

* add TODOs for fork choice items, add data structure for forks

* remove syncing and processing states for incoming block sync

* simulator only broadcasts blocks now, no more state simulation

* fix sim tests, no more state sim

* bazel rerun

* naive fork choice

* split update head routine

* pesky race conditions

* fork choice rule works

* dag + fork choice working

* canonical head storage across sessions

* todo: save dag

* no more stalling after 10 blocks, using event feeds

* address review

* sync instead uses event feed

* refactored pure funcs into casper package

* tests pass

* fix lint

* refactor get blockhash

* refactor blockhashforslot

* event feed for incoming blocks in chainservice

* use config

* addressed all comments

* fix typo

* address yutaro comment

* using db interface

* check if parent hash in previous slot DAG

* works

* tests

* drop ffg suffix

* bazel gazelle

* full cov validators by height shard

* gazelle

* state tests

* all state tests

* 100% cov types and 99% cover casper

* cov up

* 80% blockchain cov

* fix lint
2018-08-23 22:09:59 -06:00
terence tsao
7c8331e9d3
Renamed Client to Validator (#428) 2018-08-22 12:15:21 -07:00
Raul Jordan
d3b5a7c67b
beacon: Implement Beacon Node gRPC Server Streams (#400)
* remove client helper in internal

* tidying up the sharding client project

* update all docs

* implementing beacon rpc server methods

* address prs

* begin coverage

* regen proto

* include announcement chans

* tests pass, announcing as canonical only after block has passed all processing

* system functioning yay

* tests pass

* bootstrap validators

* default balance params

* fix lint

* fix all tests

* increasing cov

* 100% test cov rpc

* build file for internal

* typo

* graceful stop

* merge with Terence's PR

* address review comments

* fixed blockchain tests and lint

* added ethdb

* persists last simulated session

* cov

* ready

* fix lint

* fix cov tests

* fix lint

* config options for args

* fix lint

* lint fix
2018-08-17 21:34:56 -06:00
Raul Jordan
cd90598a90
client: Update Attester to Use Beacon Node RPC, Replacing SMC Completely (#365) 2018-08-09 17:54:59 -05:00
Ivan Martinez
390ac62ed8 Update docs client/beacon-chain wide (#386) 2018-08-09 11:25:48 -07:00
Ivan Martinez
0d0626a101 Add support to pass in TLS key/crt to use gRPC securely (#384) 2018-08-08 15:43:25 -07:00
Raul Jordan
29596bf862
beacon: Beacon Node gRPC Server and Client Services (#364) 2018-08-01 17:08:44 -05:00