Commit Graph

155 Commits

Author SHA1 Message Date
Preston Van Loon
55bedd0745 Move go-ssz to external repo under MIT license (#2722) 2019-05-29 18:04:25 -07:00
Nishant Das
678ffa607e Fix Bitfield in Attestations (#2565)
* fix bitfield

* test

* fix reference

* fix tests

* remove test

* fix test

* add new helper

* add test

* fix tests

* fix test

* gaz

* add continue
2019-05-11 16:49:09 -04:00
frederickalcantara
a170c69653 upgrading linter from gometalinter to golangci-lint (#2100)
* upgrading linter from gometalinter to golangci-lint

* fixed golangci-lint linting

* removed linting before_script command

* removed disable-all command

* Fixed golang config file

* fixed golang config file v2

* removed gosec issue rule

* formatting

* fixed travis build to run golangci-lint

* Add install golangci-lint command

* fixing golangci-lint script

* removed https://

* Added golangci-lint cmd script

* added go get for local lint install

* created a before_script

* add install before script

* Added get script

* added go mod download

* removed go mod downloads

* changed

* removed before script

* Added before script go get lint

* added exit zero to see what went wrong

* removed golang run script

* removed before script

* change lint command

* verbose output

* removed verbose

* change linter enable and disable configuration

* Update .golangci.yml

Removed gotype as a linter

* Update .golangci.yml

Added typecheck linter

* Update .golangci.yml

Added fixed lint version

* Update .golangci.yml

Added gotype

* Update .golangci.yml

Added typecheck

* removed env:lint

* Added env lint

* fixing lint upgrade

* Changing travis configuration

* FIxed spelling errors

* disabled typecheck

* Enabled typecheck

* remove binary

* Deleting lib binary

* adding more linters

* fixed constants

* fix spelling

* fixed all lint issues

* Revert "Changing travis configuration"

This reverts commit 334afe9d05e96261b01f275aa3ada20e7f36aac4.

* Merge branch 'master' of https://github.com/prysmaticlabs/prysm into update-linter

* Changed from Infof to Info

* Fixing commits

* fixing commits with linter config

* added install

* Fixing

* fix log statement
2019-04-26 14:24:01 +08:00
shayzluf
6c1740eefc Add Caching to Tree Hashing Algorithm (#1929)
* added todo to hash file in ssz

* params and copy of block cache

* start hash cache

* Hash cache implementation

* fixed some comments

* fixed promatheus duplicate counter name

* removed TODO

* change to use special expiration cache

* function name fixes junk object generator

* naming changes

* gazzle fix

* added pruning last read data test

* fixed gometallinter errors

* fix benchmarks and no int64 not serializable

* move struct from test

* add feature flag

* fix merge issues

* add featureflag to beacon and validator

* featureflag init for tests

* added feature flag to all ssz dependent tests

* remove setter func

* replace k8s tweaked expiration cache to https://github.com/karlseguin/ccache

* remove else

* change request by preston

* added init featureflags to genesis_test

* Update shared/ssz/hash_cache.go

add dot

Co-Authored-By: shayzluf <thezluf@gmail.com>

* Update shared/ssz/hash_cache.go

Co-Authored-By: shayzluf <thezluf@gmail.com>

* Update shared/ssz/hash_cache.go

remove extra space

Co-Authored-By: shayzluf <thezluf@gmail.com>

* Update shared/params/config.go

add dot

Co-Authored-By: shayzluf <thezluf@gmail.com>

* Update shared/featureconfig/config.go

remove dot

Co-Authored-By: shayzluf <thezluf@gmail.com>

* Update shared/featureconfig/config.go

remove dot

Co-Authored-By: shayzluf <thezluf@gmail.com>

* remove powchain from prometheus hash cache name

* fixes fron change requests

* fix change requests

* remove faulty merge test

* gazelle fix

* fix fmt.sprintf

* remove debug binary

* fix gazelle
2019-04-24 13:39:02 +08:00
Raul Jordan
51d4965388 Enable Committee Cache By Default (#2323) 2019-04-22 06:37:42 -07:00
terence tsao
e4e6940c17
Update Latest Attestations Use Committee Cache (#2265) 2019-04-16 20:08:55 -07:00
terence tsao
ae3eb0f199 fixed comments (#2234) 2019-04-12 11:43:28 -05:00
terence tsao
5a1cfacc80 Use Committee Cache for Assignment (#2237)
* fixed comments

* fixed comments

* use committee cache for CommitteeAssignment

* added tests for using cache for assignment

* addressed preston's feedback

* addressed nishant's feedback
2019-04-12 10:31:01 -05:00
terence tsao
b6bd8ba63d Committee Cache for State Transition (#2228)
* starting to get feedback

* better name

* export the necessary variables

* finished implementation in AttestationParticipants

* refactor deopendency issue

* gaz and fixed cache test

* fixed all the tests and lint

* clean up part 1

* lint

* fixed test

* fixed visibility

* cache tests for AttestationParticipants
2019-04-11 14:34:23 -05:00
Raul Jordan
249ec8751b Revert "Implement Cache Committee for RPC Server (#2151)" (#2227) 2019-04-11 07:50:01 +10:00
terence tsao
c2deace3f4 Implement Cache Committee for RPC Server (#2151)
* add committees cache

* Hook committee cache to rpc service

* fixed TestCommitteeAssignment_OK

* comments for ValidatorAssignment

* added tests for committees cache

* more updates to committee_cache_test.go

* new tests in validator_Server_test for cached/uncached scenearios

* removed ????

* gaz

* fmt

* added feature flags

* fmt

* remove hello

* uncomment

* lint

* Update beacon-chain/rpc/validator_server.go

Co-Authored-By: terenc3t <terence@prysmaticlabs.com>

* preseton's feedback

* better err handling

* fixed tests
2019-04-10 03:36:49 -04:00
terence tsao
97b5ef0cc2
remove unused funcs and vars (#2214) 2019-04-08 16:29:02 +10:00
Nishant Das
687f797dd8 Post Chainstart Fix (#2158)
* fixed seed and correct epoch

* fix test and add comments
2019-04-04 20:13:49 -07:00
terence tsao
4e5c08f2a8
Use a mutex/lock on the validator store (#2104) 2019-03-28 16:19:42 -07:00
terence tsao
c777ce6546
Fix active validator indices for shuffling (#2101) 2019-03-28 15:31:46 -07:00
terence tsao
761f3352a0 Fix current epoch committee count (#2099)
* fix current epoch committee count

* prev epoch
2019-03-27 22:10:10 -05:00
Raul Jordan
7a83acf46d
Improve Validator Logging and Default Flags (#2013)
* improve validator logging significantly

* warn validator not yet assigned to epoch

* build added

* report validator logs

* validator performance logging

* all logging improvements

* validator attest better logs

* improved attester logging

* average balances

* dont hash useless hashes

* Update validator/client/validator_propose.go

Co-Authored-By: rauljordan <raul@prysmaticlabs.com>

* address some comments

* standardize with block root hash32, renamings

* gazelle

* builds

* improve average eth balance

* eth net gains/losses

* fix tests

* spacing

* goimports

* avg balance

* update pbs

* addressed preston comments

* imports

* gazelle
2019-03-18 09:45:28 -06:00
Nishant Das
00ca1d7991 Fix Errors with Attestation to Current Chainhead (#1990)
* fix errors

* fix bit check to little endian

* fix all tests
2019-03-14 12:29:44 -04:00
Preston Van Loon
509c973936 minor fixes (#1949) 2019-03-08 21:12:38 -06:00
terence tsao
17682321fe
Clean Up Validator RPC Server (#1798) 2019-03-03 14:55:12 -08:00
terence tsao
94e6cfe478
Refactor Crosslink Committees at Slot (#1771) 2019-03-02 19:14:04 -08:00
terence tsao
852214e497
Remove Next Epoch Registry Change Checks (#1761) 2019-02-28 07:27:43 -08:00
terence tsao
4bc324dc95
Make Getting Epoch Assignment Generic (#1746) 2019-02-27 17:16:05 -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
terence tsao
79252f1e96 Fix committee assignment bugs (#1740)
* moved processiing logs to block chain service layer

* fix-committee-start-shard-bug

* typo

* fixed test
2019-02-27 13:36:37 -06:00
terence tsao
84a6d2dcc5 Fix Get Previous Epoch Logic (#1721)
* moved processiing logs to block chain service layer

* fixed prev epoch logic
2019-02-26 11:53:36 -06:00
Raul Jordan
ed156e7c0e
use reg change flag everywhere (#1722) 2019-02-26 11:27:27 -06:00
Raul Jordan
f5178ef4a6 registry change fix (#1713) 2019-02-25 20:19:24 -08: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
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
Ivan Martinez
0d29b2cd91 Makes test naming consistent across codebase (#1636) 2019-02-22 07:11:26 -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
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
terence tsao
8b661c9540
CheckBit to work with small endian (#1628) 2019-02-18 12:45:20 -08: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
terence tsao
eab64062d7
Fixed Epoch Committee Count's Lower Bound to 1 (#1604) 2019-02-14 18:06:09 -08:00
Nishant Das
bddceda33b Implement Verify Bitfield (#1562) 2019-02-14 01:17:54 +00: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
terence tsao
f8d8865020
Moved Rewards/Penalties Helpers to Helper Packages (#1583) 2019-02-13 17:33:45 +00:00
terence tsao
471b2ed8e1
Implement get_next_epoch_committee_assignment helper function (#1552) 2019-02-12 16:20:31 +00: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
terence tsao
d837e5ef9e Aligning ETH2.0 spec - Attestation and Epoch Processing - Part 1 (#1519)
* fixed epoch_processing

* updated references in code

* starting fixing tests

* fixed rest of the tests. yay

* fixed transition test again
2019-02-07 15:46:22 -06:00
terence tsao
b099f5d216 Aligning ETH2.0 spec - Update Validator Fields (#1513)
* remove ValidatorRegistryDeltaBlock

* fixed tests after changing validator functions to epoch first

* gaz
2019-02-06 15:46:05 -06:00
Nishant Das
9ecef934d8 Update Beacon State to Match the Spec (#1489)
* first line of changes

* fix all tests in core package

* Finished fixing up all tests

* docs

* more docs
2019-02-06 10:44:27 -06:00
terence tsao
2441266898
Aligning ETH2.0 spec - Crosslink Records (#1507)
* updated proto state fields to unlock alignment

* moved AttestationParticipants to rightful location

* crosslink committees to use epoch
2019-02-06 15:00:50 +01:00
terence tsao
a4b5666059 Aligning ETH2.0 spec - Update Fork and Domain Helpers (#1501)
* updated proto state fields to unlock alignment

* updated domain and fork helpers

* fixed comments

* fixed comments
2019-02-05 23:34:22 -06:00
Nishant Das
c48f9c96e0
Allow Simulated Backend to Advance Chain (#1445)
* initialize beacon state separately

* extracting out testcase into another func

* creating function for simulated objects

* creating simulated object struct

* final clean up

* documentation

* lint

* adding chain advancer

* review comments

* replacing lib

* adding initialization for chain and new vars in struct

* added func

* fixing tests and all other bugs

* fixing tests

* docs

* adding a new nil block function

* adding test

* remove check for nil blocks

* godoc

* fixing merge conflicts, tests

* fix test
2019-02-06 10:18:55 +08:00
terence tsao
003d686f70
updated proto state fields to unlock alignment (#1497) 2019-02-05 21:14:29 +01:00
terence tsao
506db55be5
Aligning ETH2.0 spec - Make Epoch First Citizen (Shuffling and GetCrosslinkAtSlot) (#1488) 2019-02-05 19:52:14 +01: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
terence tsao
21ac564631
Aligning ETH2.0 spec - Make Epoch First Citizen (Package: Validators) (#1460) 2019-02-04 21:34:33 +01:00
terence tsao
3acffd878c
Aligning ETH2.0 spec - RANDAO helpers (#1454) 2019-02-01 22:22:52 +01:00
terence tsao
cdf50e2fa2 Aligning ETH2.0 Spec - Implemented Slot & Epoch Helpers (#1447)
* starting to use SlotToEpoch...

* updated exisiting functions...

* fixed epoch tests

* fixed rest of the tests

* tests for newly added helper functions

* fixed visiblity

* added PrevEpoch and NextEpoch helpers

* lint

* removed file from other commit
2019-02-02 00:52:35 +08:00