@@ -29,7 +29,7 @@ import {
29
29
import { CheckpointWithHex , ExecutionStatus , IForkChoice , ProtoBlock } from "@lodestar/fork-choice" ;
30
30
import { ProcessShutdownCallback } from "@lodestar/validator" ;
31
31
import { Logger , isErrorAborted , pruneSetToMax , sleep , toHex } from "@lodestar/utils" ;
32
- import { ForkSeq , SLOTS_PER_EPOCH } from "@lodestar/params" ;
32
+ import { ForkSeq , SLOTS_PER_EPOCH , GENESIS_SLOT } from "@lodestar/params" ;
33
33
34
34
import { toHexString } from "@lodestar/utils" ;
35
35
import { GENESIS_EPOCH , ZERO_HASH } from "../constants/index.js" ;
@@ -43,7 +43,6 @@ import {isOptimisticBlock} from "../util/forkChoice.js";
43
43
import {
44
44
blindedOrFullBlockToFull ,
45
45
deserializeFullOrBlindedSignedBeaconBlock ,
46
- getEth1BlockHashFromSerializedBlock ,
47
46
serializeFullOrBlindedSignedBeaconBlock ,
48
47
} from "../util/fullOrBlindedBlock.js" ;
49
48
import { ExecutionPayloadBody } from "../execution/engine/types.js" ;
@@ -470,6 +469,7 @@ export class BeaconChain implements IBeaconChain {
470
469
}
471
470
472
471
async blindedOrFullBlockToFull ( block : allForks . FullOrBlindedSignedBeaconBlock ) : Promise < allForks . SignedBeaconBlock > {
472
+ if ( block . message . slot === GENESIS_SLOT ) return block ;
473
473
const info = this . config . getForkInfo ( block . message . slot ) ;
474
474
return blindedOrFullBlockToFull (
475
475
this . config ,
@@ -479,15 +479,10 @@ export class BeaconChain implements IBeaconChain {
479
479
) ;
480
480
}
481
481
482
- async blindedOrFullBlockToFullBytes ( forkSeq : ForkSeq , block : Uint8Array ) : Promise < Uint8Array > {
482
+ async blindedOrFullBlockToFullBytes ( block : Uint8Array ) : Promise < Uint8Array > {
483
483
return serializeFullOrBlindedSignedBeaconBlock (
484
484
this . config ,
485
- blindedOrFullBlockToFull (
486
- this . config ,
487
- forkSeq ,
488
- deserializeFullOrBlindedSignedBeaconBlock ( this . config , block ) ,
489
- await this . getTransactionsAndWithdrawals ( forkSeq , toHexString ( getEth1BlockHashFromSerializedBlock ( block ) ) )
490
- )
485
+ await this . blindedOrFullBlockToFull ( deserializeFullOrBlindedSignedBeaconBlock ( this . config , block ) )
491
486
) ;
492
487
}
493
488
0 commit comments