Commit Graph

3214 Commits

Author SHA1 Message Date
terence tsao
1598ae8605
Part 3 of Aligning Beacon Chain with Latest 2.1 - Processing Attestations (#423) 2018-08-24 09:07:23 -07: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
terence tsao
56ba92ac93
Updated Docker Rules (#424) 2018-08-21 19:59:36 -07:00
Yutaro Mori
7cfda8a149 Extract Initial Sync Into its Own Package (#404)
* Initial commit to extract initial sync code

* Add stop/resume of sync/intialsync

* bazel run

* gometalinter

* add tests

* cleanup

* build fixes

* use infof rather than errorf if sync is not in correct state

* Add TODO comment detailing eventual completion of transition from initial sync to sync

* fix build

* pr comments

* fix tests

* bump
2018-08-22 09:52:03 +08:00
Yutaro Mori
920a9a874d
fix race condition in rpc tests (#425) 2018-08-21 20:45:47 -04:00
terence tsao
e1f727cbb2
Implement Beacon Node Validator and Observer Entry Points (#414) 2018-08-20 08:50:11 -07:00
terence tsao
5356bda411 beacon: Use Blake2b Sum512 Instead of 256 (#419)
* Revert "Add Skip Coverage Condition in Coverage.sh (#416)"

This reverts commit 72a5dd1cf4.

* use blake2b512

* messed up on coverage.sh
2018-08-19 18:01:19 -06:00
terence tsao
09824428e8 beacon: Improve Utils Coverage to 100% (#415) 2018-08-18 20:24:42 -06: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
terence tsao
72282a90ba
Part 2 of Aligning Core Package with Latest 2.1 - Helper Functions (#403) 2018-08-17 18:54:34 -07:00
terence tsao
b7bf48bc3e Fixed NewSimulatedBackend (#405)
* sync functions for active and crystallized states

* make pb structure more semantic

* use run func to consolidate to one main routine

* remove mainchain package

* remove smc. yay!

* fixed NewSimulatedBackend

* added smc tests back

* race = off

* used latest commit from bazel-go-ethereum

* changed testoutput to all

* output test.log after failure

* disable race

* restore travis config to original state, add race=off to blockchain workspace

* added issue number and fixed typo
2018-08-16 15:37:53 -06:00
terence tsao
06ca8e758f beacon: Improve Test Coverage for Beacon Chain Package (#402) 2018-08-14 22:49:59 -06:00
terence tsao
1f56c4304d
Part 1 of Aligning Core Blockchain Package with Latest 2.1 Spec (#371) 2018-08-13 17:58:37 -07:00
Ivan Martinez
4976461e62 Implement GenesisBlock() to Grab the Block from Memory DB (#373)
* Fix odd placement of import

* Puts all of NewGenesisBlock() into GenesisBlock() 

Also removes the unneeded TODO

* Add error check for db retrieval

* Add missing bazel imports

* Add back NewGenesisBlock and create GenesisBlock in NewBeaconChian

* Fix GenesisBlock() to grab the block from memory db

* Fix according to requested changes

Fix GenesisBlock() to grab the block from memory db
Fix odd placement of import


Properly add ParentHash to Block


Remove no longer needed if statement condition


Puts all of NewGenesisBlock() into GenesisBlock() 

Also removes the unneeded TODO
Add error check for db retrieval


Add case for if the beaconChain is missing a genesisBlock


Add missing bazel imports


Add back NewGenesisBlock and create GenesisBlock in NewBeaconChian


Remove duplicate code


Change genesis block timestamp to unix 0


Adds info log when a genesis block isn't found

* Provide fakeClock to pass tests with a mocked genesisBlock

* Fix unexpected log in test from addition of genesis block

* Add tests for clock
2018-08-12 22:07:37 -04:00
Federico Gimenez
dd29481abe Fix beacon-chain/sync Test Race (#390)
* fix beacon-chain/sync test race

* address review comments

* remove unused file

* gazelle

* disable race for client/contracts

* address review comments

* fix conflict

* remove duplicated deps, embed

* remove unneeded file
2018-08-12 16:27:21 -04:00
Raul Jordan
2060d2934e
beacon: Fix Beacon Block Response in Simulator (#394) 2018-08-12 13:20:30 -05: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
terence tsao
7841c53db0 Each Service Should Run a Single Main Routine (#382) 2018-08-07 12:56:28 -05:00
Nishant Das
2cf7fa0174
Check Last Finalized Epoch (#357)
* Adding proto topics

* Adding crystallized state request

* Reverting shanges to proto

* Adding db checks

* get crystallised state

* Finalize epoch for mapping

* more changes

* cleaning up main routine

* adding tests

* fix test

* Adding ability to save blocks

* Adding block fetcher

* Another test for setting finalized epoch

* adding final tests

* finished tests

* adding comments

* gazelle

* Making requested changes

* Fixing lint

* stop sync from exiting

* fixing lint

* lint

* Adding new request type to proto

* Making changes to block/state requests

* Change tests

* fixing error messages

* gazelle and lint

* adding back crystallised state

* fix tests

* Fixing merge conflicts

* Addressing review comments

* Changing back to one service

* removing  case
2018-08-07 20:12:10 +08:00
terence tsao
bfaa248b39
Refactor Proto Struct to Be More Semantic (#381) 2018-08-05 16:23:31 -07:00
Ivan Martinez
73f24561c7 Change all struct initializations to be explicit (#374) 2018-08-03 14:31:52 -07:00
terence tsao
87d5fbfd2b
Move Get Cutoff Algo to Utils Package (#370) 2018-08-02 14:20:54 -07:00
terence tsao
0a5e091ad3
Fixed Deficiency in Apply Reward & Refactored Blockchain Functions (#367) 2018-08-02 10:47:49 -07:00
Raul Jordan
29596bf862
beacon: Beacon Node gRPC Server and Client Services (#364) 2018-08-01 17:08:44 -05:00
terence tsao
c9f1bfc19c
Simulate Epoch Transition (#361) 2018-08-01 08:24:55 -07:00
Edward Ward
a433bc70f2 Fix Gitter Link (#362)
Was getting 404 for the gitter link, now working.
2018-08-01 07:51:29 -04:00
terence tsao
2c4bfeeef0
sync functions for active and crystallized states (#358) 2018-07-31 18:13:54 -07:00
Raul Jordan
13a011ce5f
proto: Structure Protos for Beacon and for Sharding (#359) 2018-07-31 13:54:45 -05:00
Yutaro Mori
f3b3712916 Quick Test Helper for Creating Blocks (#356) 2018-07-31 07:37:20 -07:00
Sina Mahmoodi
8c0e9d231c beacon: Check parent hash in block processing (#340)
Signed-off-by: Sina Mahmoodi <itz.s1na@gmail.com>
2018-07-31 18:06:44 +09:00
Raul Jordan
cccd675a84
beacon: Initial Sync Network Simulator (#341) 2018-07-30 23:41:27 -05:00
terence tsao
9b1966374a
Part 2 of State Sync - Active State Proto Struct (#355) 2018-07-30 18:13:25 -07:00
terence tsao
33c56092ad beacon: Part 1 of State Sync - Crystallized State Proto Struct (#354) 2018-07-30 19:29:40 -05:00
Yutaro Mori
9c9aef8194
Eliminate test only methods on types.Block (#350) 2018-07-31 00:45:44 +09:00
Preston Van Loon
26fec66da4
Kubernetes - Part 1 of ?? (#348)
* Add basic k8s configuration for geth deployments

* set genesis difficulty to 0x0

* gazelle, comments

* More comments on priority class and adjust priority class for ethstats

* Adjustments to the miner limits

* set minimum gas price to 0
2018-07-30 10:04:47 -04:00
Yutaro Mori
f9d23da2dd Decouple Database From the ServiceRegistry (#335) 2018-07-29 23:14:50 -07:00
terence tsao
9853f53cc1 beacon: Quick Fix on Typo (#346) 2018-07-29 21:20:20 -04:00
terence tsao
1cb300565d
Implement Validator Cutoff Algorithm (#339) 2018-07-29 10:03:03 -07:00
Nishant Das
d7a88dffa4
Implemeting Validator Rewards and Penalties (#323)
* Adding Validator Rewards

* Addressing review comments

* Adding Penalties

* Adding changes

* Breaking up functions

* Cleaning up

* Adding slashing conditions

* Adding slashing condition boiler plate

* Adding tests

* Adding comments

* Adding comments

* Add in Pubkey

* Adding more tests

* Adding more unit tests and making name changes

* Add beacon chain test helper and fix references to it

* Adding rewards test

* Adding all tests

* Addressing review comments

* Remove slashing conditions

* fix lint

* Fixing merge issues

* removing commented function

* removing newline

* fix golint
2018-07-30 00:22:15 +08:00
Preston Van Loon
9cf375267e Add Security Linter: gosec (#343) 2018-07-28 20:44:24 -04:00
Raul Jordan
9ab02849b6
beacon: Initial Beacon P2P Protobufs, Subscriptions (#327) 2018-07-28 15:53:02 -04:00
Yutaro Mori
67d05861eb beacon: Merge PoWChain goroutines together (#334) 2018-07-27 13:41:00 -05:00
terence tsao
b1c47ab83a
Implement Validator Clean Up for Dynasty Transition (#329) 2018-07-26 11:20:55 -07:00
Preston Van Loon
5776e573ed Add script to ensure visibility is OK (#332)
* Add script to ensure visibility is OK

* typo

* another typo
2018-07-26 13:13:07 +08:00
Yutaro Mori
09ca832a5f beacon: Beginning the Sync Service for the Beacon Chain (#322) 2018-07-25 11:57:44 -05:00
terence tsao
c0b4503d5f beacon: Check State Hashes while Processing Incoming Blocks (#319) 2018-07-24 16:09:04 -05:00
Raul Jordan
d46f1f6502
beacon: Block Processing Validity Conditions (#310) 2018-07-23 12:54:41 -04:00
Preston Van Loon
48b047fd61
Add Docker Container Images for beacon-chain and client (#314)
* Add docker container images for beacon-chain and client

* Add docker section to README
2018-07-22 13:31:43 -04:00
terence tsao
3abfb77b87
Outline for Active State Transition Function (#309) 2018-07-22 13:00:10 -04:00
Raul Jordan
b6cd890a67 Log Verbosity Flags + Logrus Package Level Logs With Fields (#304)
Former-commit-id: f7344b7d3fb2fa07f0fd421c5ed3721f6c7a9258 [formerly e678ab2f1681d9492c0e1b142cd06ee08a462fdb]
Former-commit-id: d942da3d5cfcde921bebb149c26edd5c4ed178dd
2018-07-21 12:51:18 -05:00
Raul Jordan
59fc2e13e7 client: Fix P2P Linter Error (#307)
Former-commit-id: 5f673dffed4267c1aca8ebfb4fe182798b9b2d2a [formerly 3fd494231ba5a350ab59a86fcf60ae9f56f1da00]
Former-commit-id: 1506dd418121884a8c7a727f8cf03c12e4c93cc3
2018-07-21 12:20:00 -05:00
Raul Jordan
92af8bc351 Rename Entire Project to Repo, Change Import Paths and Readmes (#298)
Former-commit-id: b7b8bbd10777012ae6f7d30eb6b05c3b1c3ec5d3 [formerly 06e1112fa0e1092a7137186d3a386972daa2effe]
Former-commit-id: ff2bc760c9dafb6250f056606eb2cbf96b6afa5b
2018-07-20 16:31:26 -05:00
Raul Jordan
abed3dcb6d update to GPLv3 (#297)
Former-commit-id: cc6b67b7391c407d2f830ae46e6765e097c50c57 [formerly cb2dc8a0ea96b92897dd8f797eb632c941d9f653]
Former-commit-id: 600e28af6901b19b8d191cf3153343d94670f9d0
2018-07-20 10:23:48 -05:00
Raul Jordan
4d5d229f0f beacon: Define a Core Blockchain Package and Persisted Structure for Beacon (#278)
Former-commit-id: bbd5b46e7f64f762350d6fb496492207e70d7130 [formerly 43a37f7139b7d1d90f0c27a7406b63bdf390ad96]
Former-commit-id: bb7a2ff0a7619f8de0bd38cd2c9eb0de7c189edb
2018-07-19 11:31:50 -05:00
Preston Van Loon
77267169ea Add More Lint Rules With gometalinter (#284)
* turn up linter to 11

* Added extra linting rules and fixed all lint issues

* add deadline of 10m


Former-commit-id: 632999fcaa8370516d6fe76c28c503cb2e3319b7 [formerly d4354f631b1eb4f7918cde28bf063f756ae92a54]
Former-commit-id: 3aaf78a56b76850b0123d61551ac554ccecfe9ad
2018-07-15 15:06:36 -04:00
Raul Jordan
878a332913 beacon: Create a Subscription to Mainchain Head Events Via RPC as a Service in Beacon Node (#273)
Former-commit-id: a4677d647a959cbbbe9c4046e16fa6fa761133ac [formerly f775f6e9529e64cb1392a22f8ef15b186efa14ed]
Former-commit-id: 42350204f72fcba4626a39e61b6e64b6f0afba32
2018-07-14 14:48:42 -05:00
Raul Jordan
e305d58355 shared: reinclude debug.Exit() usefulness (#275)
Former-commit-id: 423052bc5858f3e5772b37bb9d0b4a05f9b131ac [formerly 869ca9c92bc215b0583953bb5ab2479927b15256]
Former-commit-id: bfd9353f0234864c9823ad3ee10d152d59af791c
2018-07-13 22:35:15 -05:00
Raul Jordan
83569f1342 shared: Abstract Service Registry Into Shared Folder, Add Beacon Node and Beacon Entry Point (#268)
Former-commit-id: 406ba2f1e65ec58e822fcf1b9d54c44ba51a559c [formerly 52aebe050663c4dc73fc56e5e4c6846620267f1f]
Former-commit-id: c959a9fda119e4403136ac4f8d1b345d464ab5df
2018-07-13 21:15:37 -05:00
Raul Jordan
0444ee81c4 Update Documentation to Reflect Beacon Chain Research (#247)
Former-commit-id: 91dea499d9e27b0ca9e22769582eae6f8d042a98 [formerly 9bfb7f7fef2b8e4802cfd5d99be561378a5ada65]
Former-commit-id: 5a2a52d440d9d67857f5ecac173aa721ce46d12c
2018-07-12 12:12:11 -05:00
Raul Jordan
923e727819 Fix Bazel Build Rules for Visibility, Move LICENSE to Top-Level (#253)
Former-commit-id: 4857afb2c25835b643cd58dd90b114695154b50f [formerly 5d2c723def807289eb72e6c35ce7036ef70f837e]
Former-commit-id: 79c8f081748e29e00b61ace851f74c2252865729
2018-07-12 12:00:37 -05:00
Nishant Das
620564cd61 beacon: move beacon-chain to geth-sharding repo (#250)
Former-commit-id: 689de6935d724226eb9125d597831d7b274d79c1 [formerly 4e0c0d671c4e6284cd33300231cc0f7aba99d314]
Former-commit-id: c3079b352bc938c12708b81cdc0130909456ea27
2018-07-11 17:29:31 -05:00