* First take at updating everything to v5
* Patch gRPC gateway to use prysm v5
Fix patch
* Update go ssz
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
* Break out several helpers from `postBlockProcess`
In addition fix a bug found by @terencechain where we should use a slot
context instead of the parent context in the second FCU call.
* Remove calls for tracked proposer
getPayloadAttribute already takes care of this
Also compute correctly the time into voting window
* call with attributes only when incoming block is canonical
* check for empty payload instead of only nil
* add unit tests
* move log for non-canonical block
* return early if the incoming block does not change head
* Pass fcuArgs as arguments
* lint
* refactor initialization to blocking startup method
* require genesisSetter in blockchain, fix tests
* work-around gazelle weirdness
* fix dep gazelle ignores
* only call SetGenesis once
* fix typo
* validator test setup and fix to return right error
* move waitForChainStart to Start
* wire up sync Service.genesisWaiter
* fix p2p genesisWaiter plumbing
* remove extra clock type, integrate into genesis
and rename
* use time.Now when no Nower is specified
* remove unused ClockSetter
* simplify rpc context checking
* fix typo
* use clock everywhere in sync; [32]byte val root
* don't use DeepEqual to compare [32]byte and []byte
* don't use clock in init sync, not wired up yet
* use clock waiter in blockchain as well
* use cancelable contexts in tests with goroutines
* missed a reference to WithClockSetter
* Update beacon-chain/startup/genesis.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* Update beacon-chain/blockchain/service_test.go
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* more clear docs
* doc for NewClock
* move clock typedef to more logical file name
* adding documentation
* gaz
* fixes for capella
* reducing test raciness
* fix races in committee cache tests
* lint
* add tests on Duration slot math helper
* startup package test coverage
* fix bad merge
* set non-zero genesis time in tests that call Start
* happy deepsource, happy me-epsource
* replace Synced event with channel
* remove unused error
* remove accidental wip commit
* gaz!
* remove unused event constants
* remove sync statefeed subscription to fix deadlock
* remove state notifier
* fix build
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: nisdas <nishdas93@gmail.com>
* Track head slot through head block
* Update beacon-chain/blockchain/head.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* update head should go even without attestations
* add unit tests
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
* panic in SizeSSZ
* moving slowly
* adapt old code to new interfaces
* return interfaces from factory functions
* replace the rest of WrappedSignedBeaconBlock
* WrappedBeaconBlock
* WrappedBeaconBlockBody
* miscellaneous
* Test_BeaconBlockIsNil
* replace usages of BeaconBlockIsNil
* replace usages of mutator
* fix all build errors
* fix some more issues
* mutator changes
* relax assertions when initializing
* revert changes in object_mapping.go
* allow calling Proto on nil
* Revert "allow calling Proto on nil"
This reverts commit ecc84e455381b03d24aec2fa0fa17bddbec71705.
* modify Copy and Proto methods
* remove unused var
* fix block batch tests
* correct BUILD file
* Error when initializing nil objects
* one more error fix
* add missing comma
* rename alias to blocktest
* add logging
* error when SignedBeaconBlock is nil
* fix last test
* import fix
* broken
* working
* test fixes
* reduce complexity of processPendingBlocks
* simplified
* 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>
* Cache and use justified and finalized payload block hash
* Fix tests
* Use real byte
* Fix conflicts
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>
* Save cached initial sync blocks before getting head block
* Add better abstraction to get block
* Move unlock read to a better location
* Feedbacks
* Add head changed logging
* Harder hasBlock requirement
* Update beacon-chain/blockchain/service.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
* Update receive_attestation.go
* Don't process head if the block is unknown
* Use a helper method
* Fix test
Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.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>
* add process slashings
* verify sig
* add method
* add test
* add in process slashings functionality
* target state for aggregate
* comment
* Radek comments