From 13002fd75d86b4b74c41173c8dc820cfc845b125 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Thu, 10 Oct 2024 14:35:24 +0100 Subject: [PATCH] Use loadState instead of creating a separate ViewDU --- packages/beacon-node/src/api/impl/validator/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/beacon-node/src/api/impl/validator/index.ts b/packages/beacon-node/src/api/impl/validator/index.ts index e0fd19226cb..8855048d86a 100644 --- a/packages/beacon-node/src/api/impl/validator/index.ts +++ b/packages/beacon-node/src/api/impl/validator/index.ts @@ -12,6 +12,7 @@ import { getCurrentSlot, beaconBlockToBlinded, createCachedBeaconState, + loadState, } from "@lodestar/state-transition"; import { GENESIS_SLOT, @@ -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(