Commit Graph

53 Commits

Author SHA1 Message Date
terence tsao
d5bf733948 Fixed Simulator Can't get ParentSlot (#602) 2018-10-02 13:34:26 -05: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
terence tsao
bc7e07d5dd
Load Genesis State Config when Flag is Specified (#576) 2018-09-26 23:58:00 -07:00
Jie Hou
c37ad4b446 Initialize ActiveStateHash and CrystallizedStateHash for Genesis BeaconBlock (#518) 2018-09-26 08:34:23 -07: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
190a976d3d
Validator Clients Use an Internal Clock to Determine Slot Responsibility (#467) 2018-09-21 09:32:20 -05:00
Raul Jordan
4bc2176898
Refactor Block Processing + UpdateHead to Use Slot Numbers (#474) 2018-09-18 09:06:28 -04:00
terence tsao
ae84cfcfa2
Implement Proposer Attestation Check for Block Validity (#508) 2018-09-15 07:51:17 -07:00
Jie Hou
be11f2f103 Check attestation slot number (#515) 2018-09-13 22:07:30 -07:00
Yutaro Mori
f312c013fc beacon-chain: Refactor Beacon Chain To Simplify Block Processing (#473) 2018-09-11 07:09:41 +02:00
Ivan Martinez
d4e8de95d8 Change IndicesForSlots to ShardsAndCommitteesForSlots (#481)
* Change IndicesForSlots to ShardsAndCommitteesForSlots

* Capitalize function properly
2018-09-09 11:05:36 +08:00
terence tsao
b0f5ef0da0
Save Attestation and AttestationHashes to DB (#472) 2018-09-08 18:52:18 -07:00
terence tsao
d4209b7357 beacon: Process Crosslink During Cycle Transition (#482)
* Revert "Add Skip Coverage Condition in Coverage.sh (#416)"

This reverts commit 72a5dd1cf4.

* add coverage.sh back

* save attestations to db

* added tests

* use them in service.go

* process crosslink records

* revert

* revert

* revert

* test
2018-09-08 17:20:06 +02:00
Nishant Das
42d93812ce beacon: Implement Sync Handler for Block Requests By Slot Number (#461)
* Persist Dag

* Add schema

* Add new message

* add mapping

* Adding check to save block

* Removing blocks mapping

* Make changes to block processing

* Change from mapping to a slice of hashes

* Adding tests to core

* adding more tests

* Fixing service test

* Add comments and fix bazel

* fix lint

* fix conflicts

* addressing review comments

* Removing references to active

* fixing tests with active state

* Protytype for #440: Persist blocks and latest state in DB

* simplify code

* removing block registry

* fix test

* adding block removal/iterator

* Addressing review comments

* Addressing comments

* Adding block request

* removing extra line

* making vars private and adding canonical key

* fix lint

* splitting methods

* adding more changes

* lint

* improving coverage

* removing decodeslotnumber

* Able to search for and send blocks

* adding core tests

* adding tests

* adding documentation

* addressing raul's comments

* lint and gazelle

* addressing yutaro's comments

* improving coverage

* improve coverage

* improving  coverage
2018-09-04 10:48:07 -04:00
Yutaro Mori
6acf9d9db5
remove unused code (#462) 2018-09-02 13:46:42 -04:00
Nishant Das
4891f68929
Persist Blocks and State in DB (#440)
* Persist Dag

* Add schema

* Add new message

* add mapping

* Adding check to save block

* Removing blocks mapping

* Make changes to block processing

* Change from mapping to a slice of hashes

* Adding tests to core

* adding more tests

* Fixing service test

* Add comments and fix bazel

* fix lint

* fix conflicts

* addressing review comments

* Removing references to active

* fixing tests with active state

* Protytype for #440: Persist blocks and latest state in DB

* simplify code

* removing block registry

* fix test

* adding block removal/iterator

* Addressing review comments

* Addressing comments

* removing extra line

* making vars private and adding canonical key

* fix lint

* splitting methods

* adding more changes

* lint

* improving coverage

* removing decodeslotnumber

* gazelle

* remove todos

* addressing preston's comments

* remove slotnumber

* lint
2018-09-03 00:44:03 +08:00
terence tsao
8ce739adfb Add LastJustifiedSlot in Crystallized State Field (#454)
* Revert "Add Skip Coverage Condition in Coverage.sh (#416)"

This reverts commit 72a5dd1cf4.

* add coverage.sh back

* new justifiedSlot field in crystallized state

* test coverage
2018-09-02 14:34:29 +08:00
terence tsao
366e5168ba
Initialize New Cycle during Block Processing (#443) 2018-08-29 16:21:15 -07:00
terence tsao
f37a59d2f8
Part 5 of Aligning Beacon Chain with Latest 2.1 - Block Vote Cache (#436) 2018-08-28 17:55:56 -07:00
terence tsao
6389877154
Part 4 of Aligning Beacon Chain with Latest 2.1 - Bootstrapping Genesis (#430) 2018-08-25 11:59:46 -07:00
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
e1f727cbb2
Implement Beacon Node Validator and Observer Entry Points (#414) 2018-08-20 08:50:11 -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
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
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
Ivan Martinez
390ac62ed8 Update docs client/beacon-chain wide (#386) 2018-08-09 11:25:48 -07:00
terence tsao
bfaa248b39
Refactor Proto Struct to Be More Semantic (#381) 2018-08-05 16:23:31 -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
terence tsao
c9f1bfc19c
Simulate Epoch Transition (#361) 2018-08-01 08:24:55 -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
Yutaro Mori
f9d23da2dd Decouple Database From the ServiceRegistry (#335) 2018-07-29 23:14:50 -07: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
Raul Jordan
9ab02849b6
beacon: Initial Beacon P2P Protobufs, Subscriptions (#327) 2018-07-28 15:53:02 -04:00
terence tsao
b1c47ab83a
Implement Validator Clean Up for Dynasty Transition (#329) 2018-07-26 11:20:55 -07: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
terence tsao
3abfb77b87
Outline for Active State Transition Function (#309) 2018-07-22 13:00:10 -04: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