@@ -28,32 +28,32 @@ type HeaderStore* = ref object
2828
2929func convLCHeader * (lcHeader: ForkedLightClientHeader ): Result [Header , string ] =
3030 withForkyHeader (lcHeader):
31- template p (): auto =
32- forkyHeader.execution
31+ when lcDataFork > LightClientDataFork .Altair :
32+ template p (): auto =
33+ forkyHeader.execution
3334
34- when lcDataFork >= LightClientDataFork .Capella :
35- let withdrawalsRoot = Opt .some (p.withdrawals_root.asBlockHash)
36- else :
37- const withdrawalsRoot = Opt .none (Hash32 )
35+ when lcDataFork >= LightClientDataFork .Capella :
36+ let withdrawalsRoot = Opt .some (p.withdrawals_root.asBlockHash)
37+ else :
38+ const withdrawalsRoot = Opt .none (Hash32 )
3839
39- when lcDataFork >= LightClientDataFork .Deneb :
40- let
41- blobGasUsed = Opt .some (p.blob_gas_used)
42- excessBlobGas = Opt .some (p.excess_blob_gas)
43- parentBeaconBlockRoot = Opt .some (forkyHeader.beacon.parent_root.asBlockHash)
44- else :
45- const
46- blobGasUsed = Opt .none (uint64 )
47- excessBlobGas = Opt .none (uint64 )
48- parentBeaconBlockRoot = Opt .none (Hash32 )
49-
50- when lcDataFork >= LightClientDataFork .Electra :
51- # INFO: there is no visibility of the execution requests hash in light client header
52- let requestsHash = Opt .none (Hash32 )
53- else :
54- const requestsHash = Opt .none (Hash32 )
40+ when lcDataFork >= LightClientDataFork .Deneb :
41+ let
42+ blobGasUsed = Opt .some (p.blob_gas_used)
43+ excessBlobGas = Opt .some (p.excess_blob_gas)
44+ parentBeaconBlockRoot = Opt .some (forkyHeader.beacon.parent_root.asBlockHash)
45+ else :
46+ const
47+ blobGasUsed = Opt .none (uint64 )
48+ excessBlobGas = Opt .none (uint64 )
49+ parentBeaconBlockRoot = Opt .none (Hash32 )
50+
51+ when lcDataFork >= LightClientDataFork .Electra :
52+ # INFO: there is no visibility of the execution requests hash in light client header
53+ let requestsHash = Opt .none (Hash32 )
54+ else :
55+ const requestsHash = Opt .none (Hash32 )
5556
56- when lcDataFork > LightClientDataFork .Altair :
5757 let h = Header (
5858 parentHash: p.parent_hash.asBlockHash,
5959 ommersHash: EMPTY_UNCLE_HASH ,
@@ -77,6 +77,7 @@ func convLCHeader*(lcHeader: ForkedLightClientHeader): Result[Header, string] =
7777 parentBeaconBlockRoot: parentBeaconBlockRoot,
7878 requestsHash: requestsHash,
7979 )
80+
8081 return ok (h)
8182 else :
8283 # running verified proxy for altair doesn't make sense
0 commit comments