diff --git a/hive_integration/nodocker/engine/clmock.nim b/hive_integration/nodocker/engine/clmock.nim index 62ba206848..2567ebcbbd 100644 --- a/hive_integration/nodocker/engine/clmock.nim +++ b/hive_integration/nodocker/engine/clmock.nim @@ -69,7 +69,7 @@ type latestPayloadAttributes*: PayloadAttributes latestExecutedPayload* : ExecutableData latestForkchoice* : ForkchoiceStateV1 - latestExecutionRequests*: Opt[array[3, seq[byte]]] + latestExecutionRequests*: Opt[seq[seq[byte]]] # Merge related firstPoSBlockNumber* : Opt[uint64] diff --git a/hive_integration/nodocker/engine/engine_client.nim b/hive_integration/nodocker/engine/engine_client.nim index 3345af1dce..a0d402faca 100644 --- a/hive_integration/nodocker/engine/engine_client.nim +++ b/hive_integration/nodocker/engine/engine_client.nim @@ -165,7 +165,7 @@ proc newPayloadV4*(client: RpcClient, payload: ExecutionPayloadV3, versionedHashes: seq[VersionedHash], parentBeaconBlockRoot: Hash32, - executionRequests: array[3, seq[byte]]): + executionRequests: seq[seq[byte]]): Result[PayloadStatusV1, string] = wrapTrySimpleRes: client.engine_newPayloadV4(payload, versionedHashes, @@ -196,7 +196,7 @@ proc newPayloadV4*(client: RpcClient, payload: ExecutionPayload, versionedHashes: Opt[seq[VersionedHash]], parentBeaconBlockRoot: Opt[Hash32], - executionRequests: Opt[array[3, seq[byte]]]): + executionRequests: Opt[seq[seq[byte]]]): Result[PayloadStatusV1, string] = wrapTrySimpleRes: client.engine_newPayloadV4(payload, versionedHashes, diff --git a/hive_integration/nodocker/engine/types.nim b/hive_integration/nodocker/engine/types.nim index 848fe6cdfd..8e3403d949 100644 --- a/hive_integration/nodocker/engine/types.nim +++ b/hive_integration/nodocker/engine/types.nim @@ -60,7 +60,7 @@ type attr* : PayloadAttributes beaconRoot* : Opt[Hash32] versionedHashes*: Opt[seq[Hash32]] - executionRequests*: Opt[array[3, seq[byte]]] + executionRequests*: Opt[seq[seq[byte]]] const DefaultTimeout* = 60 # seconds diff --git a/nimbus/beacon/api_handler/api_newpayload.nim b/nimbus/beacon/api_handler/api_newpayload.nim index e06e73db3c..2061cfe730 100644 --- a/nimbus/beacon/api_handler/api_newpayload.nim +++ b/nimbus/beacon/api_handler/api_newpayload.nim @@ -83,12 +83,35 @@ template validatePayload(apiVersion, payloadVersion, payload) = raise invalidParams("newPayload" & $apiVersion & "excessBlobGas is expected from execution payload") +func validateExecutionRequest(requests: openArray[seq[byte]]): Result[void, string] {.raises:[].} = + var previousRequestType = -1 + for request in requests: + if request.len == 0: + return err("Execution request data must not be empty") + + let requestType = request[0] + if requestType.int <= previousRequestType: + return err("Execution requests are not in strictly ascending order") + + if request.len == 1: + return err("Empty data for request type " & $requestType) + + if requestType notin [ + DEPOSIT_REQUEST_TYPE, + WITHDRAWAL_REQUEST_TYPE, + CONSOLIDATION_REQUEST_TYPE]: + return err("Invalid execution request type: " & $requestType) + + previousRequestType = requestType.int + + ok() + proc newPayload*(ben: BeaconEngineRef, apiVersion: Version, payload: ExecutionPayload, versionedHashes = Opt.none(seq[Hash32]), beaconRoot = Opt.none(Hash32), - executionRequests = Opt.none(array[3, seq[byte]])): PayloadStatusV1 = + executionRequests = Opt.none(seq[seq[byte]])): PayloadStatusV1 = trace "Engine API request received", meth = "newPayload", @@ -104,6 +127,10 @@ proc newPayload*(ben: BeaconEngineRef, raise invalidParams("newPayload" & $apiVersion & ": executionRequests is expected from execution payload") + validateExecutionRequest(executionRequests.get).isOkOr: + raise invalidParams("newPayload" & $apiVersion & + ": " & error) + let com = ben.com db = com.db @@ -195,7 +222,7 @@ proc newPayload*(ben: BeaconEngineRef, warn "Error importing block", number = header.number, hash = blockHash.short, - parent = header.parentHash.short, + parent = header.parentHash.short, error = vres.error() ben.setInvalidAncestor(header, blockHash) let blockHash = latestValidHash(db, parent, ttd) diff --git a/nimbus/beacon/payload_queue.nim b/nimbus/beacon/payload_queue.nim index e4d13332ec..b511e00e7c 100644 --- a/nimbus/beacon/payload_queue.nim +++ b/nimbus/beacon/payload_queue.nim @@ -35,7 +35,7 @@ type payload*: ExecutionPayload blockValue*: UInt256 blobsBundle*: Opt[BlobsBundleV1] - executionRequests*: Opt[array[3, seq[byte]]] + executionRequests*: Opt[seq[seq[byte]]] targetBlobsPerBlock*: Opt[Quantity] PayloadItem = object diff --git a/nimbus/common/chain_config_hash.nim b/nimbus/common/chain_config_hash.nim index 9bf2e1661d..27974fe0b2 100644 --- a/nimbus/common/chain_config_hash.nim +++ b/nimbus/common/chain_config_hash.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2021-2024 Status Research & Development GmbH +# Copyright (c) 2024 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE)) # * MIT license ([LICENSE-MIT](LICENSE-MIT)) diff --git a/nimbus/common/genesis.nim b/nimbus/common/genesis.nim index c551359226..22299c5a2a 100644 --- a/nimbus/common/genesis.nim +++ b/nimbus/common/genesis.nim @@ -16,6 +16,7 @@ import eth/common/[blocks, hashes, accounts, headers, addresses], ../db/[ledger, core_db], ../constants, + ../utils/utils, ./chain_config # ------------------------------------------------------------------------------ @@ -78,6 +79,10 @@ proc toGenesisHeader*( result.excessBlobGas = Opt.some g.excessBlobGas.get(0'u64) result.parentBeaconBlockRoot = Opt.some g.parentBeaconBlockRoot.get(default(Hash32)) + if fork >= Prague: + const EmptyRequestsHash = calcRequestsHash() + result.requestsHash = Opt.some(EmptyRequestsHash) + proc toGenesisHeader*( genesis: Genesis; fork: HardFork; diff --git a/nimbus/core/executor/process_block.nim b/nimbus/core/executor/process_block.nim index 262b40a159..6425374e7c 100644 --- a/nimbus/core/executor/process_block.nim +++ b/nimbus/core/executor/process_block.nim @@ -248,7 +248,11 @@ proc procBlkEpilogue( let depositReqs = ?parseDepositLogs(vmState.allLogs, vmState.com.depositContractAddress) - requestsHash = calcRequestsHash(depositReqs, withdrawalReqs, consolidationReqs) + requestsHash = calcRequestsHash([ + (DEPOSIT_REQUEST_TYPE, depositReqs), + (WITHDRAWAL_REQUEST_TYPE, withdrawalReqs), + (CONSOLIDATION_REQUEST_TYPE, consolidationReqs) + ]) if header.requestsHash.get != requestsHash: debug "wrong requestsHash in block", diff --git a/nimbus/core/tx_pool.nim b/nimbus/core/tx_pool.nim index 149aeff51f..ba0a880a79 100644 --- a/nimbus/core/tx_pool.nim +++ b/nimbus/core/tx_pool.nim @@ -457,7 +457,7 @@ type AssembledBlock* = object blk*: EthBlock blobsBundle*: Opt[BlobsBundle] blockValue*: UInt256 - executionRequests*: Opt[array[3, seq[byte]]] + executionRequests*: Opt[seq[seq[byte]]] proc assembleBlock*( xp: TxPoolRef, @@ -517,7 +517,7 @@ proc assembleBlock*( if com.isPragueOrLater(blk.header.timestamp): Opt.some(pst.executionRequests) else: - Opt.none(array[3, seq[byte]]) + Opt.none(seq[seq[byte]]) ok AssembledBlock( blk: blk, diff --git a/nimbus/core/tx_pool/tx_packer.nim b/nimbus/core/tx_pool/tx_packer.nim index 46ab9ce5bc..cae18c1b65 100644 --- a/nimbus/core/tx_pool/tx_packer.nim +++ b/nimbus/core/tx_pool/tx_packer.nim @@ -357,17 +357,25 @@ proc assembleHeader*(pst: TxPacker): Header = result.excessBlobGas = Opt.some vmState.blockCtx.excessBlobGas if com.isPragueOrLater(pos.timestamp): - let requestsHash = calcRequestsHash(pst.depositReqs, - pst.withdrawalReqs, pst.consolidationReqs) + let requestsHash = calcRequestsHash([ + (DEPOSIT_REQUEST_TYPE, pst.depositReqs), + (WITHDRAWAL_REQUEST_TYPE, pst.withdrawalReqs), + (CONSOLIDATION_REQUEST_TYPE, pst.consolidationReqs) + ]) result.requestsHash = Opt.some(requestsHash) func blockValue*(pst: TxPacker): UInt256 = pst.blockValue -func executionRequests*(pst: var TxPacker): array[3, seq[byte]] = - result[0] = move(pst.depositReqs) - result[1] = move(pst.withdrawalReqs) - result[2] = move(pst.consolidationReqs) +func executionRequests*(pst: var TxPacker): seq[seq[byte]] = + template append(dst, reqType, reqData) = + if reqData.len > 0: + reqData.insert(reqType) + dst.add(move(reqData)) + + result.append(DEPOSIT_REQUEST_TYPE, pst.depositReqs) + result.append(WITHDRAWAL_REQUEST_TYPE, pst.withdrawalReqs) + result.append(CONSOLIDATION_REQUEST_TYPE, pst.consolidationReqs) # ------------------------------------------------------------------------------ # End diff --git a/nimbus/rpc/engine_api.nim b/nimbus/rpc/engine_api.nim index abda37ee3c..628dd4cc56 100644 --- a/nimbus/rpc/engine_api.nim +++ b/nimbus/rpc/engine_api.nim @@ -60,7 +60,7 @@ proc setupEngineAPI*(engine: BeaconEngineRef, server: RpcServer) = server.rpc("engine_newPayloadV4") do(payload: ExecutionPayload, expectedBlobVersionedHashes: Opt[seq[Hash32]], parentBeaconBlockRoot: Opt[Hash32], - executionRequests: Opt[array[3, seq[byte]]]) -> PayloadStatusV1: + executionRequests: Opt[seq[seq[byte]]]) -> PayloadStatusV1: return engine.newPayload(Version.V4, payload, expectedBlobVersionedHashes, parentBeaconBlockRoot, executionRequests) diff --git a/nimbus/utils/utils.nim b/nimbus/utils/utils.nim index 2ff8cc311e..334a8c9e5a 100644 --- a/nimbus/utils/utils.nim +++ b/nimbus/utils/utils.nim @@ -19,6 +19,11 @@ import export eth_types_rlp +const + DEPOSIT_REQUEST_TYPE* = 0x00.byte + WITHDRAWAL_REQUEST_TYPE* = 0x01.byte + CONSOLIDATION_REQUEST_TYPE* = 0x02.byte + template calcTxRoot*(transactions: openArray[Transaction]): Root = orderedTrieRoot(transactions) @@ -28,7 +33,7 @@ template calcWithdrawalsRoot*(withdrawals: openArray[Withdrawal]): Root = template calcReceiptsRoot*(receipts: openArray[Receipt]): Root = orderedTrieRoot(receipts) -func calcRequestsHash*(requests: varargs[seq[byte]]): Hash32 = +func calcRequestsHash*(requests: varargs[tuple[reqType: byte, data: seq[byte]]]): Hash32 = func calcHash(reqType: byte, data: openArray[byte]): Hash32 = var ctx: sha256 ctx.init() @@ -39,16 +44,26 @@ func calcRequestsHash*(requests: varargs[seq[byte]]): Hash32 = var ctx: sha256 ctx.init() - for i, data in requests: - ctx.update(calcHash(i.byte, data).data) + for req in requests: + if req.data.len > 0: + ctx.update(calcHash(req.reqType, req.data).data) + ctx.finish(result.data) + ctx.clear() + +func calcRequestsHash*(requests: openArray[seq[byte]]): Hash32 = + var ctx: sha256 + ctx.init() + for req in requests: + if req.len > 0: + ctx.update(sha256.digest(req).data) ctx.finish(result.data) ctx.clear() -func calcRequestsHash*(reqs: Opt[array[3, seq[byte]]]): Opt[Hash32] = +func calcRequestsHash*(reqs: Opt[seq[seq[byte]]]): Opt[Hash32] = if reqs.isNone: Opt.none(Hash32) else: - Opt.some(calcRequestsHash(reqs.get()[0], reqs.get()[1], reqs.get()[2])) + Opt.some(calcRequestsHash(reqs.get)) func sumHash*(hashes: varargs[Hash32]): Hash32 = var ctx: sha256 diff --git a/nrpc/nrpc.nim b/nrpc/nrpc.nim index 0f3a8f0041..816c91e12c 100644 --- a/nrpc/nrpc.nim +++ b/nrpc/nrpc.nim @@ -256,7 +256,7 @@ proc syncToEngineApi(conf: NRpcConf) {.async.} = engine_api.VersionedHash(kzg_commitment_to_versioned_hash(it)), ) # Execution Requests for Electra - let execution_requests = [ + let execution_requests = @[ SSZ.encode(forkyBlck.message.body.execution_requests.deposits), SSZ.encode(forkyBlck.message.body.execution_requests.withdrawals), SSZ.encode(forkyBlck.message.body.execution_requests.consolidations), diff --git a/tests/customgenesis/prague.json b/tests/customgenesis/prague.json new file mode 100644 index 0000000000..8e6f3387b6 --- /dev/null +++ b/tests/customgenesis/prague.json @@ -0,0 +1,927 @@ +{ + "config": { + "chainId": 7078815900, + "homesteadBlock": 0, + "eip150Block": 0, + "eip155Block": 0, + "eip158Block": 0, + "byzantiumBlock": 0, + "constantinopleBlock": 0, + "petersburgBlock": 0, + "istanbulBlock": 0, + "berlinBlock": 0, + "londonBlock": 0, + "mergeNetsplitBlock": 0, + "terminalTotalDifficulty": 0, + "terminalTotalDifficultyPassed": true, + "shanghaiTime": 0, + "cancunTime": 0, + "depositContractAddress": "0x4242424242424242424242424242424242424242", + "pragueTime": 0, + "osakaTime": 1768772016 + }, + "alloc": { + "0x0000000000000000000000000000000000000000": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000001": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000002": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000003": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000004": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000005": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000006": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000007": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000008": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000009": { + "balance": "1" + }, + "0x000000000000000000000000000000000000000a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000000b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000000c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000000d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000000e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000000f": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000010": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000011": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000012": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000013": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000014": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000015": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000016": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000017": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000018": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000019": { + "balance": "1" + }, + "0x000000000000000000000000000000000000001a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000001b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000001c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000001d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000001e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000001f": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000020": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000021": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000022": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000023": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000024": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000025": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000026": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000027": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000028": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000029": { + "balance": "1" + }, + "0x000000000000000000000000000000000000002a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000002b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000002c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000002d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000002e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000002f": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000030": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000031": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000032": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000033": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000034": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000035": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000036": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000037": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000038": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000039": { + "balance": "1" + }, + "0x000000000000000000000000000000000000003a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000003b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000003c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000003d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000003e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000003f": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000040": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000041": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000042": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000043": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000044": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000045": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000046": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000047": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000048": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000049": { + "balance": "1" + }, + "0x000000000000000000000000000000000000004a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000004b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000004c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000004d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000004e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000004f": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000050": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000051": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000052": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000053": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000054": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000055": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000056": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000057": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000058": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000059": { + "balance": "1" + }, + "0x000000000000000000000000000000000000005a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000005b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000005c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000005d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000005e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000005f": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000060": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000061": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000062": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000063": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000064": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000065": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000066": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000067": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000068": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000069": { + "balance": "1" + }, + "0x000000000000000000000000000000000000006a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000006b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000006c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000006d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000006e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000006f": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000070": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000071": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000072": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000073": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000074": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000075": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000076": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000077": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000078": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000079": { + "balance": "1" + }, + "0x000000000000000000000000000000000000007a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000007b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000007c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000007d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000007e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000007f": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000080": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000081": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000082": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000083": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000084": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000085": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000086": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000087": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000088": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000089": { + "balance": "1" + }, + "0x000000000000000000000000000000000000008a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000008b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000008c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000008d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000008e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000008f": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000090": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000091": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000092": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000093": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000094": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000095": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000096": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000097": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000098": { + "balance": "1" + }, + "0x0000000000000000000000000000000000000099": { + "balance": "1" + }, + "0x000000000000000000000000000000000000009a": { + "balance": "1" + }, + "0x000000000000000000000000000000000000009b": { + "balance": "1" + }, + "0x000000000000000000000000000000000000009c": { + "balance": "1" + }, + "0x000000000000000000000000000000000000009d": { + "balance": "1" + }, + "0x000000000000000000000000000000000000009e": { + "balance": "1" + }, + "0x000000000000000000000000000000000000009f": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a0": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a1": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a2": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a3": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a4": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a5": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a6": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a7": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a8": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000a9": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000aa": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ab": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ac": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ad": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ae": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000af": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b0": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b1": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b2": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b3": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b4": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b5": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b6": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b7": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b8": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000b9": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ba": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000bb": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000bc": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000bd": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000be": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000bf": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c0": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c1": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c2": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c3": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c4": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c5": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c6": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c7": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c8": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000c9": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ca": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000cb": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000cc": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000cd": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ce": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000cf": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d0": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d1": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d2": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d3": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d4": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d5": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d6": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d7": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d8": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000d9": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000da": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000db": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000dc": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000dd": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000de": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000df": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e0": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e1": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e2": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e3": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e4": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e5": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e6": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e7": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e8": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000e9": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ea": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000eb": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ec": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ed": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ee": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ef": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f0": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f1": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f2": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f3": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f4": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f5": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f6": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f7": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f8": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000f9": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000fa": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000fb": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000fc": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000fd": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000fe": { + "balance": "1" + }, + "0x00000000000000000000000000000000000000ff": { + "balance": "1" + }, + "0x4242424242424242424242424242424242424242": { + "balance": "0", + "code": "0x60806040526004361061003f5760003560e01c806301ffc9a71461004457806322895118146100a4578063621fd130146101ba578063c5f2892f14610244575b600080fd5b34801561005057600080fd5b506100906004803603602081101561006757600080fd5b50357fffffffff000000000000000000000000000000000000000000000000000000001661026b565b604080519115158252519081900360200190f35b6101b8600480360360808110156100ba57600080fd5b8101906020810181356401000000008111156100d557600080fd5b8201836020820111156100e757600080fd5b8035906020019184600183028401116401000000008311171561010957600080fd5b91939092909160208101903564010000000081111561012757600080fd5b82018360208201111561013957600080fd5b8035906020019184600183028401116401000000008311171561015b57600080fd5b91939092909160208101903564010000000081111561017957600080fd5b82018360208201111561018b57600080fd5b803590602001918460018302840111640100000000831117156101ad57600080fd5b919350915035610304565b005b3480156101c657600080fd5b506101cf6110b5565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102095781810151838201526020016101f1565b50505050905090810190601f1680156102365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561025057600080fd5b506102596110c7565b60408051918252519081900360200190f35b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a70000000000000000000000000000000000000000000000000000000014806102fe57507fffffffff0000000000000000000000000000000000000000000000000000000082167f8564090700000000000000000000000000000000000000000000000000000000145b92915050565b6030861461035d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806118056026913960400191505060405180910390fd5b602084146103b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603681526020018061179c6036913960400191505060405180910390fd5b6060821461040f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806118786029913960400191505060405180910390fd5b670de0b6b3a7640000341015610470576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806118526026913960400191505060405180910390fd5b633b9aca003406156104cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806117d26033913960400191505060405180910390fd5b633b9aca00340467ffffffffffffffff811115610535576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061182b6027913960400191505060405180910390fd5b6060610540826114ba565b90507f649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c589898989858a8a6105756020546114ba565b6040805160a0808252810189905290819060208201908201606083016080840160c085018e8e80828437600083820152601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690910187810386528c815260200190508c8c808284376000838201819052601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690920188810386528c5181528c51602091820193918e019250908190849084905b83811015610648578181015183820152602001610630565b50505050905090810190601f1680156106755780820380516001836020036101000a031916815260200191505b5086810383528881526020018989808284376000838201819052601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169092018881038452895181528951602091820193918b019250908190849084905b838110156106ef5781810151838201526020016106d7565b50505050905090810190601f16801561071c5780820380516001836020036101000a031916815260200191505b509d505050505050505050505050505060405180910390a1600060028a8a600060801b604051602001808484808284377fffffffffffffffffffffffffffffffff0000000000000000000000000000000090941691909301908152604080517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0818403018152601090920190819052815191955093508392506020850191508083835b602083106107fc57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016107bf565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610859573d6000803e3d6000fd5b5050506040513d602081101561086e57600080fd5b5051905060006002806108846040848a8c6116fe565b6040516020018083838082843780830192505050925050506040516020818303038152906040526040518082805190602001908083835b602083106108f857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016108bb565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610955573d6000803e3d6000fd5b5050506040513d602081101561096a57600080fd5b5051600261097b896040818d6116fe565b60405160009060200180848480828437919091019283525050604080518083038152602092830191829052805190945090925082918401908083835b602083106109f457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016109b7565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610a51573d6000803e3d6000fd5b5050506040513d6020811015610a6657600080fd5b5051604080516020818101949094528082019290925280518083038201815260609092019081905281519192909182918401908083835b60208310610ada57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610a9d565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610b37573d6000803e3d6000fd5b5050506040513d6020811015610b4c57600080fd5b50516040805160208101858152929350600092600292839287928f928f92018383808284378083019250505093505050506040516020818303038152906040526040518082805190602001908083835b60208310610bd957805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610b9c565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610c36573d6000803e3d6000fd5b5050506040513d6020811015610c4b57600080fd5b50516040518651600291889160009188916020918201918291908601908083835b60208310610ca957805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610c6c565b6001836020036101000a0380198251168184511680821785525050505050509050018367ffffffffffffffff191667ffffffffffffffff1916815260180182815260200193505050506040516020818303038152906040526040518082805190602001908083835b60208310610d4e57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610d11565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610dab573d6000803e3d6000fd5b5050506040513d6020811015610dc057600080fd5b5051604080516020818101949094528082019290925280518083038201815260609092019081905281519192909182918401908083835b60208310610e3457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610df7565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610e91573d6000803e3d6000fd5b5050506040513d6020811015610ea657600080fd5b50519050858114610f02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260548152602001806117486054913960600191505060405180910390fd5b60205463ffffffff11610f60576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117276021913960400191505060405180910390fd5b602080546001019081905560005b60208110156110a9578160011660011415610fa0578260008260208110610f9157fe5b0155506110ac95505050505050565b600260008260208110610faf57fe5b01548460405160200180838152602001828152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831061102557805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610fe8565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015611082573d6000803e3d6000fd5b5050506040513d602081101561109757600080fd5b50519250600282049150600101610f6e565b50fe5b50505050505050565b60606110c26020546114ba565b905090565b6020546000908190815b60208110156112f05781600116600114156111e6576002600082602081106110f557fe5b01548460405160200180838152602001828152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831061116b57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161112e565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa1580156111c8573d6000803e3d6000fd5b5050506040513d60208110156111dd57600080fd5b505192506112e2565b600283602183602081106111f657fe5b015460405160200180838152602001828152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831061126b57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161122e565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa1580156112c8573d6000803e3d6000fd5b5050506040513d60208110156112dd57600080fd5b505192505b6002820491506001016110d1565b506002826112ff6020546114ba565b600060401b6040516020018084815260200183805190602001908083835b6020831061135a57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161131d565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790527fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000095909516920191825250604080518083037ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8018152601890920190819052815191955093508392850191508083835b6020831061143f57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611402565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa15801561149c573d6000803e3d6000fd5b5050506040513d60208110156114b157600080fd5b50519250505090565b60408051600880825281830190925260609160208201818036833701905050905060c082901b8060071a60f81b826000815181106114f457fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060061a60f81b8260018151811061153757fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060051a60f81b8260028151811061157a57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060041a60f81b826003815181106115bd57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060031a60f81b8260048151811061160057fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060021a60f81b8260058151811061164357fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060011a60f81b8260068151811061168657fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060001a60f81b826007815181106116c957fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535050919050565b6000808585111561170d578182fd5b83861115611719578182fd5b505082019391909203915056fe4465706f736974436f6e74726163743a206d65726b6c6520747265652066756c6c4465706f736974436f6e74726163743a207265636f6e7374727563746564204465706f7369744461746120646f6573206e6f74206d6174636820737570706c696564206465706f7369745f646174615f726f6f744465706f736974436f6e74726163743a20696e76616c6964207769746864726177616c5f63726564656e7469616c73206c656e6774684465706f736974436f6e74726163743a206465706f7369742076616c7565206e6f74206d756c7469706c65206f6620677765694465706f736974436f6e74726163743a20696e76616c6964207075626b6579206c656e6774684465706f736974436f6e74726163743a206465706f7369742076616c756520746f6f20686967684465706f736974436f6e74726163743a206465706f7369742076616c756520746f6f206c6f774465706f736974436f6e74726163743a20696e76616c6964207369676e6174757265206c656e677468a2646970667358221220dceca8706b29e917dacf25fceef95acac8d90d765ac926663ce4096195952b6164736f6c634300060b0033", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000022": "0xf5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b", + "0x0000000000000000000000000000000000000000000000000000000000000023": "0xdb56114e00fdd4c1f85c892bf35ac9a89289aaecb1ebd0a96cde606a748b5d71", + "0x0000000000000000000000000000000000000000000000000000000000000024": "0xc78009fdf07fc56a11f122370658a353aaa542ed63e44c4bc15ff4cd105ab33c", + "0x0000000000000000000000000000000000000000000000000000000000000025": "0x536d98837f2dd165a55d5eeae91485954472d56f246df256bf3cae19352a123c", + "0x0000000000000000000000000000000000000000000000000000000000000026": "0x9efde052aa15429fae05bad4d0b1d7c64da64d03d7a1854a588c2cb8430c0d30", + "0x0000000000000000000000000000000000000000000000000000000000000027": "0xd88ddfeed400a8755596b21942c1497e114c302e6118290f91e6772976041fa1", + "0x0000000000000000000000000000000000000000000000000000000000000028": "0x87eb0ddba57e35f6d286673802a4af5975e22506c7cf4c64bb6be5ee11527f2c", + "0x0000000000000000000000000000000000000000000000000000000000000029": "0x26846476fd5fc54a5d43385167c95144f2643f533cc85bb9d16b782f8d7db193", + "0x000000000000000000000000000000000000000000000000000000000000002a": "0x506d86582d252405b840018792cad2bf1259f1ef5aa5f887e13cb2f0094f51e1", + "0x000000000000000000000000000000000000000000000000000000000000002b": "0xffff0ad7e659772f9534c195c815efc4014ef1e1daed4404c06385d11192e92b", + "0x000000000000000000000000000000000000000000000000000000000000002c": "0x6cf04127db05441cd833107a52be852868890e4317e6a02ab47683aa75964220", + "0x000000000000000000000000000000000000000000000000000000000000002d": "0xb7d05f875f140027ef5118a2247bbb84ce8f2f0f1123623085daf7960c329f5f", + "0x000000000000000000000000000000000000000000000000000000000000002e": "0xdf6af5f5bbdb6be9ef8aa618e4bf8073960867171e29676f8b284dea6a08a85e", + "0x000000000000000000000000000000000000000000000000000000000000002f": "0xb58d900f5e182e3c50ef74969ea16c7726c549757cc23523c369587da7293784", + "0x0000000000000000000000000000000000000000000000000000000000000030": "0xd49a7502ffcfb0340b1d7885688500ca308161a7f96b62df9d083b71fcc8f2bb", + "0x0000000000000000000000000000000000000000000000000000000000000031": "0x8fe6b1689256c0d385f42f5bbe2027a22c1996e110ba97c171d3e5948de92beb", + "0x0000000000000000000000000000000000000000000000000000000000000032": "0x8d0d63c39ebade8509e0ae3c9c3876fb5fa112be18f905ecacfecb92057603ab", + "0x0000000000000000000000000000000000000000000000000000000000000033": "0x95eec8b2e541cad4e91de38385f2e046619f54496c2382cb6cacd5b98c26f5a4", + "0x0000000000000000000000000000000000000000000000000000000000000034": "0xf893e908917775b62bff23294dbbe3a1cd8e6cc1c35b4801887b646a6f81f17f", + "0x0000000000000000000000000000000000000000000000000000000000000035": "0xcddba7b592e3133393c16194fac7431abf2f5485ed711db282183c819e08ebaa", + "0x0000000000000000000000000000000000000000000000000000000000000036": "0x8a8d7fe3af8caa085a7639a832001457dfb9128a8061142ad0335629ff23ff9c", + "0x0000000000000000000000000000000000000000000000000000000000000037": "0xfeb3c337d7a51a6fbf00b9e34c52e1c9195c969bd4e7a0bfd51d5c5bed9c1167", + "0x0000000000000000000000000000000000000000000000000000000000000038": "0xe71f0aa83cc32edfbefa9f4d3e0174ca85182eec9f3a09f6a6c0df6377a510d7", + "0x0000000000000000000000000000000000000000000000000000000000000039": "0x31206fa80a50bb6abe29085058f16212212a60eec8f049fecb92d8c8e0a84bc0", + "0x000000000000000000000000000000000000000000000000000000000000003a": "0x21352bfecbeddde993839f614c3dac0a3ee37543f9b412b16199dc158e23b544", + "0x000000000000000000000000000000000000000000000000000000000000003b": "0x619e312724bb6d7c3153ed9de791d764a366b389af13c58bf8a8d90481a46765", + "0x000000000000000000000000000000000000000000000000000000000000003c": "0x7cdd2986268250628d0c10e385c58c6191e6fbe05191bcc04f133f2cea72c1c4", + "0x000000000000000000000000000000000000000000000000000000000000003d": "0x848930bd7ba8cac54661072113fb278869e07bb8587f91392933374d017bcbe1", + "0x000000000000000000000000000000000000000000000000000000000000003e": "0x8869ff2c22b28cc10510d9853292803328be4fb0e80495e8bb8d271f5b889636", + "0x000000000000000000000000000000000000000000000000000000000000003f": "0xb5fe28e79f1b850f8658246ce9b6a1e7b49fc06db7143e8fe0b4f2b0c5523a5c", + "0x0000000000000000000000000000000000000000000000000000000000000040": "0x985e929f70af28d0bdd1a90a808f977f597c7c778c489e98d3bd8910d31ac0f7" + } + }, + "0x000F3df6D732807Ef1319fB7B8bB8522d0Beac02": { + "balance": "0", + "nonce": "1", + "code": "0x3373fffffffffffffffffffffffffffffffffffffffe14604d57602036146024575f5ffd5b5f35801560495762001fff810690815414603c575f5ffd5b62001fff01545f5260205ff35b5f5ffd5b62001fff42064281555f359062001fff015500" + }, + "0x0aae40965e6800cd9b1f4b05ff21581047e3f91e": { + "balance": "0", + "nonce": "1", + "code": "0x3373fffffffffffffffffffffffffffffffffffffffe1460575767ffffffffffffffff5f3511605357600143035f3511604b575f35612000014311604b57611fff5f3516545f5260205ff35b5f5f5260205ff35b5f5ffd5b5f35611fff60014303165500" + }, + "0x09Fc772D0857550724b07B850a4323f39112aAaA": { + "balance": "0", + "nonce": "1", + "code": "0x3373fffffffffffffffffffffffffffffffffffffffe1460c7573615156028575f545f5260205ff35b36603814156101f05760115f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff146101f057600182026001905f5b5f821115608057810190830284830290049160010191906065565b9093900434106101f057600154600101600155600354806003026004013381556001015f35815560010160203590553360601b5f5260385f601437604c5fa0600101600355005b6003546002548082038060101160db575060105b5f5b81811461017f5780604c02838201600302600401805490600101805490600101549160601b83528260140152807fffffffffffffffffffffffffffffffff0000000000000000000000000000000016826034015260401c906044018160381c81600701538160301c81600601538160281c81600501538160201c81600401538160181c81600301538160101c81600201538160081c81600101535360010160dd565b9101809214610191579060025561019c565b90505f6002555f6003555b5f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14156101c957505f5b6001546002828201116101de5750505f6101e4565b01600290035b5f555f600155604c025ff35b5f5ffd", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + } + }, + "0x01aBEa29659e5e97C95107F20bb753cD3e09bBBb": { + "balance": "0", + "nonce": "1", + "code": "0x3373fffffffffffffffffffffffffffffffffffffffe1460cf573615156028575f545f5260205ff35b366060141561019a5760115f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1461019a57600182026001905f5b5f821115608057810190830284830290049160010191906065565b90939004341061019a57600154600101600155600354806004026004013381556001015f358155600101602035815560010160403590553360601b5f5260605f60143760745fa0600101600355005b6003546002548082038060011160e3575060015b5f5b8181146101295780607402838201600402600401805490600101805490600101805490600101549260601b84529083601401528260340152906054015260010160e5565b910180921461013b5790600255610146565b90505f6002555f6003555b5f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff141561017357505f5b6001546001828201116101885750505f61018e565b01600190035b5f555f6001556074025ff35b5f5ffd", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + } + }, + "0x454b0EA7d8aD3C56D0CF2e44Ed97b2Feab4D7AF2": { + "balance": "1000000000000000000000000000" + }, + "0xd3248BA3E5492D767F8e427Cb9C7B9D5C3972D7B": { + "balance": "1000000000000000000000000000" + }, + "0xAD01b55d7c3448B8899862eb335FBb17075d8DE2": { + "balance": "1000000000000000000000000000" + }, + "0x7e454a14B8e7528465eeF86f0DC1da4f235d9D79": { + "balance": "1000000000000000000000000000" + }, + "0x7a40026A3b9A41754a95EeC8c92C6B99886f440C": { + "balance": "1000000000000000000000000000" + }, + "0x8c4D8CDD1f474510Dd70D66F2785a3a38a29AC1A": { + "balance": "1000000000000000000000000000" + }, + "0xfC7360b3b28cf4204268A8354dbEc60720d155D2": { + "balance": "1000000000000000000000000000" + }, + "0x2F7626bBDb8c0f9071bC98046Ef6fDed2167F97F": { + "balance": "1000000000000000000000000000" + }, + "0x752CE31Dec0dde7D1563CdF6438d892De2D4FBee": { + "balance": "1000000000000000000000000000" + }, + "0x455f42d91096c4Aa708D7Cbcb2DC499dE89C402c": { + "balance": "1000000000000000000000000000" + }, + "0x85154341488732D57a97F54AB9706Bc4B71B8636": { + "balance": "1000000000000000000000000000" + }, + "0x6a9CcA73d4Ff3a249fa778C7651f4Df8B9fFa0Df": { + "balance": "1000000000000000000000000000" + }, + "0xee2d0567AAe8080CA269b7908F4aF8BBb59A6804": { + "balance": "1000000000000000000000000000" + }, + "0xDd8D4027078a471816e4Ef7F69aFc0A5d2947dDc": { + "balance": "1000000000000000000000000000" + }, + "0x20466E9A67f299F6056bE52A50ea324FA6Bd05D5": { + "balance": "1000000000000000000000000000" + }, + "0x03F24BB0C9cfb30217Ff992A36ae9230F2A1697f": { + "balance": "1000000000000000000000000000" + }, + "0x032d8372C519c3927b87BDe4479E846a81EF2d10": { + "balance": "1000000000000000000000000000" + }, + "0xF863DF14954df73804b3150F3754a8F98CBB1D0d": { + "balance": "1000000000000000000000000000" + }, + "0xbe918A6aef1920F3706E23d153146aA6C5982620": { + "balance": "1000000000000000000000000000" + }, + "0xA0c7edA3CE474BC670A11EA9537cBEfd36331123": { + "balance": "1000000000000000000000000000" + }, + "0xF03b43BeB861044492Eb43E247bEE2AC6C80c651": { + "balance": "1000000000000000000000000000" + } + }, + "coinbase": "0x0000000000000000000000000000000000000000", + "difficulty": "0x01", + "extraData": "", + "gasLimit": "0x17d7840", + "nonce": "0x1234", + "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": "1730372340" +} diff --git a/tests/engine_api/newPayloadV4_empty_requests_data.json b/tests/engine_api/newPayloadV4_empty_requests_data.json new file mode 100644 index 0000000000..066eccb1eb --- /dev/null +++ b/tests/engine_api/newPayloadV4_empty_requests_data.json @@ -0,0 +1,26 @@ +{ + "payload": { + "baseFeePerGas": "0x7", + "blobGasUsed": "0x40000", + "blockHash": "0x2ad74d1c5c12bcdedbdc821ae5d18f44e732b4096b6496a23bd9483d202003c5", + "blockNumber": "0x94b2", + "excessBlobGas": "0x0", + "extraData": "0xd883010e0c846765746888676f312e32332e32856c696e7578", + "feeRecipient": "0xf97e180c050e5ab072211ad2c213eb5aee4df134", + "gasLimit": "0x1c9c380", + "gasUsed": "0x33450", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "parentHash": "0xb647cb4bb1671b0c619c4c71b40effc80ce96819cb2832b52be6cda03d0e5fee", + "prevRandao": "0x7054943af1e7e26984ce8b44069f82d2a8d43ba4ce8a6ca5332978032db9acd3", + "receiptsRoot": "0x86b0c83ced5201a87641678023531e90eddfacb8e3ce78256bf7417037d387b9", + "stateRoot": "0x4a7f23a99ac14da1af4f1d0ca0b740c8cda0753676f2cf079089a74dcb2d4f24", + "timestamp": "0x671b65c6", + "transactions": [], + "withdrawals": [] + }, + "expectedBlobVersionedHashes": [], + "parentBeaconBlockRoot": "0x25b66ce21990ffcbbb6248952c6ef7939dbddfb90f6659a2bb43ff369f47c23b", + "executionRequests": [ + "0x00" + ] +} diff --git a/tests/engine_api/newPayloadV4_invalid_blockhash.json b/tests/engine_api/newPayloadV4_invalid_blockhash.json index 5a0d3d866a..07595c43de 100644 --- a/tests/engine_api/newPayloadV4_invalid_blockhash.json +++ b/tests/engine_api/newPayloadV4_invalid_blockhash.json @@ -2,7 +2,7 @@ "payload": { "baseFeePerGas": "0x7", "blobGasUsed": "0x40000", - "blockHash": "0x187307d7dc9beb87af2a1d8340e9f17a3bbe4738963daeaf6d8e13b27b2d6a7f", + "blockHash": "0x2ad74d1c5c12bcdedbdc821ae5d18f44e732b4096b6496a23bd9483d202003c5", "blockNumber": "0x94b2", "excessBlobGas": "0x0", "extraData": "0xd883010e0c846765746888676f312e32332e32856c696e7578", @@ -34,9 +34,5 @@ "0x0139c61fb5022f854e37742230a76e524166c0f1b2d67a152d4f5a488b5159c1" ], "parentBeaconBlockRoot": "0x25b66ce21990ffcbbb6248952c6ef7939dbddfb90f6659a2bb43ff369f47c23b", - "executionRequests": [ - "0x", - "0x", - "0x" - ] + "executionRequests": [] } diff --git a/tests/engine_api/newPayloadV4_invalid_requests.json b/tests/engine_api/newPayloadV4_invalid_requests.json new file mode 100644 index 0000000000..fcf5e63c18 --- /dev/null +++ b/tests/engine_api/newPayloadV4_invalid_requests.json @@ -0,0 +1,26 @@ +{ + "payload": { + "baseFeePerGas": "0x7", + "blobGasUsed": "0x40000", + "blockHash": "0x2ad74d1c5c12bcdedbdc821ae5d18f44e732b4096b6496a23bd9483d202003c5", + "blockNumber": "0x94b2", + "excessBlobGas": "0x0", + "extraData": "0xd883010e0c846765746888676f312e32332e32856c696e7578", + "feeRecipient": "0xf97e180c050e5ab072211ad2c213eb5aee4df134", + "gasLimit": "0x1c9c380", + "gasUsed": "0x33450", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "parentHash": "0xb647cb4bb1671b0c619c4c71b40effc80ce96819cb2832b52be6cda03d0e5fee", + "prevRandao": "0x7054943af1e7e26984ce8b44069f82d2a8d43ba4ce8a6ca5332978032db9acd3", + "receiptsRoot": "0x86b0c83ced5201a87641678023531e90eddfacb8e3ce78256bf7417037d387b9", + "stateRoot": "0x4a7f23a99ac14da1af4f1d0ca0b740c8cda0753676f2cf079089a74dcb2d4f24", + "timestamp": "0x671b65c6", + "transactions": [], + "withdrawals": [] + }, + "expectedBlobVersionedHashes": [], + "parentBeaconBlockRoot": "0x25b66ce21990ffcbbb6248952c6ef7939dbddfb90f6659a2bb43ff369f47c23b", + "executionRequests": [ + "0x" + ] +} diff --git a/tests/engine_api/newPayloadV4_invalid_requests_order.json b/tests/engine_api/newPayloadV4_invalid_requests_order.json new file mode 100644 index 0000000000..92eea6ca7f --- /dev/null +++ b/tests/engine_api/newPayloadV4_invalid_requests_order.json @@ -0,0 +1,28 @@ +{ + "payload": { + "baseFeePerGas": "0x7", + "blobGasUsed": "0x40000", + "blockHash": "0x2ad74d1c5c12bcdedbdc821ae5d18f44e732b4096b6496a23bd9483d202003c5", + "blockNumber": "0x94b2", + "excessBlobGas": "0x0", + "extraData": "0xd883010e0c846765746888676f312e32332e32856c696e7578", + "feeRecipient": "0xf97e180c050e5ab072211ad2c213eb5aee4df134", + "gasLimit": "0x1c9c380", + "gasUsed": "0x33450", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "parentHash": "0xb647cb4bb1671b0c619c4c71b40effc80ce96819cb2832b52be6cda03d0e5fee", + "prevRandao": "0x7054943af1e7e26984ce8b44069f82d2a8d43ba4ce8a6ca5332978032db9acd3", + "receiptsRoot": "0x86b0c83ced5201a87641678023531e90eddfacb8e3ce78256bf7417037d387b9", + "stateRoot": "0x4a7f23a99ac14da1af4f1d0ca0b740c8cda0753676f2cf079089a74dcb2d4f24", + "timestamp": "0x671b65c6", + "transactions": [], + "withdrawals": [] + }, + "expectedBlobVersionedHashes": [], + "parentBeaconBlockRoot": "0x25b66ce21990ffcbbb6248952c6ef7939dbddfb90f6659a2bb43ff369f47c23b", + "executionRequests": [ + "0x0001020304050607", + "0x0201020304050607", + "0x0101020304050607" + ] +} diff --git a/tests/engine_api/newPayloadV4_invalid_requests_type.json b/tests/engine_api/newPayloadV4_invalid_requests_type.json new file mode 100644 index 0000000000..1ccfe1a69b --- /dev/null +++ b/tests/engine_api/newPayloadV4_invalid_requests_type.json @@ -0,0 +1,26 @@ +{ + "payload": { + "baseFeePerGas": "0x7", + "blobGasUsed": "0x40000", + "blockHash": "0x2ad74d1c5c12bcdedbdc821ae5d18f44e732b4096b6496a23bd9483d202003c5", + "blockNumber": "0x94b2", + "excessBlobGas": "0x0", + "extraData": "0xd883010e0c846765746888676f312e32332e32856c696e7578", + "feeRecipient": "0xf97e180c050e5ab072211ad2c213eb5aee4df134", + "gasLimit": "0x1c9c380", + "gasUsed": "0x33450", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "parentHash": "0xb647cb4bb1671b0c619c4c71b40effc80ce96819cb2832b52be6cda03d0e5fee", + "prevRandao": "0x7054943af1e7e26984ce8b44069f82d2a8d43ba4ce8a6ca5332978032db9acd3", + "receiptsRoot": "0x86b0c83ced5201a87641678023531e90eddfacb8e3ce78256bf7417037d387b9", + "stateRoot": "0x4a7f23a99ac14da1af4f1d0ca0b740c8cda0753676f2cf079089a74dcb2d4f24", + "timestamp": "0x671b65c6", + "transactions": [], + "withdrawals": [] + }, + "expectedBlobVersionedHashes": [], + "parentBeaconBlockRoot": "0x25b66ce21990ffcbbb6248952c6ef7939dbddfb90f6659a2bb43ff369f47c23b", + "executionRequests": [ + "0x0F01020304050607" + ] +} diff --git a/tests/engine_api/newPayloadV4_requests_order.json b/tests/engine_api/newPayloadV4_requests_order.json new file mode 100644 index 0000000000..ba0aead470 --- /dev/null +++ b/tests/engine_api/newPayloadV4_requests_order.json @@ -0,0 +1,28 @@ +{ + "payload": { + "baseFeePerGas": "0x7", + "blobGasUsed": "0x40000", + "blockHash": "0xe9228c230cb94e79b263644032915c5c062abacfdef750442c8249bd9d5c6c28", + "blockNumber": "0x94b2", + "excessBlobGas": "0x0", + "extraData": "0xd883010e0c846765746888676f312e32332e32856c696e7578", + "feeRecipient": "0xf97e180c050e5ab072211ad2c213eb5aee4df134", + "gasLimit": "0x1c9c380", + "gasUsed": "0x33450", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "parentHash": "0xb647cb4bb1671b0c619c4c71b40effc80ce96819cb2832b52be6cda03d0e5fee", + "prevRandao": "0x7054943af1e7e26984ce8b44069f82d2a8d43ba4ce8a6ca5332978032db9acd3", + "receiptsRoot": "0x86b0c83ced5201a87641678023531e90eddfacb8e3ce78256bf7417037d387b9", + "stateRoot": "0x4a7f23a99ac14da1af4f1d0ca0b740c8cda0753676f2cf079089a74dcb2d4f24", + "timestamp": "0x671b65c6", + "transactions": [], + "withdrawals": [] + }, + "expectedBlobVersionedHashes": [], + "parentBeaconBlockRoot": "0x25b66ce21990ffcbbb6248952c6ef7939dbddfb90f6659a2bb43ff369f47c23b", + "executionRequests": [ + "0x0001020304050607", + "0x0101020304050607", + "0x0201020304050607" + ] +} diff --git a/tests/test_engine_api.nim b/tests/test_engine_api.nim index e36924a173..9342236e53 100644 --- a/tests/test_engine_api.nim +++ b/tests/test_engine_api.nim @@ -38,7 +38,7 @@ type payload*: ExecutionPayload expectedBlobVersionedHashes*: Opt[seq[Hash32]] parentBeaconBlockRoot*: Opt[Hash32] - executionRequests*: Opt[array[3, seq[byte]]] + executionRequests*: Opt[seq[seq[byte]]] TestSpec = object name: string @@ -186,25 +186,29 @@ proc runNewPayloadV4Test(env: TestEnv): Result[void, string] = proc newPayloadV4ParamsTest(env: TestEnv): Result[void, string] = const - paramsFile = "tests/engine_api/newPayloadV4_invalid_blockhash.json" - - let - client = env.client - params = JrpcConv.loadFile(paramsFile, NewPayloadV4Params) - res = ? client.newPayloadV4( - params.payload, - params.expectedBlobVersionedHashes, - params.parentBeaconBlockRoot, - params.executionRequests) - - if res.status != PayloadExecutionStatus.syncing: - return err("res.status should equals to PayloadExecutionStatus.syncing") - - if res.latestValidHash.isSome: - return err("lastestValidHash should empty") - - if res.validationError.isSome: - return err("validationError should empty") + paramsFiles = [ + "tests/engine_api/newPayloadV4_invalid_blockhash.json", + "tests/engine_api/newPayloadV4_requests_order.json" + ] + + for paramsFile in paramsFiles: + let + client = env.client + params = JrpcConv.loadFile(paramsFile, NewPayloadV4Params) + res = ?client.newPayloadV4( + params.payload, + params.expectedBlobVersionedHashes, + params.parentBeaconBlockRoot, + params.executionRequests) + + if res.status != PayloadExecutionStatus.syncing: + return err("res.status should equals to PayloadExecutionStatus.syncing") + + if res.latestValidHash.isSome: + return err("lastestValidHash should empty") + + if res.validationError.isSome: + return err("validationError should empty") ok() @@ -239,6 +243,36 @@ proc genesisShouldCanonicalTest(env: TestEnv): Result[void, string] = ok() +proc newPayloadV4InvalidRequests(env: TestEnv): Result[void, string] = + const + paramsFiles = [ + "tests/engine_api/newPayloadV4_invalid_requests.json", + "tests/engine_api/newPayloadV4_empty_requests_data.json", + "tests/engine_api/newPayloadV4_invalid_requests_type.json", + "tests/engine_api/newPayloadV4_invalid_requests_order.json", + ] + + for paramsFile in paramsFiles: + let + client = env.client + params = JrpcConv.loadFile(paramsFile, NewPayloadV4Params) + res = client.newPayloadV4( + params.payload, + params.expectedBlobVersionedHashes, + params.parentBeaconBlockRoot, + params.executionRequests) + + if res.isOk: + return err("res should error") + + if $engineApiInvalidParams notin res.error: + return err("invalid error code: " & res.error & " expect: " & $engineApiInvalidParams) + + if "request" notin res.error: + return err("expect \"request\" in error message: " & res.error) + + ok() + const testList = [ TestSpec( name: "Basic cycle", @@ -261,6 +295,11 @@ const testList = [ testProc: genesisShouldCanonicalTest, genesisFile: mekongGenesisFile ), + TestSpec( + name: "newPayloadV4 invalid execution requests", + fork: Prague, + testProc: newPayloadV4InvalidRequests + ), ] proc engineApiMain*() = diff --git a/tests/test_genesis.nim b/tests/test_genesis.nim index a0bc7f0d2f..7f8e320217 100644 --- a/tests/test_genesis.nim +++ b/tests/test_genesis.nim @@ -12,6 +12,7 @@ import std/[os], unittest2, ../nimbus/config, + ../nimbus/utils/utils, ../nimbus/common/common const @@ -131,6 +132,25 @@ proc customGenesisTest() = check com.genesisHeader.blockHash == genesisHash check com.chainId == 17000.ChainId + test "Prague genesis": + # pre Prague + var cg: NetworkParams + check loadNetworkParams("mekong.json".findFilePath, cg) + var com = CommonRef.new(newCoreDbRef DefaultDbMemory, taskpool = nil, params = cg) + check com.genesisHeader.requestsHash.isNone + + # post prague + const EmptyRequestsHash = hash32"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + check loadNetworkParams("prague.json".findFilePath, cg) + com = CommonRef.new(newCoreDbRef DefaultDbMemory, taskpool = nil, params = cg) + check com.genesisHeader.requestsHash.isSome + check com.genesisHeader.requestsHash.get == EmptyRequestsHash + check calcRequestsHash([ + (DEPOSIT_REQUEST_TYPE, default(seq[byte])), + (WITHDRAWAL_REQUEST_TYPE, default(seq[byte])), + (CONSOLIDATION_REQUEST_TYPE, default(seq[byte])) + ]) == EmptyRequestsHash + proc genesisMain*() = genesisTest() customGenesisTest() diff --git a/tools/t8n/t8n_test.nim b/tools/t8n/t8n_test.nim index 46b365cc99..77aa9588da 100644 --- a/tools/t8n/t8n_test.nim +++ b/tools/t8n/t8n_test.nim @@ -112,6 +112,8 @@ proc cmp(jsc: var JsonComparator; a, b: JsonNode, path: string): bool = of JNull: result = true of JArray: + if a.len != b.len: + jsc.exit("ARRAY A.len($1) != B.len($2)" % [$a.len, $b.len]) for i, x in a.elems: if not jsc.cmp(x, b.elems[i], path & "/" & $i): return false @@ -690,7 +692,7 @@ const ), output: T8nOutput(alloc: true, result: true), expOut: "exp.json", - ), + ), ] proc main() = diff --git a/tools/t8n/testdata/00-525/exp1.json b/tools/t8n/testdata/00-525/exp1.json index a003956fe5..72cedebee2 100644 --- a/tools/t8n/testdata/00-525/exp1.json +++ b/tools/t8n/testdata/00-525/exp1.json @@ -18,11 +18,7 @@ "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "currentExcessBlobGas": "0x2b80000", "blobGasUsed": "0x0", - "requestsHash": "0x6036c41849da9c076ed79654d434017387a88fb833c2856b32e18218b3341c5f", - "requests": [ - "0x", - "0x", - "0x" - ] + "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "requests": [] } } diff --git a/tools/t8n/testdata/00-525/exp2.json b/tools/t8n/testdata/00-525/exp2.json index 298b711451..e37edad602 100644 --- a/tools/t8n/testdata/00-525/exp2.json +++ b/tools/t8n/testdata/00-525/exp2.json @@ -34,11 +34,7 @@ "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "currentExcessBlobGas": "0x2b80000", "blobGasUsed": "0x0", - "requestsHash": "0x6036c41849da9c076ed79654d434017387a88fb833c2856b32e18218b3341c5f", - "requests": [ - "0x", - "0x", - "0x" - ] + "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "requests": [] } } diff --git a/tools/t8n/testdata/00-525/exp3.json b/tools/t8n/testdata/00-525/exp3.json index bb6152a0de..2144659087 100644 --- a/tools/t8n/testdata/00-525/exp3.json +++ b/tools/t8n/testdata/00-525/exp3.json @@ -34,11 +34,9 @@ "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "currentExcessBlobGas": "0x2b80000", "blobGasUsed": "0x0", - "requestsHash": "0xa5c19ed76c01fe25a67b7ef8c227caa34951e8c7e74168408b5be0861dac686d", + "requestsHash": "0xf34c7b46f404c6c6f91b540c098b6dfe3f59b7e50ad155807c8c7d2221e52241", "requests": [ - "0x81521c60874daf5b425c21e44caf045c4d475e8b33a557a28cee3c46ef9cf9bd95b4c75a0bb629981b40d0102452dd4c020000000000000000000000332e43696a505ef45b9319973785f837ce5267b9000065cd1d0000008c8f2647f342d2c3e8fd07c6b3b9b16383ac11c4be6a6962c7fc18a789daee5fac20ee0bbe4a10383759aaffacacb72b0d67f998730cdf4995fe73afe434dfce2803b343606f67fc4995597c0af9e0fe9ed00006e5889bec29171f670e7d9be20000000000000000", - "0x", - "0x" + "0x0081521c60874daf5b425c21e44caf045c4d475e8b33a557a28cee3c46ef9cf9bd95b4c75a0bb629981b40d0102452dd4c020000000000000000000000332e43696a505ef45b9319973785f837ce5267b9000065cd1d0000008c8f2647f342d2c3e8fd07c6b3b9b16383ac11c4be6a6962c7fc18a789daee5fac20ee0bbe4a10383759aaffacacb72b0d67f998730cdf4995fe73afe434dfce2803b343606f67fc4995597c0af9e0fe9ed00006e5889bec29171f670e7d9be20000000000000000", ] } } diff --git a/tools/t8n/testdata/00-526/exp.json b/tools/t8n/testdata/00-526/exp.json index 91d11a9032..dd9464aa1d 100644 --- a/tools/t8n/testdata/00-526/exp.json +++ b/tools/t8n/testdata/00-526/exp.json @@ -50,11 +50,7 @@ "gasUsed": "0x9b2a", "currentBaseFee": "0x7", "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "requestsHash": "0x6036c41849da9c076ed79654d434017387a88fb833c2856b32e18218b3341c5f", - "requests": [ - "0x", - "0x", - "0x" - ] + "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "requests": [] } } diff --git a/tools/t8n/testdata/00-527/exp.json b/tools/t8n/testdata/00-527/exp.json index 9a27910358..d3d8c34042 100644 --- a/tools/t8n/testdata/00-527/exp.json +++ b/tools/t8n/testdata/00-527/exp.json @@ -48,11 +48,7 @@ "gasUsed": "0x9c40", "currentBaseFee": "0x7", "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "requestsHash": "0x6036c41849da9c076ed79654d434017387a88fb833c2856b32e18218b3341c5f", - "requests": [ - "0x", - "0x", - "0x" - ] + "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "requests": [] } } diff --git a/tools/t8n/testdata/33/exp.json b/tools/t8n/testdata/33/exp.json index af2c4dee7d..96efb004c9 100644 --- a/tools/t8n/testdata/33/exp.json +++ b/tools/t8n/testdata/33/exp.json @@ -60,11 +60,7 @@ "gasUsed": "0x15fa9", "currentBaseFee": "0x7", "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "requestsHash": "0x6036c41849da9c076ed79654d434017387a88fb833c2856b32e18218b3341c5f", - "requests": [ - "0x", - "0x", - "0x" - ] + "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "requests": [] } } diff --git a/tools/t8n/transition.nim b/tools/t8n/transition.nim index 1dfd5a667e..8b7655d7e7 100644 --- a/tools/t8n/transition.nim +++ b/tools/t8n/transition.nim @@ -358,12 +358,23 @@ proc exec(ctx: TransContext, var allLogs: seq[Log] for rec in result.result.receipts: allLogs.add rec.logs - let + var depositReqs = parseDepositLogs(allLogs, vmState.com.depositContractAddress).valueOr: raise newError(ErrorEVM, error) - requestsHash = calcRequestsHash(depositReqs, withdrawalReqs, consolidationReqs) + executionRequests: seq[seq[byte]] + + template append(dst, reqType, reqData) = + if reqData.len > 0: + reqData.insert(reqType) + dst.add(move(reqData)) + + executionRequests.append(DEPOSIT_REQUEST_TYPE, depositReqs) + executionRequests.append(WITHDRAWAL_REQUEST_TYPE, withdrawalReqs) + executionRequests.append(CONSOLIDATION_REQUEST_TYPE, consolidationReqs) + + let requestsHash = calcRequestsHash(executionRequests) result.result.requestsHash = Opt.some(requestsHash) - result.result.requests = Opt.some([depositReqs, withdrawalReqs, consolidationReqs]) + result.result.requests = Opt.some(executionRequests) template wrapException(body: untyped) = when wrapExceptionEnabled: diff --git a/tools/t8n/types.nim b/tools/t8n/types.nim index eb8eba6c1d..e92f3de489 100644 --- a/tools/t8n/types.nim +++ b/tools/t8n/types.nim @@ -118,7 +118,7 @@ type blobGasUsed*: Opt[uint64] currentExcessBlobGas*: Opt[uint64] requestsHash*: Opt[Hash32] - requests*: Opt[array[3, seq[byte]]] + requests*: Opt[seq[seq[byte]]] const ErrorEVM* = 2.T8NExitCode diff --git a/vendor/nim-web3 b/vendor/nim-web3 index c8f36f59cb..a3bc5ad48e 160000 --- a/vendor/nim-web3 +++ b/vendor/nim-web3 @@ -1 +1 @@ -Subproject commit c8f36f59cb354196cfe117b6866e81d450c8cfd7 +Subproject commit a3bc5ad48e2b05fa253ba68bbd5b84e4ea234f50 diff --git a/vendor/nimbus-eth2 b/vendor/nimbus-eth2 index 1eaeea10b3..e2e22662e1 160000 --- a/vendor/nimbus-eth2 +++ b/vendor/nimbus-eth2 @@ -1 +1 @@ -Subproject commit 1eaeea10b3acae082738d93b9dde85b0db759e05 +Subproject commit e2e22662e19cfb0fe9ada94a9d9c6cd52e25b5bd