Files
lodestar/packages/api
Nico Flaig 493cc12d2f feat: update vc to submit beacon committee selections once per epoch (#8669)
**Motivation**

Closes https://github.com/ChainSafe/lodestar/issues/8606

**Description**

This updates our implementation to be compliant with latest spec
https://github.com/ethereum/beacon-APIs/pull/368.

For sync committee aggregation selection (unchanged)
-  we call `submitSyncCommitteeSelections` at the start of the slot
- the timeout is still based on `CONTRIBUTION_DUE_BPS` into the slot (8
seconds)
-  we call the endpoint for all duties of this slot
-  logic has been moved to duties service


For attestation aggregation selection
- we call `submitBeaconCommitteeSelections` at the start of the epoch
for current and next epoch (2 separate calls)
- the timeout uses default which is based on `SLOT_DURATION_MS` (12
seconds)
- we only call `prepareBeaconCommitteeSubnet` once the above call either
resolved or failed, this should be fine as it's not that time sensitive
(one epoch lookahead)
- if duties are reorged, we will call `submitBeaconCommitteeSelections`
with duties of affected epoch
- logic has been moved to duties service


Previous PR https://github.com/ChainSafe/lodestar/pull/5344
2025-12-19 16:43:28 +01:00
..
2021-05-27 12:17:49 -05:00

Lodestar Eth Consensus API

Discord ETH Beacon APIs Spec v3.1.0 ES Version Node Version

This package is part of ChainSafe's Lodestar project

Typescript REST client for the Ethereum Consensus API

Usage

The REST client extends the native Fetch API, it behaves very similar in terms of error and response handling. It returns the same Response object with additional methods to simplify usage and it allows to override all Request options if needed.

import {getClient} from "@lodestar/api";
import {config} from "@lodestar/config/default";

const api = getClient({baseUrl: "http://localhost:9596"}, {config});

const res = await api.beacon.getStateValidator({stateId: "head", validatorId: 0});

const validator = res.value();

console.log("The validator balance is: ", validator.balance);

Prerequisites

What you need

You will need to go over the specification.

Getting started

Contributors

Read our contributors document, submit an issue or talk to us on our discord!

License

Apache-2.0 ChainSafe Systems