* Only prune in newer finalization
* add regression test
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Change forkchoice API
doubly-linked-tree changes
* protoarray changes
* blockchain tests
* rebase and fix conflicts
* More blockchain fixes
* blockchain test fixes
* doubly linked tree changes again
* protoarray changes v2
* blockchain packages v2
* Radek's review
* Fix on batch processing
* Terence's review
* fill in at start
* Revert "fill in at start"
This reverts commit 8c11db063a02a59df8e0ac6d0af0c8923921dc76.
* wrap error message
* fill in before mutating the state
* wrap nil node errors
* handle unknown optimistic status on init sync
* rename insert function
* prune on batches only after forkchoice insertion
Co-authored-by: terencechain <terence@prysmaticlabs.com>
* Move chain inclusions to forkchoice handling
* gaz
* return early if no blocks are pending
* Terence's review
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* Process atts and updeate head
* Fix ctx
* New test and old tests
* Update validator_test.go
* Update validator_test.go
* Update service.go
* Rename to UpdateHead
* Update receive_attestation.go
* Update receive_attestation.go
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* replace eth2 types
* replace protos
* regen proto
* replace
* gaz
* deps
* amend
* regen proto
* mod
* gaz
* gaz
* ensure build
* ssz
* add dep
* no more eth2 types
* no more eth2
* remg
* all builds
* buidl
* tidy
* clean
* fmt
* val serv
* gaz
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* gazelle
* tests passing
* use the same engine client
* pass
* initialize in right place
* erge
* build
* imports
* ensure engine checks work
* pass powchain tests
* powchain tests pass
* deepsource
* fix up node issues
* gaz
* endpoint use
* baz
* b
* conf
* lint
* gaz
* move to start function
* test pass
* spectest
* uncomment shas
* Fc spec test service shouldn't not spawn attestation routine
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* Add static analysis for unsafe uint casting
* Fix violations of uintcast
* go mod tidy
* Add exclusion to nogo for darwin build
* Add test for math.Int
* Move some things to const so they are assured not to exceed int64
* Self review
* lint
* fix tests
* fix test
* Add init check for non 64 bit OS
* Move new deps from WORKSPACE to deps.bzl
* fix bazel build for go analysis runs
* Update BUILD.bazel
Remove TODO
* add math.AddInt method
* Add new test casts
* Add case where builtin functions and declared functions are covered
* Fix new findings
* cleanup
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
* transition proto
* gen pb
* builds
* impl transition config
* begin tests
* transition config messed up
* amend proto
* use str
* passing
* gaz
* config
* client test
* pb
* set to 0
* rem log
* gaz
* check transition config
* check config differences
* check transition config in background
* gaz
* pass
* redundant
* fix up error handling and healthz
* simplify status
* gazelle
* build
* err config check
* test
* gaz
* Fix run time
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* allow checkpoint or genesis origin; refactoring
some quick readability improvements and simplifying the logic enforcing
the startup ordering of the attestation processing routine
* address PR feedback
* gofmt
* Update beacon-chain/blockchain/receive_attestation.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* Apply suggestions from code review
use log.WithError for aggregation friendliness
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: kasey <kasey@users.noreply.github.com>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* quick lazy balance cache proof of concept
* WIP refactoring to use lazy cache
* updating tests to use functional opts
* updating the rest of the tests, all passing
* use mock stategen where possible
reduces the number of test cases that require db setup
* rename test opt method for clear link
* Update beacon-chain/blockchain/process_block.go
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
* test assumption that zerohash is in db
* remove unused MockDB (mocking stategen instead)
* fix cache bug, switch to sync.Mutex
* improve test coverage for the state cache
* uncomment failing genesis test for discussion
* gofmt
* remove unused Service struct member
* cleanup unused func input
* combining type declaration in signature
* don't export the state cache constructor
* work around blockchain deps w/ new file
service_test brings in a ton of dependencies that make bazel rules
for blockchain complex, so just sticking these mocks in their own
file simplifies things.
* gofmt
* remove intentionally failing test
this test established that the zero root can't be used to look up the
state, resulting in a change in another PR to update stategen to use the
GenesisState db method instead when the zero root is detected.
* fixed error introduced by develop refresh
* fix import ordering
* appease deepsource
* remove unused function
* godoc comments on new requires/assert
* defensive constructor per terence's PR comment
* more differentiated balance cache metric names
Co-authored-by: kasey <kasey@users.noreply.github.com>
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* weak subjectivity verification refactor
This separates weak subjectivity verification into a
distinct type which does not have a dependency on
blockchain.Service
* remove unused variable
* saving enqueued init blocks before ws verify
* remove TODO, handled in previous commit
* accept suggested comment change
start comment w/ name of function NewWeakSubjectivityVerifier
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* update log w/ Raul's suggested language
* explicit zero value for clarity
* add comments clarifying how we adhere to spec
* more clear TODO per Raul's feedback
* gofmt
Co-authored-by: kasey <kasey@users.noreply.github.com>
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>