h/t to the NuConstruct team for reporting this. The event feed
incorrectly sends epoch transition flag on head events when the first
slot of the epoch is missing (or reorgs across epoch transition).
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* `TestDataColumnSidecarsByRangeRPCHandler`: Remove commented code.
* Remove double import
* `dataColumnSidecarsByRangeRPCHandler`: Gracefully close the stream if no data to return.
* Tests: Change `require` to `assert` in goroutines in tests.
https://pkg.go.dev/github.com/stretchr/testify/require#hdr-Assertions
* Add changelog.
* Fix `/eth/v1/beacon/blob_sidecars/` beacon API is the fulu fork epoch is set to the far future epoch.
* Fix Terence's comment.
* adding a test
---------
Co-authored-by: james-prysm <james@prysmaticlabs.com>
* Add SizeSSZ as a member of SSZObject
* Temporarily rename dereferencePointer function
* Fix analyzeType: use reflect.Value for analyzing
* Fix PopulateVariableLengthInfo: change function signature & reset pointer
* Remove Container arm for Size function as it'll be handled in the previous branch
* Remove OffsetBytes function in listInfo
* Refactor and document codes
* Remove misleading "fixedSize" concept & Add Uint8...64 SSZTypes
* Add size testing
* Move TestSSZObject_Batch and rename it as TestHashTreeRoot
* Changelog :)
* Rename endOffset to fixedOffset
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* stored CL object to enable the usage Fastssz's HashTreeRoot(). added basic test
* refactorization - using interfaces instead of storing original object
* added tests covering ssz custom types
* renamed hash_tree_root to ssz_interface as it contains MarshalSSZ and UnmarshalSSZ functions
* run gazelle
* renamed test and improved comments
* refactored test and extend to marshalSSZ and UnmarshalSSZ
* added changelog
* updated comment
* Changed SSZIface name to SSZObject. Removed MarshalSSZ and UnmarshalSSZ function signatures from interface as they are not used still. Refactored tests.
* renamed file ssz_interface.go to ssz_object.go. merge test from ssz_interface_test.go into query_test.go.
reordered source SSZObject field from sszInfo struct
* sticked SSZObject interface to HashTreeRoot() function, the only one needed so far
* run gazelle :)
---------
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
* fix allocation size of proofs in ComputeCellsAndProofsFromStructured
the preallocated slice for KZG Proofs was 48x bigger than it needed to
be.
* changelog
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* Do not verify block data when calculating rewards
* remove `Get` from function names
* changelog <3
* do not verify sync committee sig in handler
* Revert "remove `Get` from function names"
This reverts commit 770a89d990.
* typo fix
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* feature: Use service context and continue on slasher attestation errors
* Create Galoretka_feature-slasher-feed-use-service-ctx
* Rename Galoretka_feature-slasher-feed-use-service-ctx to Galoretka_feature-slasher-feed-use-service-ctx.md
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* make registerSubscribers idempotent
* clean up debugging changes
* test fix
* rm unused var
* sobbing noises
* naming feedback and separate test for digestActionDone
* gazelle
* manu's feedback
* refactor to enable immediate sub after init sync
* preston comment re panic causing db corruption risk
* ensure we check that we're 1 epoch past the fork
* manu feedback
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* `findPeersWithSubnets`: If the `filter` function returns an error for a given peer, log an error and skip the peer instead of aborting the whole function.
* `computeIndicesByRootByPeer`: If the loop returns an error for a given peer, log an error and skip the peer instead of aborting the whole function.
* Add changelog.
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
* `buildStatusFromStream`: Use parent context.
* Status tests: Use `t.Context` everywhere.
* `buildStatusFromStream`: Respond statusV2 only if Fulu is enabled.
Without doing so, earliest available slot is never defined, and then `s.cfg.p2p.EarliestAvailableSlot` will block until the context is canceled.
* Send our real earliest available slot when sending a Status request post Fulu instead of `0`.
* Add changelog.
* Prettify logs for byRange/byRoot data column sidecar requests.
* Moving byRoot/byRange data column sidecars requests from peers to TRACE level.
* Move "Peer requested blob sidecar by root not found in db" in TRACE.
* Add changelog.
* Fix Kasey's comment.
* Apply Kasey's suggestion.
* Revert "`createLocalNode`: Wait before retrying to retrieve the custody group count if not present. (#15735)"
This reverts commit 4585cdc932.
* Revert "Fix no custody info available at start (#15732)"
This reverts commit 80eba4e6dd.
* Add context to `EarliestAvailableSlot` and `CustodyGroupCount` (no functional change).
* Remove double imports.
* `EarliestAvailableSlot` and `CustodyGroupCount`: Wait for custody info to be initialized.
* exclude unscheduled forks from the schedule
* update tests that relied on fulu being far future
* don't mess with the version->epoch mapping
* LastFork cheats the tests by filtering by far_future_epoch
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* ignore version/digest mismatch if far future
* bonus: this log generates a lot of noise, bump it down to trace
* unit test
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* Avoid unnecessary calls to ExitInformation()
ExitInformation runs a loop over the whole validator set. This is needed
in case that there are slashings or exits to be processed in a block (we
could be caching or avoid this entirely post-Electra though). This PR
removes these calls on normal state transition to this function. h/t to
@terencechain for finding out this bug.
In addition, on processing withdrawal requests and registry updates, we
kept recomputing the exit information at the same time that the state is
updated and the function that updates the state already takes care of
tracking and updating the right exit information. So this PR removes the
calls to compute this exit information on a loop. Notice that this bug
has been present even before we had a function `ExitInformation()` so I
will document here to help the reviewer
Our previous behavior is to do this in a loop
```
st, err = validators.InitiateValidatorExit(ctx, st, vIdx, validators.ExitInformation(st))
```
This is a bit problematic since `ExitInformation` loops over the whole validator set to compute the exit information (and the total active balance) and then the function `InitiateValidatorExit` actually recomputes the total active balance looping again over the whole validator set and overwriting the pointer returned by `ExitInformation`.
On the other hand, the funciton `InitiateValidatorExit` does mutate the state `st` itself. So each call to `ExitInformation(st)` may actually return a different pointer.
The function ExitInformation computes as follows
```
err := s.ReadFromEveryValidator(func(idx int, val state.ReadOnlyValidator) error {
e := val.ExitEpoch()
if e != farFutureEpoch {
if e > exitInfo.HighestExitEpoch {
exitInfo.HighestExitEpoch = e
exitInfo.Churn = 1
} else if e == exitInfo.HighestExitEpoch {
exitInfo.Churn++
}
```
So it simply increases the churn for each validator that has epoch equal to the highest exit epoch.
The function `InitiateValidatorExit` mutates this pointer in the following way
if the state is post-electra, it disregards completely this pointer and computes the highest exit epoch and updates churn inconditionally, so the pointer `exitInfo.HighestExitEpoch` will always have the right value and is not even neded to be computed before. We could even avoid the fist loop even. If the state is pre-Electra then the function itself updates correctly the exit info for the next iteration.
* Only care about exits pre-Electra
* Update beacon-chain/core/transition/transition_no_verify_sig.go
Co-authored-by: terence <terence@prysmaticlabs.com>
* Radek's review
---------
Co-authored-by: terence <terence@prysmaticlabs.com>
* attempting to improve duties v2
* removing go routine
* changelog
* unnessesary variable
* fixing test
* small optimization existing early on CommitteeAssignments function
* fixing small bug
* fixes performance issues with duties v2
* fixed changelog
* gofmt
* Sort sidecars by index before calling `RecoverCellsAndKZGProofs`.
Reason: Starting at `c-kzg-4844 v2.1.2`, the library needs input to be sorted.
* Update `c-kzg-4844` to `v2.1.3`
* Update `c-kzg-4844` to `v2.1.5`