Commit Graph

51 Commits

Author SHA1 Message Date
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
Raul Jordan
9839753880
Use HTTP RPC Endpoint for Logger to Fetch Past Logs (#2299)
* use http logger

* using http logger for past logs

* replace by http logger
2019-04-18 18:53:37 -05:00
Ivan Martinez
62279489a3 Add deposit index to beacon state (#2232)
* Begin adding Deposit Index to beacon state

* Move deposit index increment to ProcessDeposit

* Fix initial deposits bug

* Fix bug in RPC

* More bug fixes

* Fix RPC bug, ensure deposits are processed in the right order

* Fix tests

* Fix merge

* Attempt to fix pruning deposits on regular sync

* Fix pending deposits on node restart

* Fix test

* Fix tests properly

* Gofmt

* Remove unneeded logs

* Fix build
2019-04-14 18:17:39 +10:00
Raul Jordan
544c040fcb
restructure powchain (#1983) 2019-03-13 16:47:00 -04:00
Raul Jordan
c1a9937760
Post ChainStart Validator Activation (#1934)
* implemented all the merkle func signatures

* branch indices complete

* check for index out of range in generating merkle proof

* completed full tests for sparse merkle trie impl

* lint

* formatting

* gazelle

* commentary

* ivan comments

* fmt

* get rid of the deposit trie

* recalculate trie when eth1 data changes

* default data response recalculates tree

* update merkle trie to use raw bytes

* use the new verify merkle root func

* builds

* if default data response historical deposits are empty, return the deposit root at the contract at the time

* work on trie

* trying again with more logging

* keep track of merkle trie indices, use correct big int ops

* use uint for merkle idx

* add todo

* update ticker correctly

* fix config and remove unnecessary logs

* readd plus one fix

* clarify some details

* weird imports spacing

* gazelle, lint

* fix tests using the new deposit trie

* builds but tests still fail

* rpc tests

* lint

* tests pass

* bazel lint

* rem commented block

* revert att slot fix

* preston comments

* comments

* fix build

* address last comment

* use counter

* imports
2019-03-12 00:05:55 -04:00
Preston Van Loon
e4588d9be0
Revert "Create and Verify Signatures for Attestations (#1908)" (#1958)
This reverts commit 23072983ff.
2019-03-10 20:02:47 -04:00
Nishant Das
028506e7ed Handle Panics in Remaining Services (#1926)
* add recovery for initial sync

* add recovery for rpc

* adding to other services

* remaining services and tests

* fix test

* remove changes to rpc

* handle powchain

* handle in powchain

* abstract to shared package

* gazelle

* lint

* remove for operations

* add in more for operations

* travis

* fix lint
2019-03-10 17:53:28 -05:00
Ivan Martinez
23072983ff Create and Verify Signatures for Attestations (#1908)
* Verify signatures of attestations

* Implement BLS Signing for attestations

* Remove custody bit 0 from the attestation for now

* Fixes tests for attestations

* Fix tests to ensure they use proper attester indice

* Run gazelle

* Goimports

* Test attestation sigs in block operations

* Change formatting and make sure signatures are actually verified

* Fix duplicate import

* Fix duplicate import from merge

* Organize attestation sig to be conssitent with codebase

* Update to comments

* Change signatures to use aggregation

* Run gazelle

* Change function to return err instead of bool
Also gofmt

* Fix for comments

* Move createAggregationSignature to a function in attestations.go
2019-03-08 15:30:01 +08:00
Nishant Das
07a25ca710 Adding Prometheus Metrics and Tracing to Sync (#1858)
* adding tracing and metrics

* clean up main routine

* added tracing to initial sync

* gazelle

* fix tests

* fix naming

* comments

* consistent style in promauto counters

* rename spans

* final comment
2019-03-05 11:31:19 -06:00
skillful-alex
4194d78bed Add Web3Service Health Checks. (Issue #1204) (#1581)
* described the Status () function

* web3 service health checks

* remove method LatestBlockTime and add tests

* remove lastHeadInteractTime

* corrected conflicts of different branches of development

* goimports -w beacon-chain/powchain/service_test.go
2019-03-04 15:37:24 -05:00
Ivan Martinez
5aa7320507 Clear Up Code Inconsistencies (#1836) 2019-03-03 09:31:29 -08:00
Preston Van Loon
4bf0ec0720 Block caching for ETH1Data (includes #1760) (#1769)
* add tests for cache

* changes to test

* add pruning and tests

* add fifo queue

* revamped key function

* fix all methods to use new fifo queue

* fix tests and gazelle

* refactor block cache

* lint

* add a bit more testing to service_test
2019-03-01 14:31:38 -06:00
Preston Van Loon
a19cb1864e Tracing additions (#1747) 2019-02-27 19:55:47 -08:00
Raul Jordan
c2ad89a8b6
invalid timestamp from log issue (#1720) 2019-02-26 15:19:51 -06:00
Ivan Martinez
06a9b582a0 Implement BlockExists and BlockHashByHeight (#1682) 2019-02-23 18:58:13 -08:00
Ivan Martinez
0d29b2cd91 Makes test naming consistent across codebase (#1636) 2019-02-22 07:11:26 -08:00
Raul Jordan
718f99ee10
Custom ChainStart Genesis Time Delay in Deposit Contract (#1666)
* custom delay

* completed custom delay
2019-02-21 10:51:29 -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
Preston Van Loon
259cbd7c6c Contract drain (for test/debug only!) (#1648) 2019-02-19 14:01:41 -08: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
Nishant Das
25e0d6fe34 Adding batched logs (#1605)
* adding batched logs

* remove arg

* set requestBlkNum

* changing to debug

* adding log delay
2019-02-16 15:00:52 -06:00
Nishant Das
fa47e0fd95 Add ChainStart Delay Flag (#1591)
* add flag

* log formatting

* fix test

* do not process logs if flag is enabled
2019-02-14 11:11:03 -06:00
Raul Jordan
fb9d60c377
Update References to Deposit Contract, Update Flags (#1576)
* update readme

* rename k8 file
2019-02-13 13:08:28 -06:00
Raul Jordan
cd415b0eda
Track Previously Seen Merkle Index to Prevent Duplicate Log Spam (#1566)
* 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

* using genesis timestamp instead of bool

* update with gofmt

* make more fields public

* duplicate log spam inconsistent root fixed by tracking last seen index

* sync with master

* readd weird removal of import

* readd libp2p import

* gazelle

* readd eth

* comments
2019-02-12 13:50:39 -06:00
Raul Jordan
5c06e326cf
Use Public, Constant Genesis Timestamp in Deposit Contract Instead of ChainStart Bool (#1557)
* 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

* using genesis timestamp instead of bool

* update with gofmt

* make more fields public
2019-02-12 11:06:52 -06: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
Raul Jordan
12524ae8dd
Update RANDAO to Match Spec (#1533)
* fix bug in eth1 data vote count increases

* updating attester slashings

* is double vote and attester pseudocode

* attester slashing revamp complete

* exits processing complete

* all block operations aligned to spec

* completed test revamp

* builds properly

* all done FINALLY

* deprecate all instances of old randao logic

* fix all broken tests and cleanup randao references across repo

* builds but tests failing

* fixing broken chaintests

* only chaintests fail now

* randao fully updated

* add bls todo

* lint

* travis

* fix unresolved property in struct

* remove used randao var
2019-02-09 14:35:51 -06:00
Preston Van Loon
031a9c96b9 Use better deposit logging at info (#1528)
* Use better logging at info

* Update service_test.go
2019-02-08 15:25:35 -06:00
Nishant Das
b07a3c3bb8 Update Deposit Contract (#1494)
* Update deposit Contarct

* updating deposit trie

* add verifyMerkleBranch

* fix test

* fixed all tests

* fix other tests

* fixing a test

* All tests are fixed

* lint

* fix lint
2019-02-08 11:01:15 -06:00
Preston Van Loon
58ca71af23 Insert pending deposits (#1495)
* Update config for deposits processing

* Add pending deposits database methods

* oops forgot the files

* move the lock after the nil check

* move the lock after the nil check

* test inclusion behavior

* Insert pending deposits on process deposit log
2019-02-05 11:25:09 -06:00
Preston Van Loon
4fc8a3881a
Use a better message for notifying of a new deposit (#1491) 2019-02-05 09:07:42 -05: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
Raul Jordan
cec6c8de83 Standardize Naming of Shared Packages, Remove Deprecated Packages (#1435)
* rem txpool

* standardize repo shared utils, remove deprecated items

* complete

* package lvl godoc
2019-01-31 10:53:58 +08:00
Raul Jordan
ec9240106e
Implement WaitForChainStart RPC Server and Client (#1421) 2019-01-30 13:28:53 +01:00
Raul Jordan
98a4274b81
Refactor ChainService for Synchronous Tests and ChainStart (#1347)
* can now test blockchain service synchronously

* completed chainstart listener

* fix comment

* completed refactor

* fix

* fix build

* rem genesis fetch

* fix broken

* fixed concurrency bug

* comments
2019-01-28 19:59:37 +08:00
Nishant Das
1e862511aa
Replace Solidity Contract With Vyper (#1343)
* adding deposit contract

* Adding bindings

* remove unused info

* shifting deploy function over

* new changes

* fixing tests and moving log utils to contract package

* new changes,helpers, fixing tests

* fix failing test

* readme

* contract change

* changes to contract

* new changes,helpers, fixing tests

* missing files

* adding constructor to contract

* lint

* updating with spec

* finally got it fixed

* add in deposit arguments

* new changes

* all tests pass

* addresing raul's and terence's comments

* remove vrc
2019-01-28 16:45:28 +08:00
Nishant Das
08a06458d9 Add in ChainStart Listener (#1327)
* changing handling of logs

* gazelle

* removing outdated vars

* fixing tests

* adding vrc bindings to service

* updating vrc sol and bindings

* more changes

* adding trie

* remove functions

* addressing preston's review

* tests

* gazelle

* fixed tests

* note

* Lint

* doc

* exploration test

* adding new methods and tests

* adding log type checker

* lint

* Adding processChainstartLog

* gazelle

* addressing comments

* addressing comments and adding tests

* review comments

* comment

* comment

* abi naming
2019-01-17 23:14:32 +08:00
Nishant Das
75a431c969 Modify PowChain service (#1289)
* changing handling of logs

* gazelle

* removing outdated vars

* fixing tests

* adding vrc bindings to service

* updating vrc sol and bindings

* more changes

* adding trie

* remove functions

* addressing preston's review

* tests

* gazelle

* fixed tests

* note

* Lint

* doc

* exploration test

* adding new methods and tests

* adding log type checker

* lint

* gazelle

* addressing comments
2019-01-16 22:01:21 +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
Preston Van Loon
763d0d6bdc
Add Go tools in bazel (#608)
* add atlassian bazel tools

* Add bazel entrypoints for native go stuff

* gazelle
2018-10-02 22:04:36 -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
Preston Van Loon
366124991b Allow users to use 0x prefix for their pubkey (#500) 2018-09-11 18:55:05 -07:00
terence tsao
06ca8e758f beacon: Improve Test Coverage for Beacon Chain Package (#402) 2018-08-14 22:49:59 -06:00
terence tsao
7841c53db0 Each Service Should Run a Single Main Routine (#382) 2018-08-07 12:56:28 -05:00
Raul Jordan
cccd675a84
beacon: Initial Sync Network Simulator (#341) 2018-07-30 23:41:27 -05: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
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
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