From d0400e408b74f7eea00860888b5df1b79a866131 Mon Sep 17 00:00:00 2001 From: tersec Date: Wed, 15 May 2024 07:44:52 +0300 Subject: [PATCH] rename ExitV1 to WithdrawalRequestV1 (#6290) --- beacon_chain/el/el_manager.nim | 18 ++++++++++-------- beacon_chain/spec/datatypes/electra.nim | 6 +++--- vendor/nim-web3 | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/beacon_chain/el/el_manager.nim b/beacon_chain/el/el_manager.nim index bdd648a91..c7a9f01fe 100644 --- a/beacon_chain/el/el_manager.nim +++ b/beacon_chain/el/el_manager.nim @@ -322,7 +322,7 @@ proc engineApiRequest[T]( 1, [connection.engineUrl.url, requestName, "200"]) connection.setWorkingState() res - except AsyncTimeoutError as exc: + except AsyncTimeoutError: engine_api_timeouts.inc(1, [connection.engineUrl.url, requestName]) if not(failureAllowed): await connection.setDegradedState(requestName, 0, "Request timed out") @@ -511,12 +511,13 @@ func asConsensusType*(rpcExecutionPayload: ExecutionPayloadV4): signature: ValidatorSig(blob: dr.signature.distinctBase), index: dr.index.uint64) - template getExecutionLayerWithdrawalRequest(elwr: ExitV1): + template getExecutionLayerWithdrawalRequest(elwr: WithdrawalRequestV1): ExecutionLayerWithdrawalRequest = ExecutionLayerWithdrawalRequest( source_address: ExecutionAddress(data: elwr.sourceAddress.distinctBase), validator_pubkey: ValidatorPubKey( - blob: elwr.validatorPublicKey.distinctBase)) + blob: elwr.validatorPublicKey.distinctBase), + amount: elwr.amount.Gwei) electra.ExecutionPayload( parent_hash: rpcExecutionPayload.parentHash.asEth2Digest, @@ -654,10 +655,11 @@ func asEngineExecutionPayload*(executionPayload: electra.ExecutionPayload): index: dr.index.Quantity) template getExecutionLayerWithdrawalRequest( - elwr: ExecutionLayerWithdrawalRequest): ExitV1 = - ExitV1( + elwr: ExecutionLayerWithdrawalRequest): WithdrawalRequestV1 = + WithdrawalRequestV1( sourceAddress: Address(elwr.source_address.data), - validatorPublicKey: FixedBytes[RawPubKeySize](elwr.validator_pubkey.blob)) + validatorPublicKey: FixedBytes[RawPubKeySize](elwr.validator_pubkey.blob), + amount: elwr.amount.Quantity) debugRaiseAssert "nim-web3 needs to change exits to withdrawalRequests; maybe it already has been" @@ -1084,7 +1086,7 @@ proc selectConnectionForChainSyncing( var pendingFutures = pendingConnections try: discard await race(pendingFutures) - except ValueError as exc: + except ValueError: raiseAssert "pendingFutures should not be empty at this moment" except CancelledError as exc: let pending = pendingConnections.filterIt(not(it.finished())). @@ -2144,7 +2146,7 @@ proc startChainSyncingLoop( runLoop = false except CancelledError: runLoop = false - except CatchableError as exc: + except CatchableError: try: await sleepAsync(10.seconds) except CancelledError: diff --git a/beacon_chain/spec/datatypes/electra.nim b/beacon_chain/spec/datatypes/electra.nim index ed24244e5..461092189 100644 --- a/beacon_chain/spec/datatypes/electra.nim +++ b/beacon_chain/spec/datatypes/electra.nim @@ -155,19 +155,19 @@ type index*: uint64 amount*: Gwei - # https://github.com/ethereum/consensus-specs/blob/82133085a1295e93394ebdf71df8f2f6e0962588/specs/electra/beacon-chain.md#pendingpartialwithdrawal + # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.2/specs/electra/beacon-chain.md#pendingpartialwithdrawal PendingPartialWithdrawal* = object index*: uint64 amount*: Gwei withdrawable_epoch*: Epoch - # https://github.com/ethereum/consensus-specs/blob/82133085a1295e93394ebdf71df8f2f6e0962588/specs/electra/beacon-chain.md#executionlayerwithdrawalrequest + # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.2/specs/electra/beacon-chain.md#executionlayerwithdrawalrequest ExecutionLayerWithdrawalRequest* = object source_address*: ExecutionAddress validator_pubkey*: ValidatorPubKey amount*: Gwei - # https://github.com/ethereum/consensus-specs/blob/82133085a1295e93394ebdf71df8f2f6e0962588/specs/electra/beacon-chain.md#consolidation + # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.2/specs/electra/beacon-chain.md#consolidation Consolidation* = object source_index*: uint64 target_index*: uint64 diff --git a/vendor/nim-web3 b/vendor/nim-web3 index 290acb6e6..5610e21dc 160000 --- a/vendor/nim-web3 +++ b/vendor/nim-web3 @@ -1 +1 @@ -Subproject commit 290acb6e6200230fc625209e6654f6bb60aceb13 +Subproject commit 5610e21dcdbea192c68e34a3bef79264cc843be6