Skip to content

Commit

Permalink
Use loadState instead of creating a separate ViewDU
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Oct 10, 2024
1 parent f85b86e commit 13002fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/beacon-node/src/api/impl/validator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
getCurrentSlot,
beaconBlockToBlinded,
createCachedBeaconState,
loadState,
} from "@lodestar/state-transition";
import {
GENESIS_SLOT,
Expand Down Expand Up @@ -939,7 +940,7 @@ export function getValidatorApi(

const stateViewDU =
res.state instanceof Uint8Array
? config.getForkTypes(startSlot).BeaconState.deserializeToViewDU(res.state)
? loadState(config, chain.getHeadState(), res.state).state
: res.state.clone();

state = createCachedBeaconState(
Expand Down

0 comments on commit 13002fd

Please sign in to comment.