Fix el-manager warnings and issues. (#6293)
This commit is contained in:
parent
4355f81731
commit
41db536d63
|
@ -22,7 +22,6 @@ import
|
||||||
".."/beacon_node_status,
|
".."/beacon_node_status,
|
||||||
"."/[eth1_chain, el_conf]
|
"."/[eth1_chain, el_conf]
|
||||||
|
|
||||||
from std/sequtils import anyIt, mapIt
|
|
||||||
from std/times import getTime, inSeconds, initTime, `-`
|
from std/times import getTime, inSeconds, initTime, `-`
|
||||||
from ../spec/engine_authentication import getSignedIatToken
|
from ../spec/engine_authentication import getSignedIatToken
|
||||||
from ../spec/helpers import bytes_to_uint64
|
from ../spec/helpers import bytes_to_uint64
|
||||||
|
@ -747,13 +746,13 @@ proc connectedRpcClient(connection: ELConnection): Future[RpcClient] {.
|
||||||
proc getBlockByHash(
|
proc getBlockByHash(
|
||||||
rpcClient: RpcClient,
|
rpcClient: RpcClient,
|
||||||
hash: BlockHash
|
hash: BlockHash
|
||||||
): Future[BlockObject] {.async: (raising: [CatchableError], raw: true).} =
|
): Future[BlockObject] {.async: (raises: [CatchableError]).} =
|
||||||
rpcClient.eth_getBlockByHash(hash, false)
|
await rpcClient.eth_getBlockByHash(hash, false)
|
||||||
|
|
||||||
proc getBlockByNumber*(
|
proc getBlockByNumber*(
|
||||||
rpcClient: RpcClient,
|
rpcClient: RpcClient,
|
||||||
number: Eth1BlockNumber
|
number: Eth1BlockNumber
|
||||||
): Future[BlockObject] {.async: (raising: [CatchableError], raw: true).} =
|
): Future[BlockObject] {.async: (raises: [CatchableError]).} =
|
||||||
let hexNumber = try:
|
let hexNumber = try:
|
||||||
let num = distinctBase(number)
|
let num = distinctBase(number)
|
||||||
&"0x{num:X}" # No leading 0's!
|
&"0x{num:X}" # No leading 0's!
|
||||||
|
@ -761,7 +760,7 @@ proc getBlockByNumber*(
|
||||||
# Since the format above is valid, failing here should not be possible
|
# Since the format above is valid, failing here should not be possible
|
||||||
raiseAssert exc.msg
|
raiseAssert exc.msg
|
||||||
|
|
||||||
rpcClient.eth_getBlockByNumber(hexNumber, false)
|
await rpcClient.eth_getBlockByNumber(hexNumber, false)
|
||||||
|
|
||||||
func areSameAs(expectedParams: Option[NextExpectedPayloadParams],
|
func areSameAs(expectedParams: Option[NextExpectedPayloadParams],
|
||||||
latestHead, latestSafe, latestFinalized: Eth2Digest,
|
latestHead, latestSafe, latestFinalized: Eth2Digest,
|
||||||
|
@ -936,7 +935,7 @@ proc getPayload*(
|
||||||
try:
|
try:
|
||||||
await allFutures(requests).wait(deadline)
|
await allFutures(requests).wait(deadline)
|
||||||
false
|
false
|
||||||
except AsyncTimeoutError as exc:
|
except AsyncTimeoutError:
|
||||||
true
|
true
|
||||||
except CancelledError as exc:
|
except CancelledError as exc:
|
||||||
let pending =
|
let pending =
|
||||||
|
@ -1425,7 +1424,6 @@ proc forkchoiceUpdated*(
|
||||||
headBlockHash: headBlockHash.asBlockHash,
|
headBlockHash: headBlockHash.asBlockHash,
|
||||||
safeBlockHash: safeBlockHash.asBlockHash,
|
safeBlockHash: safeBlockHash.asBlockHash,
|
||||||
finalizedBlockHash: finalizedBlockHash.asBlockHash)
|
finalizedBlockHash: finalizedBlockHash.asBlockHash)
|
||||||
earlyDeadline = sleepAsync(chronos.seconds 1)
|
|
||||||
startTime = Moment.now
|
startTime = Moment.now
|
||||||
deadline = sleepAsync(FORKCHOICEUPDATED_TIMEOUT)
|
deadline = sleepAsync(FORKCHOICEUPDATED_TIMEOUT)
|
||||||
var
|
var
|
||||||
|
@ -1844,7 +1842,7 @@ proc syncBlockRange(
|
||||||
# for dealing with Infura's rate limits
|
# for dealing with Infura's rate limits
|
||||||
await sleepAsync(milliseconds(backoff))
|
await sleepAsync(milliseconds(backoff))
|
||||||
|
|
||||||
let depositLogs =
|
depositLogs =
|
||||||
try:
|
try:
|
||||||
await connection.engineApiRequest(
|
await connection.engineApiRequest(
|
||||||
depositContract.getJsonLogs(
|
depositContract.getJsonLogs(
|
||||||
|
|
Loading…
Reference in New Issue