From 6dbb5f2990bc1b96fcfe89aeb78c579b77ad67ec Mon Sep 17 00:00:00 2001 From: Jochem Brouwer Date: Thu, 2 May 2024 01:23:07 +0200 Subject: [PATCH] vm: cleanup commit --- packages/vm/src/runBlock.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/vm/src/runBlock.ts b/packages/vm/src/runBlock.ts index 61a87aa562..12caa290bc 100644 --- a/packages/vm/src/runBlock.ts +++ b/packages/vm/src/runBlock.ts @@ -988,7 +988,6 @@ export const accumulateRequests = async (vm: VM): Promise => { } const _accumulateEIP7002Requests = async (vm: VM, requests: CLRequest[]): Promise => { - // TODO PERFORM LOGIC TO CHECK IF CONTRACT EXISTS // Partial withdrawals logic const addressBytes = setLengthLeft( bigIntToBytes(vm.common.param('vm', 'withdrawalRequestPredeployAddress')), @@ -1022,9 +1021,9 @@ const _accumulateEIP7002Requests = async (vm: VM, requests: CLRequest[]): Promis // Each request is 76 bytes for (let startByte = 0; startByte < resultsBytes.length; startByte += 76) { const slicedBytes = resultsBytes.slice(startByte, startByte + 76) - const sourceAddress = slicedBytes.slice(0, 20) - const validatorPubkey = slicedBytes.slice(20, 20 + 48) - const amount = slicedBytes.slice(20 + 48, 20 + 48 + 8) + const sourceAddress = slicedBytes.slice(0, 20) // 20 Bytes + const validatorPubkey = slicedBytes.slice(20, 68) // 48 Bytes + const amount = slicedBytes.slice(68, 76) // 8 Bytes / Uint64 const rlpData = RLP.encode([sourceAddress, validatorPubkey, amount]) const request = new ValidatorWithdrawalRequest(withdrawalRequestType, rlpData) requests.push(request)