Files
twoeths 86298a43e6 refactor: move reward apis to state-transition (#8719)
**Motivation**

- the reward apis tightly couple to state-transition functions like
`beforeProcessEpoch() processBlock() processAttestationAltair()` so it
needs to be moved there

**Description**

- move api type definitions to `types` package so that it can be used
everywhere
- move reward apis implementation to `state-transition` package

Closes #8690

---------

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2026-01-06 08:48:58 +07:00
..

lodestar-state-transition

npm License Eth Consensus Spec v1.5.0 ES Version Node Version

This package is part of ChainSafe's Lodestar project

The beacon state transition and state transition utilities

Usage

import {CachedBeaconStateAllForks, stateTransition} from "@lodestar/state-transition";
import {ssz} from "@lodestar/types";
import {generateState} from "./test/utils/state.js";

// dummy test state
const preState: CachedBeaconStateAllForks = generateState() as CachedBeaconStateAllForks;

// dummy test block
const block = ssz.phase0.SignedBeaconBlock.defaultValue();

// Run state transition on block
const postState = stateTransition(preState, block);

License

Apache-2.0 ChainSafe Systems