Address @jtraglia's comments regarding Electra code (#14833)

* change field IDs in `AggregateAttestationAndProofElectra`

* fix typo in `validator.proto`

* correct slashing indices length and shashings length

* check length in indexed attestation's `ToConsensus` method

* use `fieldparams.BLSSignatureLength`

* Add length checks for execution request

* fix typo in `beacon_state.proto`

* fix typo in `ssz_proto_library.bzl`

* fix error messages about incorrect types in block factory

* add Electra case to `BeaconBlockContainerToSignedBeaconBlock`

* move PeerDAS config items to PeerDAS section

* remove redundant params

* rename `PendingDepositLimit` to `PendingDepositsLimit`

* improve requests unmarshaling errors

* rename `get_validator_max_effective_balance` to `get_max_effective_balance`

* fix typo in `consolidations.go`

* rename `index` to `validator_index` in `PendingPartialWithdrawal`

* rename `randomByte` to `randomBytes` in `validators.go`

* fix for version in a comment in `validator.go`

* changelog <3

* Revert "rename `index` to `validator_index` in `PendingPartialWithdrawal`"

This reverts commit 87e4da0ea2.
This commit is contained in:
Radosław Kapka
2025-01-31 16:41:52 +01:00
committed by GitHub
parent d887536eb7
commit 4a63a194b1
24 changed files with 96 additions and 233 deletions

View File

@@ -380,8 +380,8 @@ func Reverse[E any](s []E) []E {
}
// VerifyMaxLength takes a slice and a maximum length and validates the length.
func VerifyMaxLength[T any](v []T, max int) error {
l := len(v)
func VerifyMaxLength[T any](v []T, max uint64) error {
l := uint64(len(v))
if l > max {
return fmt.Errorf("length of %d exceeds max of %d", l, max)
}