Skip to content

Commit

Permalink
Set fields of wrapped proto object in light client setters (#14573)
Browse files Browse the repository at this point in the history
* Set fields of wrapped proto object in light client setters

* changelog <3
  • Loading branch information
rkapka committed Nov 3, 2024
1 parent 4e5f72b commit 46ae78a
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 53 deletions.
45 changes: 4 additions & 41 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

## [Unreleased](https://github.com/prysmaticlabs/prysm/compare/v5.1.2...HEAD)
## [Unreleased](https://github.com/prysmaticlabs/prysm/compare/v5.1.1...HEAD)

### Added

Expand All @@ -30,17 +30,6 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve
- Return false from HasBlock if the block is being synced.
- Cleanup forkchoice on failed insertions.
- Use read only validator for core processing to avoid unnecessary copying.
- Use ROBlock across block processing pipeline.
- Added missing Eth-Consensus-Version headers to GetBlockAttestationsV2 and GetAttesterSlashingsV2 endpoints.
- When instantiating new validators, explicit set `Slashed` to false and move `EffectiveBalance` to match struct definition.
- Updated pgo profile for beacon chain with holesky data. This improves the profile guided
optimizations in the go compiler.
- Use read only state when computing the active validator list.
- Simplified `ExitedValidatorIndices`.
- Simplified `EjectedValidatorIndices`.
- `engine_newPayloadV4`,`engine_getPayloadV4` are changes due to new execution request serialization decisions, [PR](https://github.com/prysmaticlabs/prysm/pull/14580)
- Use ROBlock earlier in block syncing pipeline.
- Changed the signature of `ProcessPayload`

### Deprecated

Expand All @@ -49,42 +38,17 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve
### Removed

- Removed finalized validator index cache, no longer needed.
- Removed validator queue position log on key reload and wait for activation.

### Fixed

- Fixed mesh size by appending `gParams.Dhi = gossipSubDhi`
- Fix skipping partial withdrawals count.
- wait for the async StreamEvent writer to exit before leaving the http handler, avoiding race condition panics [pr](https://github.com/prysmaticlabs/prysm/pull/14557)
- Certain deb files were returning a 404 which made building new docker images without an existing
cache impossible. This has been fixed with updates to rules_oci and bazel-lib.
- Fixed an issue where the length check between block body KZG commitments and the existing cache from the database was incompatible.
- Fix `--backfill-oldest-slot` handling - this flag was totally broken, the code would always backfill to the default slot [pr](https://github.com/prysmaticlabs/prysm/pull/14584)
- Fix keymanager API should return corrected error format for malformed tokens
- Fix keymanager API so that get keys returns an empty response instead of a 500 error when using an unsupported keystore.
- Small log imporvement, removing some redundant or duplicate logs
- EIP7521 - Fixes withdrawal bug by accounting for pending partial withdrawals and deducting already withdrawn amounts from the sweep balance. [PR](https://github.com/prysmaticlabs/prysm/pull/14578)

- recover from panics when writing the event stream [pr](https://github.com/prysmaticlabs/prysm/pull/14545)
- Return the correct light client payload proof. [PR](https://github.com/prysmaticlabs/prysm/pull/14565)
- Set fields of wrapped proto object in light client setters. [PR](https://github.com/prysmaticlabs/prysm/pull/14573)

### Security

## [v5.1.2](https://github.com/prysmaticlabs/prysm/compare/v5.1.1...v5.1.2) - 2024-10-16

This is a hotfix release with one change.

Prysm v5.1.1 contains an updated implementation of the beacon api streaming events endpoint. This
new implementation contains a bug that can cause a panic in certain conditions. The issue is
difficult to reproduce reliably and we are still trying to determine the root cause, but in the
meantime we are issuing a patch that recovers from the panic to prevent the node from crashing.

This only impacts the v5.1.1 release beacon api event stream endpoints. This endpoint is used by the
prysm REST mode validator (a feature which requires the validator to be configured to use the beacon
api intead of prysm's stock grpc endpoints) or accessory software that connects to the events api,
like https://github.com/ethpandaops/ethereum-metrics-exporter

### Fixed

- Recover from panics when writing the event stream [#14545](https://github.com/prysmaticlabs/prysm/pull/14545)

## [v5.1.1](https://github.com/prysmaticlabs/prysm/compare/v5.1.0...v5.1.1) - 2024-10-15

Expand Down Expand Up @@ -118,7 +82,6 @@ Updating to this release is recommended at your convenience.
- fastssz version bump (better error messages).
- SSE implementation that sheds stuck clients. [pr](https://github.com/prysmaticlabs/prysm/pull/14413)
- Added GetPoolAttesterSlashingsV2 endpoint.
- Use engine API get-blobs for block subscriber to reduce block import latency and potentially reduce bandwidth.

### Changed

Expand Down
8 changes: 6 additions & 2 deletions beacon-chain/core/light-client/lightclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ func NewLightClientUpdateFromBeaconState(
if err != nil {
return nil, errors.Wrap(err, "could not get attested light client header")
}
result.SetAttestedHeader(attestedLightClientHeader)
if err = result.SetAttestedHeader(attestedLightClientHeader); err != nil {
return nil, errors.Wrap(err, "could not set attested header")
}

// if update_attested_period == update_signature_period
if updateAttestedPeriod == updateSignaturePeriod {
Expand Down Expand Up @@ -208,7 +210,9 @@ func NewLightClientUpdateFromBeaconState(
if err != nil {
return nil, errors.Wrap(err, "could not get finalized light client header")
}
result.SetFinalizedHeader(finalizedLightClientHeader)
if err = result.SetFinalizedHeader(finalizedLightClientHeader); err != nil {
return nil, errors.Wrap(err, "could not set finalized header")
}
} else {
// assert attested_state.finalized_checkpoint.root == Bytes32()
if !bytes.Equal(attestedState.FinalizedCheckpoint().Root, make([]byte, 32)) {
Expand Down
4 changes: 2 additions & 2 deletions consensus-types/interfaces/light_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ type LightClientUpdate interface {
Proto() proto.Message
Version() int
AttestedHeader() LightClientHeader
SetAttestedHeader(header LightClientHeader)
SetAttestedHeader(header LightClientHeader) error
NextSyncCommittee() *pb.SyncCommittee
SetNextSyncCommittee(sc *pb.SyncCommittee)
NextSyncCommitteeBranch() (LightClientSyncCommitteeBranch, error)
SetNextSyncCommitteeBranch(branch [][]byte) error
NextSyncCommitteeBranchElectra() (LightClientSyncCommitteeBranchElectra, error)
SetNextSyncCommitteeBranchElectra(branch [][]byte) error
FinalizedHeader() LightClientHeader
SetFinalizedHeader(header LightClientHeader)
SetFinalizedHeader(header LightClientHeader) error
FinalityBranch() LightClientFinalityBranch
SetFinalityBranch(branch [][]byte) error
SyncAggregate() *pb.SyncAggregate
Expand Down
Loading

0 comments on commit 46ae78a

Please sign in to comment.