Commit Graph

235 Commits

Author SHA1 Message Date
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
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
Nishant Das
c186274891
Encoding/Decoding Deposit Data Fix (#1317)
* fix encoding/decoding

* comments
2019-01-14 22:42:26 +08:00
terence tsao
e313e97666
Implement Validator Rotation Logic (#1279) 2019-01-13 12:52:31 -08:00
Andrei Ivasko
b29188128d ToBytes32 (#1306) 2019-01-13 09:04:14 -05: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
1f11b821ab
Implement PoW Chain Deposit Trie in Go (#1285) 2019-01-11 16:29:30 +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
terence tsao
911d30031a
Hook up Epoch-Processing Logic Inside State Transitions (#1246) 2019-01-09 09:26:40 -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
Nishant Das
bb7b0a324b
Fix Bug On Startup Using Genesis.json (#1258)
* fix bug

* making requested changes

* new changes

* changing initialize state

* remove genesis.json and references

* remove log

* readme

* readme

* remove reference
2019-01-09 11:03:57 +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
Preston Van Loon
aa4f66edeb fix some lint issues (#1239)
* fix some lint issues

* print error

* unname the unused params
2019-01-05 21:12:59 -06:00
terence tsao
074ac07dc8
Replace Validator Status Code With Activation/Exit Slot (#1233) 2019-01-04 22:39:07 -08:00
Raul Jordan
ccc2a4b91f
Process Validator Deposits (#1184) 2019-01-04 23:39:34 -06:00
Raul Jordan
7e1af4fceb
Remove Use of Proto .GetX for Value Getters (#1235) 2019-01-04 21:58:19 -06:00
terence tsao
576136e621
Cleanup Attestation Helper Function and Test (#1220) 2019-01-02 12:19:08 -08:00
Nishant Das
f305ee7fe6
Remove Deprecated Fields from Beacon State (#1222)
* remove fields

* remove deadcode
2019-01-02 13:23:03 +08:00
terence tsao
1314077a4d
Code Clean Up Part 1 - Core Package (#1216) 2019-01-01 09:17:44 -08:00
Arun Kumar
01e7755f30 Update slashing conditions according to specs (#1210) 2018-12-31 13:52:12 -08:00
terence tsao
d3acd397fb
Implemented Process Validator Registry (#1213) 2018-12-31 10:24:52 -08:00
terence tsao
f0c9a9f0de Implement Get Initial Genesis State (#1208)
* beginning epoch processing helper funcs

* starting InitialBeaconState

* tests

* gazelle
2018-12-31 15:40:14 +08:00
Raul Jordan
2c2b30fa3a Implement Process Deposit Validator Helper Function (#1200) 2018-12-29 14:10:48 -08:00
terence tsao
085bd27fe1 Implemented Can Process Validator Registry (#1188) 2018-12-29 12:21:34 -06:00
terence tsao
b23ccc608c
Update Validator Status and Process Ejections (#1186) 2018-12-29 09:24:11 -08:00
terence tsao
e03355f141
Helpers for Updating Validator Status (#1181) 2018-12-29 08:55:16 -08:00
Nishant Das
929bc04211
Implement IsSurroundVote, IsDoubleVote, GetForkVersion,GetDomain helpers (#1180)
* Adding vote helpers

* Adding fork/domain helpers

* Adding comments

* visibility

* removing misc package
2018-12-28 15:29:02 +08:00
Raul Jordan
f5abc780ab
Verify Block Proposer RANDAO (#1104) 2018-12-27 23:19:32 -06:00
Nishant Das
e95e3ed517
Update State Transitions to Process Block Roots (#1176)
* Adding block root updating functions

* Adding block root updating functions

* Commiting stuff

* Updating test

* permissions

* adding tests

* fixing tests and gazelle

* Revert randao changes

* Comment

* Addressing review

* indenting
2018-12-27 14:48:09 +08:00
terence tsao
c24e6806f3
Implement Validator Registry Delta Chain Tip Helper for Validator Rotation (#1179) 2018-12-26 21:47:05 -08:00
terence tsao
8515cc3cd1
Attestation Inclusion and Crosslink Rewards and Penalties (#1178) 2018-12-26 21:27:35 -08:00
terence tsao
75bf268d8b Rewards/Penalties for Justification and Finalization Case 2 (#1175) 2018-12-26 22:11:02 -06:00
Raul Jordan
952dbe983e
Integrate Block Operations Into State Transition (#1135) 2018-12-26 21:15:12 -06:00
terence tsao
72428239b8
Rewards/Penalties for Justification and Finalization Case 1 (#1173) 2018-12-26 07:46:06 -08:00
terence tsao
f975af8bc7
Rewards Penalties Helpers (#1168) 2018-12-26 07:22:52 -08:00
Nishant Das
9db1002d87
Updating Genesis Block to Spec (#1172)
* Updating to spec

* addressing review comments
2018-12-25 14:47:07 +08:00
terence tsao
5b967fc6ce
Implement Crosslink Processing (#1167) 2018-12-24 06:58:18 -08:00
terence tsao
c7a92b88c8
Epoch Processing: Receipt Root, Justification and Finalization (#1158) 2018-12-23 22:36:09 -08: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
terence tsao
b9a233da7d Implemented Rest of Epoch Helpers (#1145)
* beginning epoch processing helper funcs

* renamed helpers to under epoch_operations

* implemented AttestingValidatorIndices

* deleted old epoch_processing.go file

* implemented WinningRoot & LowerThan helper funcs

* rest of the epoch helpers

* gazelle

* added tests

* merged

* mentioned LowerThan is for big endian format

* fixed spelling
2018-12-22 15:38:09 -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
Raul Jordan
6125c304ba
Remove Deprecated Spec Logic (#1138)
* no more deprecated stuff

* remove incentive functions

* rem deprecated

* remove funcs
2018-12-19 20:45:21 -05:00
terence tsao
6eb2d816b4
Implemented ValidatorBalance field in Proto with Some Helpers (#1139) 2018-12-19 16:49:22 -08:00
Nishant Das
e92032346f Partial Implementation of the Slot Processing Routine (#1083) 2018-12-19 00:18:42 -05:00
terence tsao
74532a80d1
Boundary Attestation and Balances Helper functions (#1115) 2018-12-18 20:55:36 -08:00
terence tsao
6fb3af04da
Implement Attestation Participants Helper Function (#1111) 2018-12-17 10:34:28 -08:00
Raul Jordan
58549b95e0
Implement Process Block Receipt Root Records (#1105)
* process receipt root records

* complete process pow roots

* gazelle

* remote print
2018-12-15 17:53:02 -06:00
Raul Jordan
1828537dd5
Implement Process Exits Block Operation (#1097)
* processing exit definition

* exit ops

* finished verification exits

* 100% cov

* comment

* fix
2018-12-15 17:06:24 -06:00
terence tsao
5c7539e2a1
Quick fix on a pseudocode typo (#1106) 2018-12-14 16:34:28 -08:00
terence tsao
53749c49d0 Get Epoch (&Boundary) Attestations Helper Functions (#1103) 2018-12-14 14:49:03 -06:00
Raul Jordan
708daae04f
Implement Attestation Processing Block Operations (#1088) 2018-12-14 13:35:53 -06:00
terence tsao
122ad6ef3c
Implemented Get_block_root Helper Function (#1096) 2018-12-13 11:35:11 -08:00
Raul Jordan
5e85133e16
Implement Casper Slashing Block Operations (#1086) 2018-12-13 10:35:50 -06: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
Nishant Das
8d042e8d02 Update Wrapper for Beacon State (#1084) 2018-12-12 15:04:25 -08:00
Raul Jordan
94e4bc1f18
Implement Proposer Slashing Block Operations (#1076) 2018-12-12 10:18:50 -06: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
Preston Van Loon
b4f8c0afaf
Add new ShardAndCommitteesAtSlot from spec (#1075)
* Add new ShardAndCommitteesAtSlot method

* remove debug print

* one more test condition for fun

* simplify
2018-12-11 21:01:27 -05:00
terence tsao
8402a1dd61
Part 1 of Cleaning Up State Proto (#1070) 2018-12-11 07:46:01 -08:00
terence tsao
3c7b5bb13a
Part 3 of Restructuring BeaconBlock Proto - Remove Special Record (#1067) 2018-12-10 09:00:34 -08:00
Nishant Das
724b036fff
Combine Sync Services (#1060)
* adding initial service

* got it working

* deleting redundant querier file

* golint

* formatting span messages

* lint

* lint

* addressing raul's comments
2018-12-10 13:26:44 +08:00
terence tsao
071cc85bc6
Update Shuffle Function (#1055) 2018-12-09 11:21:23 -08:00
Preston Van Loon
29bba21ce2
Explicitly initialize the fork data for genesis state (#1034)
* Explicitly initialize the fork data for genesis block

* gofmt using 1.11.2

* gofmt
2018-12-03 22:45:38 -05: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
Preston Van Loon
8620311bfc
Rename crosslinks to latest crosslinks (#1032) 2018-12-02 22:10:47 -05:00
terence tsao
57038551d6
Update ValidatorRecord Proto (#1030) 2018-12-02 18:17:48 -08:00
Preston Van Loon
7cd6223755
Rename recent block hashes (#1029)
* update beacon-state proto to new spec

* AttestationData

* use bazel's pb.go

* boundry -> boundary

* Rename RecentBlockHashes to LatestBlockHashes
2018-12-02 15:25:55 -05:00
Preston Van Loon
e6d550a2c6
Refactor fork data (#1028)
* update beacon-state proto to new spec

* AttestationData

* use bazel's pb.go

* boundry -> boundary

* Refactor fork data

* comment
2018-12-02 15:19:49 -05:00
Raul Jordan
a99de08562
Merge Active/Cystallized State (#1019) 2018-12-01 16:09:12 -06:00
terence tsao
a4e565e3a7 Return Unused Error in State_transition (#1007)
* add todo for 712

* return unused err
2018-11-29 22:34:21 -06:00
terence tsao
13d805f398 Align Constant Variables With Latest Spec Changes (#989)
* add todo for 712

* update constants from latest spec
2018-11-28 16:46:04 -06:00
Raul Jordan
8c9c78f128
Merge Active/Crystallized State (#953) 2018-11-24 12:57:07 -06:00
Raul Jordan
30e34745e5
Refactor More Casper Functions Into Beacon-Chain/Core (#890) 2018-11-22 11:18:06 -08:00
Nishant Das
e0d13ec304 goimports (#882) 2018-11-21 06:27:04 -05:00
terence tsao
391eacd1d7
Refactor Casper Validators Into Core/Validators Stateless Package (#875) 2018-11-20 22:44:04 -08:00
Raul Jordan
a1c5499e77 Refactor Casper Incentives Into Core/Incentives Stateless Package (#870) 2018-11-20 22:23:18 -08:00
Raul Jordan
891dc2e2de
Define BeaconState Core Type and Protobuf Definition (#863)
* define protos for beacon state

* tests pass

* address feedback
2018-11-20 11:43:07 -08:00