Files
lodestar/packages/api
Cayman ece38879ec refactor: block proposal cleanup (#8155)
**Motivation**

- address
https://github.com/ChainSafe/lodestar/pull/6353#discussion_r2255325445

**Description**

Our block production and publishing data flow was messy. The data types
and utility functions are jumbled, duplicate functions, differences from
spec functions, etc. To that end, this refactors things that touch this
proposal data flow.

- Tweak the fork-agnostic `BlockContents` type to also include pre-deneb
`BeaconBlock`
  - this allows us to remove `BlockOrContents` variables and types
- Remove `Contents` (It isn't actually needed)
- Collect all `produced*` caches into `blockProductionCache`
- make blinded block reconstruction more typesafe
- Separate blobs+proofs sanity validation from cells+proof sanity
validation
- Delete duplicated `BlobsBundle` type
- Remove duplicate spec function `computeDataColumnSidecars` in favor of
`getDataColumnSidecars*` functions
- Refactor `computeBlobSidecars` into `getBlobSidecars` from the spec

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-08-15 07:31:18 -04: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