Skip to content

Commit e9646ea

Browse files
proxy: fix [XDeclaredButNotUsed] for verified proxy code (#3538)
* fix * more fix
1 parent d34dc1a commit e9646ea

File tree

3 files changed

+28
-27
lines changed

3 files changed

+28
-27
lines changed

execution_chain/version.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import
1313
stew/byteutils, ./compile_info
1414

1515
const
16-
sourcePath = currentSourcePath.rsplit({DirSep, AltSep}, 1)[0]
16+
sourcePath = currentSourcePath.rsplit({DirSep, AltSep}, 1)[0]
1717
nimbusRevision {.strdefine.} = "00000000"
1818

1919
static:

nimbus_verified_proxy/header_store.nim

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,32 @@ type HeaderStore* = ref object
2828

2929
func 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

nimbus_verified_proxy/rpc/evm.nim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ proc toAsyncEvmStateBackend*(vp: VerifiedRpcProxy): AsyncEvmStateBackend =
2828
let account =
2929
try:
3030
(await vp.getAccount(address, header.number, header.stateRoot))
31-
except CatchableError as e:
31+
except CatchableError:
3232
error "error getting account"
3333
return Opt.none(Account)
3434

@@ -43,7 +43,7 @@ proc toAsyncEvmStateBackend*(vp: VerifiedRpcProxy): AsyncEvmStateBackend =
4343
let storageSlot =
4444
try:
4545
(await vp.getStorageAt(address, slotKey, header.number, header.stateRoot))
46-
except CatchableError as e:
46+
except CatchableError:
4747
error "error getting storage"
4848
return Opt.none(UInt256)
4949

@@ -58,7 +58,7 @@ proc toAsyncEvmStateBackend*(vp: VerifiedRpcProxy): AsyncEvmStateBackend =
5858
let code =
5959
try:
6060
(await vp.getCode(address, header.number, header.stateRoot))
61-
except CatchableError as e:
61+
except CatchableError:
6262
error "error getting code"
6363
return Opt.none(seq[byte])
6464

0 commit comments

Comments
 (0)