diff --git a/hive_integration/nodocker/consensus/extract_consensus_data.nim b/hive_integration/nodocker/consensus/extract_consensus_data.nim index e6178d91d..3ae5ec301 100644 --- a/hive_integration/nodocker/consensus/extract_consensus_data.nim +++ b/hive_integration/nodocker/consensus/extract_consensus_data.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2021 Status Research & Development GmbH +# Copyright (c) 2021-2024 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or # http://www.apache.org/licenses/LICENSE-2.0) @@ -54,7 +54,7 @@ proc extractChainData*(n: JsonNode): ChainData = result.params = NetworkParams( genesis: parseGenesis(n), config : parseChainConfig(n)) - result.lastblockhash = n["lastblockhash"].getStr + result.lastBlockHash = n["lastblockhash"].getStr let blks = n["blocks"] for x in blks: diff --git a/hive_integration/nodocker/engine/cancun/blobs.nim b/hive_integration/nodocker/engine/cancun/blobs.nim index b28dfc000..fdfb61ce0 100644 --- a/hive_integration/nodocker/engine/cancun/blobs.nim +++ b/hive_integration/nodocker/engine/cancun/blobs.nim @@ -132,14 +132,14 @@ proc fillBlob(blobId: BlobID): KzgBlob = currentHashed = sha256.digest(currentHashed.data) proc generateBlob(blobid: BlobID): BlobCommitment = - result.blob = blobId.fillBlob() + result.blob = blobid.fillBlob() let res = blobToKzgCommitment(result.blob) if res.isErr: doAssert(false, res.error) result.commitment = res.get proc getVersionedHash*(blobid: BlobID, commitmentVersion: byte): Hash256 = - let res = blobId.generateBlob() + let res = blobid.generateBlob() result = sha256.digest(res.commitment) result.data[0] = commitmentVersion diff --git a/hive_integration/nodocker/engine/cancun/customizer.nim b/hive_integration/nodocker/engine/cancun/customizer.nim index e2c81a89d..d2f145275 100644 --- a/hive_integration/nodocker/engine/cancun/customizer.nim +++ b/hive_integration/nodocker/engine/cancun/customizer.nim @@ -9,7 +9,7 @@ # according to those terms. import - std/[options, strutils, typetraits, random], + std/[options, strutils, typetraits], stew/byteutils, ./blobs, ../types, @@ -82,17 +82,17 @@ method getExpectedError(cust: BaseGetPayloadCustomizer): int = cust.expectedError type - UpgradegetPayloadVersion* = ref object of BaseGetPayloadCustomizer + UpgradeGetPayloadVersion* = ref object of BaseGetPayloadCustomizer -method getPayloadVersion(cust: UpgradegetPayloadVersion, timestamp: uint64): Version = +method getPayloadVersion(cust: UpgradeGetPayloadVersion, timestamp: uint64): Version = let version = procCall getPayloadVersion(cust.GetPayloadCustomizer, timestamp) doAssert(version != Version.high, "cannot upgrade version " & $Version.high) version.succ type - DowngradegetPayloadVersion* = ref object of BaseGetPayloadCustomizer + DowngradeGetPayloadVersion* = ref object of BaseGetPayloadCustomizer -method getPayloadVersion(cust: DowngradegetPayloadVersion, timestamp: uint64): Version = +method getPayloadVersion(cust: DowngradeGetPayloadVersion, timestamp: uint64): Version = let version = procCall getPayloadVersion(cust.GetPayloadCustomizer, timestamp) doAssert(version != Version.V1, "cannot downgrade version 1") version.pred @@ -171,9 +171,9 @@ method getExpectInvalidStatus(cust: BaseForkchoiceUpdatedCustomizer): bool = # Customizer that upgrades the version of the forkchoice directive call to the next version. type - UpgradeforkchoiceUpdatedVersion* = ref object of BaseForkchoiceUpdatedCustomizer + UpgradeForkchoiceUpdatedVersion* = ref object of BaseForkchoiceUpdatedCustomizer -method forkchoiceUpdatedVersion(cust: UpgradeforkchoiceUpdatedVersion, headTimestamp: +method forkchoiceUpdatedVersion(cust: UpgradeForkchoiceUpdatedVersion, headTimestamp: uint64, payloadAttributesTimestamp: Option[uint64] = none(uint64)): Version = let version = procCall forkchoiceUpdatedVersion(EngineAPIVersionResolver(cust), headTimestamp, payloadAttributesTimestamp) doAssert(version != Version.high, "cannot upgrade version " & $Version.high) @@ -181,9 +181,9 @@ method forkchoiceUpdatedVersion(cust: UpgradeforkchoiceUpdatedVersion, headTimes # Customizer that downgrades the version of the forkchoice directive call to the previous version. type - DowngradeforkchoiceUpdatedVersion* = ref object of BaseForkchoiceUpdatedCustomizer + DowngradeForkchoiceUpdatedVersion* = ref object of BaseForkchoiceUpdatedCustomizer -method forkchoiceUpdatedVersion(cust: DowngradeforkchoiceUpdatedVersion, headTimestamp: uint64, +method forkchoiceUpdatedVersion(cust: DowngradeForkchoiceUpdatedVersion, headTimestamp: uint64, payloadAttributesTimestamp: Option[uint64] = none(uint64)): Version = let version = procCall forkchoiceUpdatedVersion(EngineAPIVersionResolver(cust), headTimestamp, payloadAttributesTimestamp) doAssert(version != Version.V1, "cannot downgrade version 1") @@ -686,6 +686,7 @@ proc generateInvalidPayload*(sender: TxSender, data: ExecutableData, payloadFiel # amounts and accounts, but the order in the list is different, so # stateRoot of the resulting payload should be the same. -proc randomizeWithdrawalsOrder(src: openArray[Withdrawal]): seq[Withdrawal] = - result = @src - result.shuffle +when false: + proc randomizeWithdrawalsOrder(src: openArray[Withdrawal]): seq[Withdrawal] = + result = @src + result.shuffle diff --git a/hive_integration/nodocker/engine/clmock.nim b/hive_integration/nodocker/engine/clmock.nim index 42be633a6..d66625d87 100644 --- a/hive_integration/nodocker/engine/clmock.nim +++ b/hive_integration/nodocker/engine/clmock.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2023 Status Research & Development GmbH +# Copyright (c) 2023-2024 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or # http://www.apache.org/licenses/LICENSE-2.0) @@ -93,7 +93,7 @@ type proc collectBlobHashes(list: openArray[Web3Tx]): seq[common.Hash256] = for w3tx in list: - let tx = ethTx(w3Tx) + let tx = ethTx(w3tx) for h in tx.versionedHashes: result.add h diff --git a/hive_integration/nodocker/engine/engine/fork_id.nim b/hive_integration/nodocker/engine/engine/fork_id.nim index 5887d80fe..2a982b1b2 100644 --- a/hive_integration/nodocker/engine/engine/fork_id.nim +++ b/hive_integration/nodocker/engine/engine/fork_id.nim @@ -23,7 +23,7 @@ method withMainFork(cs: ForkIDSpec, fork: EngineFork): BaseSpec = return res method getName(cs: ForkIDSpec): string = - var name = "Fork ID: Genesis at $1, $2 at $3" % [$cs.getGenesistimestamp(), $cs.mainFork, $cs.forkTime] + var name = "Fork ID: Genesis at $1, $2 at $3" % [$cs.getGenesisTimestamp(), $cs.mainFork, $cs.forkTime] if cs.previousForkTime != 0: name.add ", $1 at $2" % [$cs.mainFork.pred, $cs.previousForkTime] @@ -53,4 +53,5 @@ method execute(cs: ForkIDSpec, env: TestEnv): bool = # Get client index's enode let engine = env.addEngine() + discard engine return true diff --git a/hive_integration/nodocker/engine/engine/forkchoice.nim b/hive_integration/nodocker/engine/engine/forkchoice.nim index 748e2c8af..df560cc73 100644 --- a/hive_integration/nodocker/engine/engine/forkchoice.nim +++ b/hive_integration/nodocker/engine/engine/forkchoice.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2023 Status Research & Development GmbH +# Copyright (c) 2023-2024 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or # http://www.apache.org/licenses/LICENSE-2.0) @@ -16,9 +16,9 @@ import type ForkchoiceStateField* = enum - HeadblockHash = "Head" - SafeblockHash = "Safe" - FinalizedblockHash = "Finalized" + HeadBlockHash = "Head" + SafeBlockHash = "Safe" + FinalizedBlockHash = "Finalized" type InconsistentForkchoiceTest* = ref object of EngineSpec @@ -76,11 +76,11 @@ method execute(cs: InconsistentForkchoiceTest, env: TestEnv): bool = ) case cs.field - of HeadblockHash: + of HeadBlockHash: inconsistentFcU.headblockHash = shadow.alt[len(shadow.alt)-1].blockHash - of SafeblockHash: + of SafeBlockHash: inconsistentFcU.safeblockHash = shadow.alt[len(shadow.canon)-2].blockHash - of FinalizedblockHash: + of FinalizedBlockHash: inconsistentFcU.finalizedblockHash = shadow.alt[len(shadow.canon)-3].blockHash let version = env.engine.version(env.clMock.latestPayloadBuilt.timestamp) @@ -93,19 +93,19 @@ method execute(cs: InconsistentForkchoiceTest, env: TestEnv): bool = return true type - ForkchoiceUpdatedUnknownblockHashTest* = ref object of EngineSpec + ForkchoiceUpdatedUnknownBlockHashTest* = ref object of EngineSpec field*: ForkchoiceStateField -method withMainFork(cs: ForkchoiceUpdatedUnknownblockHashTest, fork: EngineFork): BaseSpec = +method withMainFork(cs: ForkchoiceUpdatedUnknownBlockHashTest, fork: EngineFork): BaseSpec = var res = cs.clone() res.mainFork = fork return res -method getName(cs: ForkchoiceUpdatedUnknownblockHashTest): string = +method getName(cs: ForkchoiceUpdatedUnknownBlockHashTest): string = return "Unknown $1blockHash" % [$cs.field] # Send an inconsistent ForkchoiceState with a known payload that belongs to a side chain as head, safe or finalized. -method execute(cs: ForkchoiceUpdatedUnknownblockHashTest, env: TestEnv): bool = +method execute(cs: ForkchoiceUpdatedUnknownBlockHashTest, env: TestEnv): bool = # Wait until TTD is reached by this client let ok = waitFor env.clMock.waitForTTD() testCond ok @@ -116,7 +116,7 @@ method execute(cs: ForkchoiceUpdatedUnknownblockHashTest, env: TestEnv): bool = # Generate a random block hash let randomblockHash = Web3Hash.randomBytes() - if cs.field == HeadblockHash: + if cs.field == HeadBlockHash: let fcu = ForkchoiceStateV1( headblockHash: randomblockHash, safeblockHash: env.clMock.latestForkchoice.safeblockHash, @@ -153,9 +153,9 @@ method execute(cs: ForkchoiceUpdatedUnknownblockHashTest, env: TestEnv): bool = finalizedblockHash: env.clMock.latestForkchoice.finalizedblockHash, ) - if cs.field == SafeblockHash: + if cs.field == SafeBlockHash: fcu.safeblockHash = randomblockHash - elif cs.field == FinalizedblockHash: + elif cs.field == FinalizedBlockHash: fcu.finalizedblockHash = randomblockHash let version = env.engine.version(env.clMock.latestExecutedPayload.timestamp) diff --git a/hive_integration/nodocker/engine/engine/invalid_ancestor.nim b/hive_integration/nodocker/engine/engine/invalid_ancestor.nim index a0a2f41ae..d517290e2 100644 --- a/hive_integration/nodocker/engine/engine/invalid_ancestor.nim +++ b/hive_integration/nodocker/engine/engine/invalid_ancestor.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2023 Status Research & Development GmbH +# Copyright (c) 2023-2024 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or # http://www.apache.org/licenses/LICENSE-2.0) @@ -230,7 +230,7 @@ method execute(cs: InvalidMissingAncestorReOrgSyncTest, env: TestEnv): bool = if not cs.reOrgFromCanonical: # Add back the original client before side chain production - env.cLMock.addEngine(env.engine) + env.clMock.addEngine(env.engine) # Produce blocks but at the same time create an side chain which contains an invalid payload at some point (INV_P) # CommonAncestor◄─▲── P1 ◄─ P2 ◄─ P3 ◄─ ... ◄─ Pn diff --git a/hive_integration/nodocker/engine/engine/invalid_payload.nim b/hive_integration/nodocker/engine/engine/invalid_payload.nim index b4c7e602f..33d63ac54 100644 --- a/hive_integration/nodocker/engine/engine/invalid_payload.nim +++ b/hive_integration/nodocker/engine/engine/invalid_payload.nim @@ -60,6 +60,8 @@ method execute(cs: InvalidPayloadTestCase, env: TestEnv): bool = let sec = if cs.syncing: env.addEngine() else: EngineEnv(nil) + discard sec + # Wait until TTD is reached by all clients let ok = waitFor env.clMock.waitForTTD() testCond ok @@ -132,7 +134,7 @@ method execute(cs: InvalidPayloadTestCase, env: TestEnv): bool = # Depending on the field we modified, we expect a different status var version = env.engine.version(shadow.alteredPayload.timestamp) let r = env.engine.client.newPayload(version, shadow.alteredPayload) - if cs.syncing or cs.invalidField == InvalidparentHash: + if cs.syncing or cs.invalidField == InvalidParentHash: # Execution specification:: # (status: ACCEPTED, latestValidHash: null, validationError: null) if the following conditions are met: # - the blockHash of the payload is valid @@ -199,7 +201,7 @@ method execute(cs: InvalidPayloadTestCase, env: TestEnv): bool = let q = env.engine.client.newPayload(version, shadow.alteredPayload) - if cs.invalidField == InvalidparentHash: + if cs.invalidField == InvalidParentHash: # There is no invalid parentHash, if this value is incorrect, # it is assumed that the block is missing and we need to sync. # ACCEPTED also valid since the CLs normally use these interchangeably @@ -221,7 +223,7 @@ method execute(cs: InvalidPayloadTestCase, env: TestEnv): bool = # Try sending the fcU again, this time we should get the proper invalid response. # At this moment the response should be INVALID - if cs.invalidField != InvalidparentHash: + if cs.invalidField != InvalidParentHash: let version = env.engine.version(shadow.alteredPayload.timestamp) let s = env.engine.client.forkchoiceUpdated(version, fcState) # Note: syncing is acceptable here as long as the block produced after this test is produced successfully @@ -305,6 +307,7 @@ method execute(cs: PayloadBuildAfterInvalidPayloadTest, env: TestEnv): bool = # Wait until TTD is reached by this client let ok = waitFor env.clMock.waitForTTD() + testCond ok # Produce blocks before starting the test testCond env.clMock.produceBlocks(5, BlockProcessCallbacks()) diff --git a/hive_integration/nodocker/engine/engine/payload_execution.nim b/hive_integration/nodocker/engine/engine/payload_execution.nim index 0f1f08ac2..79211930d 100644 --- a/hive_integration/nodocker/engine/engine/payload_execution.nim +++ b/hive_integration/nodocker/engine/engine/payload_execution.nim @@ -289,7 +289,7 @@ method execute(cs: NewPayloadOnSyncingClientTest, env: TestEnv): bool = recipient: EthAddress.randomBytes(), ) - var sec = env.addEngine() + discard env.addEngine() # Wait until TTD is reached by all clients let ok = waitFor env.clMock.waitForTTD() @@ -327,7 +327,7 @@ method execute(cs: NewPayloadOnSyncingClientTest, env: TestEnv): bool = let r = env.engine.client.forkchoiceUpdated(version, env.clMock.latestForkchoice) r.expectPayloadStatus(PayloadExecutionStatus.syncing) - pbREs = env.clMock.produceSingleBlock(BlockProcessCallbacks( + pbRes = env.clMock.produceSingleBlock(BlockProcessCallbacks( onPayloadProducerSelected: proc(): bool = # Send at least one transaction per payload let tc = BaseTx( diff --git a/hive_integration/nodocker/engine/engine/payload_id.nim b/hive_integration/nodocker/engine/engine/payload_id.nim index 285a00f44..5d82bc9f1 100644 --- a/hive_integration/nodocker/engine/engine/payload_id.nim +++ b/hive_integration/nodocker/engine/engine/payload_id.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2023 Status Research & Development GmbH +# Copyright (c) 2023-2024 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or # http://www.apache.org/licenses/LICENSE-2.0) @@ -15,7 +15,7 @@ import type PayloadAttributesFieldChange* = enum - PayloadAttributesIncreasetimestamp = "Increase timestamp" + PayloadAttributesIncreaseTimestamp = "Increase timestamp" PayloadAttributesRandom = "Modify Random" PayloadAttributesSuggestedFeeRecipient = "Modify SuggestedFeeRecipient" PayloadAttributesAddWithdrawal = "Add Withdrawal" @@ -58,11 +58,11 @@ method execute(cs: UniquePayloadIDTest, env: TestEnv): bool = onPayloadAttributesGenerated: proc(): bool = var attr = env.clMock.latestPayloadAttributes case cs.fieldModification - of PayloadAttributesIncreasetimestamp: + of PayloadAttributesIncreaseTimestamp: attr.timestamp = w3Qty(attr.timestamp, 1) of PayloadAttributesRandom: attr.prevRandao = attr.prevRandao.plusOne - of PayloadAttributesSuggestedFeerecipient: + of PayloadAttributesSuggestedFeeRecipient: attr.suggestedFeeRecipient = attr.suggestedFeeRecipient.plusOne of PayloadAttributesAddWithdrawal: let newWithdrawal = WithdrawalV1() diff --git a/hive_integration/nodocker/engine/engine/reorg.nim b/hive_integration/nodocker/engine/engine/reorg.nim index 462317cc4..7e6c9e8cd 100644 --- a/hive_integration/nodocker/engine/engine/reorg.nim +++ b/hive_integration/nodocker/engine/engine/reorg.nim @@ -428,7 +428,7 @@ method execute(cs: ReOrgBackToCanonicalTest, env: TestEnv): bool = var version = env.engine.version(env.clMock.latestHeader.timestamp) let r = env.engine.client.forkchoiceUpdated(version, env.clMock.latestForkchoice, some(attr)) r.expectNoError() - testcond r.get.payloadID.isSome: + testCond r.get.payloadID.isSome: fatal "No payload ID returned by forkchoiceUpdated" version = env.engine.version(attr.timestamp) diff --git a/hive_integration/nodocker/engine/engine/rpc.nim b/hive_integration/nodocker/engine/engine/rpc.nim index 742ed4e3e..7c6749931 100644 --- a/hive_integration/nodocker/engine/engine/rpc.nim +++ b/hive_integration/nodocker/engine/engine/rpc.nim @@ -16,9 +16,9 @@ import type BlockStatusRPCcheckType* = enum LatestOnNewPayload = "Latest Block on NewPayload" - LatestOnHeadblockHash = "Latest Block on HeadblockHash Update" - SafeOnSafeblockHash = "Safe Block on SafeblockHash Update" - FinalizedOnFinalizedblockHash = "Finalized Block on FinalizedblockHash Update" + LatestOnHeadBlockHash = "Latest Block on HeadblockHash Update" + SafeOnSafeBlockHash = "Safe Block on SafeblockHash Update" + FinalizedOnFinalizedBlockHash = "Finalized Block on FinalizedblockHash Update" type BlockStatus* = ref object of EngineSpec @@ -42,9 +42,9 @@ method execute(cs: BlockStatus, env: TestEnv): bool = let ok = waitFor env.clMock.waitForTTD() testCond ok - if cs.checkType in [SafeOnSafeblockHash, FinalizedOnFinalizedblockHash]: + if cs.checkType in [SafeOnSafeBlockHash, FinalizedOnFinalizedBlockHash]: var number = Finalized - if cs.checkType == SafeOnSafeblockHash: + if cs.checkType == SafeOnSafeBlockHash: number = Safe let p = env.engine.client.namedHeader(number) @@ -87,19 +87,19 @@ method execute(cs: BlockStatus, env: TestEnv): bool = let q = env.engine.client.txReceipt(shadow.txHash) q.expectError() return true - of LatestOnHeadblockHash: + of LatestOnHeadBlockHash: callbacks.onForkchoiceBroadcast = proc(): bool = let r = env.engine.client.namedHeader(Head) r.expectHash(ethHash env.clMock.latestForkchoice.headblockHash) let s = env.engine.client.txReceipt(shadow.txHash) s.expectTransactionHash(shadow.txHash) return true - of SafeOnSafeblockHash: + of SafeOnSafeBlockHash: callbacks.onSafeBlockChange = proc(): bool = let r = env.engine.client.namedHeader(Safe) r.expectHash(ethHash env.clMock.latestForkchoice.safeblockHash) return true - of FinalizedOnFinalizedblockHash: + of FinalizedOnFinalizedBlockHash: callbacks.onFinalizedBlockChange = proc(): bool = let r = env.engine.client.namedHeader(Finalized) r.expectHash(ethHash env.clMock.latestForkchoice.finalizedblockHash) diff --git a/hive_integration/nodocker/engine/engine/suggested_fee_recipient.nim b/hive_integration/nodocker/engine/engine/suggested_fee_recipient.nim index 7c3105e3c..f5e38d7ec 100644 --- a/hive_integration/nodocker/engine/engine/suggested_fee_recipient.nim +++ b/hive_integration/nodocker/engine/engine/suggested_fee_recipient.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2023 Status Research & Development GmbH +# Copyright (c) 2023-2024 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or # http://www.apache.org/licenses/LICENSE-2.0) @@ -56,7 +56,7 @@ method execute(cs: SuggestedFeeRecipientTest, env: TestEnv): bool = testCond env.clMock.produceSingleBlock(BlockProcessCallbacks()) # Calculate the fees and check that they match the balance of the fee recipient - let r = env.engine.client.latestblock() + let r = env.engine.client.latestBlock() testCond r.isOk: error "cannot get latest header", msg=r.error diff --git a/hive_integration/nodocker/engine/engine_env.nim b/hive_integration/nodocker/engine/engine_env.nim index d8cce788b..186f25408 100644 --- a/hive_integration/nodocker/engine/engine_env.nim +++ b/hive_integration/nodocker/engine/engine_env.nim @@ -211,7 +211,7 @@ proc numTxsInPool*(env: EngineEnv): int = func version*(env: EngineEnv, time: EthTime): Version = if env.com.isCancunOrLater(time): Version.V3 - elif env.com.isShanghaiOrlater(time): + elif env.com.isShanghaiOrLater(time): Version.V2 else: Version.V1 diff --git a/hive_integration/nodocker/engine/test_env.nim b/hive_integration/nodocker/engine/test_env.nim index dd8fc74ce..c893ad613 100644 --- a/hive_integration/nodocker/engine/test_env.nim +++ b/hive_integration/nodocker/engine/test_env.nim @@ -91,11 +91,11 @@ func client*(env: TestEnv): RpcHttpClient = func engine*(env: TestEnv): EngineEnv = env.clients.first -func sender*(env: TesTenv): TxSender = +func sender*(env: TestEnv): TxSender = env.sender proc setupCLMock*(env: TestEnv) = - env.clmock = newCLMocker(env.engine, env.engine.com) + env.clMock = newClMocker(env.engine, env.engine.com) proc addEngine*(env: TestEnv, addToCL: bool = true, connectBootNode: bool = true): EngineEnv = doAssert(env.clMock.isNil.not) diff --git a/hive_integration/nodocker/engine/tx_sender.nim b/hive_integration/nodocker/engine/tx_sender.nim index 70e248960..daeab4c19 100644 --- a/hive_integration/nodocker/engine/tx_sender.nim +++ b/hive_integration/nodocker/engine/tx_sender.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2023 Status Research & Development GmbH +# Copyright (c) 2023-2024 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or # http://www.apache.org/licenses/LICENSE-2.0) @@ -116,7 +116,7 @@ proc fillBalance(sender: TxSender, params: NetworkParams) = ) proc new*(_: type TxSender, params: NetworkParams): TxSender = - result = TxSender(chainId: params.config.chainID) + result = TxSender(chainId: params.config.chainId) result.createAccounts() result.fillBalance(params) @@ -157,10 +157,10 @@ proc makeTx(params: MakeTxParams, tc: BaseTx): Transaction = to : tc.recipient, value : tc.amount, payload : tc.payload, - chainId : params.chainID + chainId : params.chainId ) - signTransaction(tx, params.key, params.chainID, eip155 = true) + signTransaction(tx, params.key, params.chainId, eip155 = true) proc makeTx(params: MakeTxParams, tc: BigInitcodeTx): Transaction = var tx = tc @@ -179,7 +179,7 @@ proc makeTx(params: MakeTxParams, tc: BigInitcodeTx): Transaction = proc makeTx*(sender: TxSender, tc: BaseTx, nonce: AccountNonce): Transaction = let acc = sender.getNextAccount() let params = MakeTxParams( - chainId: sender.chainID, + chainId: sender.chainId, key: acc.key, nonce: nonce ) @@ -188,7 +188,7 @@ proc makeTx*(sender: TxSender, tc: BaseTx, nonce: AccountNonce): Transaction = proc makeTx*(sender: TxSender, tc: BigInitcodeTx, nonce: AccountNonce): Transaction = let acc = sender.getNextAccount() let params = MakeTxParams( - chainId: sender.chainID, + chainId: sender.chainId, key: acc.key, nonce: nonce ) @@ -199,7 +199,7 @@ proc makeNextTx*(sender: TxSender, tc: BaseTx): Transaction = acc = sender.getNextAccount() nonce = sender.getNextNonce(acc.address) params = MakeTxParams( - chainId: sender.chainID, + chainId: sender.chainId, key: acc.key, nonce: nonce ) @@ -219,7 +219,7 @@ proc sendTx*(sender: TxSender, client: RpcClient, tc: BaseTx, nonce: AccountNonc let acc = sender.getNextAccount() params = MakeTxParams( - chainId: sender.chainID, + chainId: sender.chainId, key: acc.key, nonce: nonce ) @@ -237,7 +237,7 @@ proc sendTx*(sender: TxSender, client: RpcClient, tc: BigInitcodeTx, nonce: Acco let acc = sender.getNextAccount() params = MakeTxParams( - chainId: sender.chainID, + chainId: sender.chainId, key: acc.key, nonce: nonce ) @@ -272,7 +272,7 @@ proc makeTx*(params: MakeTxParams, tc: BlobTx): Transaction = let unsignedTx = Transaction( txType : TxEip4844, - chainId : params.chainID, + chainId : params.chainId, nonce : params.nonce, maxPriorityFee: gasTipCap, maxFee : gasFeeCap, @@ -284,7 +284,7 @@ proc makeTx*(params: MakeTxParams, tc: BlobTx): Transaction = versionedHashes: data.hashes, ) - var tx = signTransaction(unsignedTx, params.key, params.chainID, eip155 = true) + var tx = signTransaction(unsignedTx, params.key, params.chainId, eip155 = true) tx.networkPayload = NetworkPayload( blobs : data.blobs, commitments: data.commitments, @@ -299,7 +299,7 @@ proc getAccount*(sender: TxSender, idx: int): TestAccount = proc sendTx*(sender: TxSender, acc: TestAccount, client: RpcClient, tc: BlobTx): Result[Transaction, void] = let params = MakeTxParams( - chainId: sender.chainID, + chainId: sender.chainId, key: acc.key, nonce: sender.getNextNonce(acc.address), ) @@ -316,7 +316,7 @@ proc sendTx*(sender: TxSender, acc: TestAccount, client: RpcClient, tc: BlobTx): proc replaceTx*(sender: TxSender, acc: TestAccount, client: RpcClient, tc: BlobTx): Result[Transaction, void] = let params = MakeTxParams( - chainId: sender.chainID, + chainId: sender.chainId, key: acc.key, nonce: sender.getLastNonce(acc.address), ) @@ -333,7 +333,7 @@ proc replaceTx*(sender: TxSender, acc: TestAccount, client: RpcClient, tc: BlobT proc makeTx*(sender: TxSender, tc: BaseTx, acc: TestAccount, nonce: AccountNonce): Transaction = let params = MakeTxParams( - chainId: sender.chainID, + chainId: sender.chainId, key: acc.key, nonce: nonce, ) @@ -370,8 +370,8 @@ proc customizeTransaction*(sender: TxSender, modTx.S = signature.S if baseTx.txType in {TxEip1559, TxEip4844}: - if custTx.chainID.isSome: - modTx.chainID = custTx.chainID.get + if custTx.chainId.isSome: + modTx.chainId = custTx.chainId.get if custTx.gasPriceOrGasFeeCap.isSome: modTx.maxFee = custTx.gasPriceOrGasFeeCap.get.GasInt @@ -385,6 +385,6 @@ proc customizeTransaction*(sender: TxSender, modTx.to = some(address) if custTx.signature.isNone: - return signTransaction(modTx, acc.key, modTx.chainID, eip155 = true) + return signTransaction(modTx, acc.key, modTx.chainId, eip155 = true) return modTx diff --git a/hive_integration/nodocker/engine/withdrawals/wd_block_value_spec.nim b/hive_integration/nodocker/engine/withdrawals/wd_block_value_spec.nim index 54d3bf42d..b314bacd1 100644 --- a/hive_integration/nodocker/engine/withdrawals/wd_block_value_spec.nim +++ b/hive_integration/nodocker/engine/withdrawals/wd_block_value_spec.nim @@ -45,9 +45,9 @@ proc execute*(ws: BlockValueSpec, env: TestEnv): bool = totalValue += txTip.uint64.u256 * rec.gasUsed.u256 - doAssert(env.cLMock.latestBlockValue.isSome) - testCond totalValue == env.cLMock.latestBlockValue.get: + doAssert(env.clMock.latestBlockValue.isSome) + testCond totalValue == env.clMock.latestBlockValue.get: error "Unexpected block value returned on GetPayloadV2", expect=totalValue, - get=env.cLMock.latestBlockValue.get + get=env.clMock.latestBlockValue.get return true diff --git a/hive_integration/nodocker/engine/withdrawals/wd_reorg_spec.nim b/hive_integration/nodocker/engine/withdrawals/wd_reorg_spec.nim index d2dd3e227..214ecf253 100644 --- a/hive_integration/nodocker/engine/withdrawals/wd_reorg_spec.nim +++ b/hive_integration/nodocker/engine/withdrawals/wd_reorg_spec.nim @@ -292,7 +292,7 @@ proc execute*(ws: ReorgSpec, env: TestEnv): bool = let b = env.client.latestHeader() testCond b.isOk let header = b.get - if header.blockHash == ethHash(sidehash): + if header.blockHash == ethHash(sideHash): # sync successful break diff --git a/hive_integration/nodocker/graphql/graphql_sim.nim b/hive_integration/nodocker/graphql/graphql_sim.nim index 67088d83a..eaac9ab72 100644 --- a/hive_integration/nodocker/graphql/graphql_sim.nim +++ b/hive_integration/nodocker/graphql/graphql_sim.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2021 Status Research & Development GmbH +# Copyright (c) 2021-2024 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE)) # * MIT license ([LICENSE-MIT](LICENSE-MIT)) @@ -103,7 +103,7 @@ proc main() = if not fileName.endsWith(".json"): continue - let (folder, name) = fileName.splitPath() + let (_, name) = fileName.splitPath() let node = parseFile(fileName) let status = ctx.processNode(node, fileName) stat.inc(name, status) diff --git a/hive_integration/nodocker/rpc/vault.nim b/hive_integration/nodocker/rpc/vault.nim index 1888c9272..c0e5ea2e0 100644 --- a/hive_integration/nodocker/rpc/vault.nim +++ b/hive_integration/nodocker/rpc/vault.nim @@ -17,9 +17,10 @@ import ../../../nimbus/transaction, ./client -const - # This is the account that sends vault funding transactions. - vaultAccountAddr = hextoByteArray[20]("0xcf49fda3be353c69b41ed96333cd24302da4556f") +when false: + const + # This is the account that sends vault funding transactions. + vaultAccountAddr = hextoByteArray[20]("0xcf49fda3be353c69b41ed96333cd24302da4556f") const # Address of the vault in genesis. diff --git a/nimbus/db/aristo/aristo_hashify.nim b/nimbus/db/aristo/aristo_hashify.nim index ac9078a74..2f04f1c6a 100644 --- a/nimbus/db/aristo/aristo_hashify.nim +++ b/nimbus/db/aristo/aristo_hashify.nim @@ -37,7 +37,6 @@ import chronicles, eth/common, results, - stew/byteutils, "."/[aristo_desc, aristo_get, aristo_layers, aristo_serialise, aristo_utils] type @@ -56,14 +55,16 @@ logScope: # Private helpers # ------------------------------------------------------------------------------ -template logTxt(info: static[string]): static[string] = - "Hashify " & info +when false: + template logTxt(info: static[string]): static[string] = + "Hashify " & info func getOrVoid(tab: Table[VertexID,VertexID]; vid: VertexID): VertexID = tab.getOrDefault(vid, VertexID(0)) -func contains(wff: WidthFirstForest; vid: VertexID): bool = - vid in wff.base or vid in wff.pool or vid in wff.root +when false: + func contains(wff: WidthFirstForest; vid: VertexID): bool = + vid in wff.base or vid in wff.pool or vid in wff.root # ------------------------------------------------------------------------------ # Private functions diff --git a/nimbus/db/aristo/aristo_merge.nim b/nimbus/db/aristo/aristo_merge.nim index 64b6b56af..c4c1cdc10 100644 --- a/nimbus/db/aristo/aristo_merge.nim +++ b/nimbus/db/aristo/aristo_merge.nim @@ -160,7 +160,7 @@ proc insertBranch( let local = db.vidFetch(pristine = true) - lty = LeafTie(root: hike.root, path: rc.value) + # lty = LeafTie(root: hike.root, path: rc.value) db.setVtxAndKey(hike.root, local, linkVtx) linkVtx.lPfx = linkVtx.lPfx.slice(1+n) diff --git a/nimbus/db/core_db/backend/aristo_db/handlers_aristo.nim b/nimbus/db/core_db/backend/aristo_db/handlers_aristo.nim index 2e10edc26..9e257c108 100644 --- a/nimbus/db/core_db/backend/aristo_db/handlers_aristo.nim +++ b/nimbus/db/core_db/backend/aristo_db/handlers_aristo.nim @@ -59,9 +59,12 @@ type const VoidTrieID = VertexID(0) AccountsTrieID = VertexID(AccountsTrie) - StorageTrieID = VertexID(StorageTrie) GenericTrieID = VertexID(GenericTrie) +when false: + const + StorageTrieID = VertexID(StorageTrie) + logScope: topics = "aristo-hdl" diff --git a/nimbus/sync/handlers/snap.nim b/nimbus/sync/handlers/snap.nim index 9fbd25dbe..dd3526659 100644 --- a/nimbus/sync/handlers/snap.nim +++ b/nimbus/sync/handlers/snap.nim @@ -42,9 +42,6 @@ const extraTraceMessages = false # or true ## Enabled additional logging noise - estimatedNodeSize = hexaryRangeRlpNodesListSizeMax(1) - ## Some expected upper limit for a single node - estimatedProofSize = hexaryRangeRlpNodesListSizeMax(10) ## Some expected upper limit, typically not mote than 10 proof nodes @@ -58,6 +55,11 @@ const defaultDataSizeMax = fetchRequestBytesLimit ## Truncate maximum data size +when false: + const + estimatedNodeSize = hexaryRangeRlpNodesListSizeMax(1) + ## Some expected upper limit for a single node + # ------------------------------------------------------------------------------ # Private functions: helpers # ------------------------------------------------------------------------------ diff --git a/premix/regress.nim b/premix/regress.nim index 52b13f279..6e6421b4b 100644 --- a/premix/regress.nim +++ b/premix/regress.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2020-2023 Status Research & Development GmbH +# Copyright (c) 2020-2024 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or # http://www.apache.org/licenses/LICENSE-2.0) @@ -25,7 +25,6 @@ proc validateBlock(com: CommonRef, blockNumber: BlockNumber): BlockNumber = parent = com.db.getBlockHeader(parentNumber) headers = newSeq[BlockHeader](numBlocks) bodies = newSeq[BlockBody](numBlocks) - lastBlockHash: Hash256 for i in 0 ..< numBlocks: headers[i] = com.db.getBlockHeader(blockNumber + i.u256) diff --git a/tests/replay/undump_kvp.nim b/tests/replay/undump_kvp.nim index da13b444e..0d79eeeb3 100644 --- a/tests/replay/undump_kvp.nim +++ b/tests/replay/undump_kvp.nim @@ -57,7 +57,7 @@ proc walkAllDb( ## Walk over all key-value pairs of the database (`RocksDB` only.) let rop = rocksdb_readoptions_create() - rit = rocky.rocksdb.cPtr.rocksdb_create_iterator(rop) + rit = rocky.rocksDb.cPtr.rocksdb_create_iterator(rop) rit.rocksdb_iter_seek_to_first() while rit.rocksdb_iter_valid() != 0: diff --git a/tests/test_accounts_cache.nim b/tests/test_accounts_cache.nim index afd8069e5..8b88c17b8 100644 --- a/tests/test_accounts_cache.nim +++ b/tests/test_accounts_cache.nim @@ -39,6 +39,7 @@ const numBlocks: 5500, # unconditionally load blocks numTxs: 10) # txs following (not in block chain) +when false: goerliCapture1: CaptureSpecs = ( GoerliNet, goerliCapture.file, 5500, 10000) @@ -80,15 +81,16 @@ proc pp*(tx: Transaction; vmState: BaseVMState): string = "," & $vmState.readOnlyStateDB.getBalance(address) & ")" -proc setTraceLevel = - discard - when defined(chronicles_runtime_filtering) and loggingEnabled: - setLogLevel(LogLevel.TRACE) - -proc setErrorLevel = - discard - when defined(chronicles_runtime_filtering) and loggingEnabled: - setLogLevel(LogLevel.ERROR) +when false: + proc setTraceLevel = + discard + when defined(chronicles_runtime_filtering) and loggingEnabled: + setLogLevel(LogLevel.TRACE) + + proc setErrorLevel = + discard + when defined(chronicles_runtime_filtering) and loggingEnabled: + setLogLevel(LogLevel.ERROR) # ------------------------------------------------------------------------------ # Private functions diff --git a/tests/test_aristo/test_backend.nim b/tests/test_aristo/test_backend.nim index 475ecc82e..1dd4df24f 100644 --- a/tests/test_aristo/test_backend.nim +++ b/tests/test_aristo/test_backend.nim @@ -221,6 +221,7 @@ proc mergeData( let rc = db.merge(proof, root) # , noisy=noisy) xCheckRc rc.error == 0 rc.value + discard nMerged let merged = db.mergeList(leafs, noisy=noisy) xCheck merged.error in {AristoError(0), MergeLeafPathCachedAlready} @@ -328,7 +329,7 @@ proc testBackendConsistency*( var mdbPreSave = "" - rdbPreSave = "" + rdbPreSave {.used.} = "" when true and false: mdbPreSave = mdb.pp() # backendOk = true) rdbPreSave = rdb.pp() # backendOk = true) diff --git a/tests/test_aristo/test_filter.nim b/tests/test_aristo/test_filter.nim index 98ae296fd..c0f6e6eaa 100644 --- a/tests/test_aristo/test_filter.nim +++ b/tests/test_aristo/test_filter.nim @@ -64,11 +64,11 @@ proc fifos(be: BackendRef): seq[seq[(QueueID,FilterRef)]] = discard check be.kind == BackendMemory or be.kind == BackendRocksDB -func flatten(a: seq[seq[(QueueID,FilterRef)]]): seq[(QueueID,FilterRef)] = +func flatten(a: seq[seq[(QueueID,FilterRef)]]): seq[(QueueID,FilterRef)] {.used.} = for w in a: result &= w -proc fList(be: BackendRef): seq[(QueueID,FilterRef)] = +proc fList(be: BackendRef): seq[(QueueID,FilterRef)] {.used.} = case be.kind: of BackendMemory: return be.MemBackendRef.walkFilBe.toSeq.mapIt((it.qid, it.filter)) @@ -128,11 +128,12 @@ proc dump(pfx: string; dx: varargs[AristoDbRef]): string = if n1 < dx.len: result &= " ==========\n " -proc dump(dx: varargs[AristoDbRef]): string = - "".dump dx +when false: + proc dump(dx: varargs[AristoDbRef]): string = + "".dump dx -proc dump(w: DbTriplet): string = - "db".dump(w[0], w[1], w[2]) + proc dump(w: DbTriplet): string = + "db".dump(w[0], w[1], w[2]) # ------------------------------------------------------------------------------ # Private helpers @@ -684,7 +685,7 @@ proc testFilterFifo*( be = db.backend defer: db.finish(flush=true) - proc show(serial = 0; exec: seq[QidAction] = @[]) = + proc show(serial = 0; exec: seq[QidAction] = @[]) {.used.} = var s = "" if 0 < serial: s &= " n=" & $serial @@ -755,7 +756,7 @@ proc testFilterBacklog*( be = db.backend defer: db.finish(flush=true) - proc show(serial = -42, blurb = "") = + proc show(serial = -42, blurb = "") {.used.} = var s = blurb if 0 <= serial: s &= " n=" & $serial @@ -799,7 +800,7 @@ proc testFilterBacklog*( var fifoLen = be.filters.len pivot = (fifoLen * reorgPercent) div 100 - qid = be.filters[pivot] + qid {.used.} = be.filters[pivot] xb = AristoDbRef(nil) for episode in 0 .. pivot: diff --git a/tests/test_aristo/test_helpers.nim b/tests/test_aristo/test_helpers.nim index b10c50bdf..0ec38d8c6 100644 --- a/tests/test_aristo/test_helpers.nim +++ b/tests/test_aristo/test_helpers.nim @@ -257,7 +257,7 @@ proc delTree*( aristo_delete.delTree(db, root, accPath) -proc merge( +proc merge*( db: AristoDbRef; root: VertexID; path: openArray[byte]; diff --git a/tests/test_aristo/test_tx.nim b/tests/test_aristo/test_tx.nim index d8ed0a421..3471011d1 100644 --- a/tests/test_aristo/test_tx.nim +++ b/tests/test_aristo/test_tx.nim @@ -484,6 +484,7 @@ proc testTxMergeAndDeleteSubTree*( let rc = db.randomisedLeafs(leafsLeft, prng) xCheckRc rc.error == (0,0) rc.value + discard leafVidPairs # === delete sub-tree === block: diff --git a/tests/test_coredb.nim b/tests/test_coredb.nim index 5657e629a..e0913d6bc 100644 --- a/tests/test_coredb.nim +++ b/tests/test_coredb.nim @@ -11,7 +11,7 @@ ## Testing `CoreDB` wrapper implementation import - std/[os, strformat, strutils, times], + std/[os, strformat, strutils], chronicles, eth/common, results, @@ -46,7 +46,7 @@ let when unittest2DisableParamFiltering: import algorithm - + # Filter out local options and pass on the rest to `unittest2` proc cmdLineConfig(): tuple[samples: seq[CaptureSpecs]] {.used.} = ## This helper allows to pass additional command line options to the diff --git a/tests/test_coredb/test_chainsync.nim b/tests/test_coredb/test_chainsync.nim index 57ce2f251..07629bf83 100644 --- a/tests/test_coredb/test_chainsync.nim +++ b/tests/test_coredb/test_chainsync.nim @@ -125,6 +125,7 @@ proc test_chainSyncProfilingPrint*( let info = if 0 < nBlocks and nBlocks < high(int): " (" & $nBlocks & " blocks)" else: "" + discard info var blurb: seq[string] when LedgerEnableApiProfiling: blurb.add ldgProfData.profilingPrinter( diff --git a/tests/test_difficulty.nim b/tests/test_difficulty.nim index 777264229..2986399fb 100644 --- a/tests/test_difficulty.nim +++ b/tests/test_difficulty.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2019-2023 Status Research & Development GmbH +# Copyright (c) 2019-2024 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or # http://www.apache.org/licenses/LICENSE-2.0) @@ -99,7 +99,7 @@ proc testFixture(fixtures: JsonNode, testStatusIMPL: var TestStatus) = ommersHash : t.parentUncles ) - let timestamp = EthTime(t.currentTimeStamp) + let timestamp = EthTime(t.currentTimestamp) let diff = calculator(revision, timestamp, p) check diff == t.currentDifficulty diff --git a/tests/test_op_arith.nim b/tests/test_op_arith.nim index c858f1cd8..979b6a831 100644 --- a/tests/test_op_arith.nim +++ b/tests/test_op_arith.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2019-2023 Status Research & Development GmbH +# Copyright (c) 2019-2024 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or # http://www.apache.org/licenses/LICENSE-2.0) @@ -13,454 +13,454 @@ import macro_assembler, unittest2 proc opArithMain*() = suite "Arithmetic Opcodes": assembler: - title: "ADD_1" + title: "Add_1" code: - PUSH1 "0x02" - PUSH1 "0x02" - ADD + Push1 "0x02" + Push1 "0x02" + Add stack: "0x04" assembler: - title: "ADD_2" + title: "Add_2" code: - PUSH2 "0x1002" - PUSH1 "0x02" - ADD + Push2 "0x1002" + Push1 "0x02" + Add stack: "0x1004" assembler: - title: "ADD_3" + title: "Add_3" code: - PUSH2 "0x1002" - PUSH6 "0x123456789009" - ADD + Push2 "0x1002" + Push6 "0x123456789009" + Add stack: "0x12345678A00B" assembler: - title: "ADD_4" + title: "Add_4" code: - PUSH2 "0x1234" - ADD + Push2 "0x1234" + Add success: false stack: "0x1234" assembler: - title: "ADDMOD_1" + title: "Addmod_1" code: - PUSH1 "0x02" - PUSH1 "0x02" - PUSH1 "0x03" - ADDMOD + Push1 "0x02" + Push1 "0x02" + Push1 "0x03" + Addmod stack: "0x01" assembler: - title: "ADDMOD_2" + title: "Addmod_2" code: - PUSH2 "0x1000" - PUSH1 "0x02" - PUSH2 "0x1002" - ADDMOD - PUSH1 "0x00" + Push2 "0x1000" + Push1 "0x02" + Push2 "0x1002" + Addmod + Push1 "0x00" stack: "0x04" "0x00" assembler: - title: "ADDMOD_3" + title: "Addmod_3" code: - PUSH2 "0x1002" - PUSH6 "0x123456789009" - PUSH1 "0x02" - ADDMOD + Push2 "0x1002" + Push6 "0x123456789009" + Push1 "0x02" + Addmod stack: "0x093B" assembler: - title: "ADDMOD_4" + title: "Addmod_4" code: - PUSH2 "0x1234" - ADDMOD + Push2 "0x1234" + Addmod stack: "0x1234" success: false assembler: title: "MUL_1" code: - PUSH1 "0x03" - PUSH1 "0x02" - MUL + Push1 "0x03" + Push1 "0x02" + Mul stack: "0x06" assembler: title: "MUL_2" code: - PUSH3 "0x222222" - PUSH1 "0x03" - MUL + Push3 "0x222222" + Push1 "0x03" + Mul stack: "0x666666" assembler: title: "MUL_3" code: - PUSH3 "0x222222" - PUSH3 "0x333333" - MUL + Push3 "0x222222" + Push3 "0x333333" + Mul stack: "0x6D3A05F92C6" assembler: title: "MUL_4" code: - PUSH1 "0x01" - MUL + Push1 "0x01" + Mul stack: "0x01" success: false - assembler: # MULMOD OP + assembler: # Mulmod OP title: "MULMOD_2" code: - PUSH3 "0x222222" - PUSH1 "0x03" - PUSH1 "0x04" - MULMOD + Push3 "0x222222" + Push1 "0x03" + Push1 "0x04" + Mulmod stack: "0x000000000000000000000000000000000000000000000000000000000000000C" - assembler: # MULMOD OP + assembler: # Mulmod OP title: "MULMOD_3" code: - PUSH3 "0x222222" - PUSH3 "0x333333" - PUSH3 "0x444444" - MULMOD + Push3 "0x222222" + Push3 "0x333333" + Push3 "0x444444" + Mulmod stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # MULMOD OP mal + assembler: # Mulmod OP mal title: "MULMOD_4" code: - PUSH1 "0x01" - MULMOD + Push1 "0x01" + Mulmod success: false stack: "0x01" - assembler: # DIV OP + assembler: # Div OP title: "DIV_1" code: - PUSH1 "0x02" - PUSH1 "0x04" - DIV + Push1 "0x02" + Push1 "0x04" + Div stack: "0x0000000000000000000000000000000000000000000000000000000000000002" - assembler: # DIV OP + assembler: # Div OP title: "DIV_2" code: - PUSH1 "0x33" - PUSH1 "0x99" - DIV + Push1 "0x33" + Push1 "0x99" + Div stack: "0x0000000000000000000000000000000000000000000000000000000000000003" - assembler: # DIV OP + assembler: # Div OP title: "DIV_3" code: - PUSH1 "0x22" - PUSH1 "0x99" - DIV + Push1 "0x22" + Push1 "0x99" + Div stack: "0x0000000000000000000000000000000000000000000000000000000000000004" - assembler: # DIV OP + assembler: # Div OP title: "DIV_4" code: - PUSH1 "0x15" - PUSH1 "0x99" - DIV + Push1 "0x15" + Push1 "0x99" + Div stack: "0x0000000000000000000000000000000000000000000000000000000000000007" - assembler: # DIV OP + assembler: # Div OP title: "DIV_5" code: - PUSH1 "0x04" - PUSH1 "0x07" - DIV + Push1 "0x04" + Push1 "0x07" + Div stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # DIV OP + assembler: # Div OP title: "DIV_6" code: - PUSH1 "0x07" - DIV + Push1 "0x07" + Div success: false stack: "0x07" - assembler: # SDIV OP + assembler: # Sdiv OP title: "SDIV_1" code: - PUSH2 "0x03E8" - PUSH32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC18" - SDIV + Push2 "0x03E8" + Push32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC18" + Sdiv stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - assembler: # SDIV OP + assembler: # Sdiv OP title: "SDIV_2" code: - PUSH1 "0xFF" - PUSH1 "0xFF" - SDIV + Push1 "0xFF" + Push1 "0xFF" + Sdiv stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # SDIV OP, SDIV by zero should be zero + assembler: # Sdiv OP, Sdiv by zero should be zero title: "SDIV_3" code: - PUSH1 "0x00" - PUSH1 "0xFF" - SDIV + Push1 "0x00" + Push1 "0xFF" + Sdiv stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # SDIV OP mal + assembler: # Sdiv OP mal title: "SDIV_4" code: - PUSH1 "0xFF" - SDIV + Push1 "0xFF" + Sdiv success: false stack: "0xFF" - assembler: # -2^255 SDIV -1 = -2^255 (special case in yellow paper) + assembler: # -2^255 Sdiv -1 = -2^255 (special case in yellow paper) title: "SDIV_5" code: - PUSH32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" # -1 - PUSH32 "0x8000000000000000000000000000000000000000000000000000000000000000" # -2^255 == low(int256) - SDIV + Push32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" # -1 + Push32 "0x8000000000000000000000000000000000000000000000000000000000000000" # -2^255 == low(int256) + Sdiv stack: "0x8000000000000000000000000000000000000000000000000000000000000000" # -2^255 == low(int256) - assembler: # -2^255 SDIV 1 = -2^255 + assembler: # -2^255 Sdiv 1 = -2^255 title: "SDIV_6" code: - PUSH32 "0x0000000000000000000000000000000000000000000000000000000000000001" # 1 - PUSH32 "0x8000000000000000000000000000000000000000000000000000000000000000" # -2^255 == low(int256) - SDIV + Push32 "0x0000000000000000000000000000000000000000000000000000000000000001" # 1 + Push32 "0x8000000000000000000000000000000000000000000000000000000000000000" # -2^255 == low(int256) + Sdiv stack: "0x8000000000000000000000000000000000000000000000000000000000000000" # -2^255 == low(int256) - assembler: # -2 SDIV 2 = -1 + assembler: # -2 Sdiv 2 = -1 title: "SDIV_7" code: - PUSH32 "0x0000000000000000000000000000000000000000000000000000000000000002" # 2 - PUSH32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE" # -2 - SDIV + Push32 "0x0000000000000000000000000000000000000000000000000000000000000002" # 2 + Push32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE" # -2 + Sdiv stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" # -1 - assembler: # 4 SDIV -2 = -2 + assembler: # 4 Sdiv -2 = -2 title: "SDIV_8" code: - PUSH32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE" # -2 - PUSH32 "0x0000000000000000000000000000000000000000000000000000000000000004" # 4 - SDIV + Push32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE" # -2 + Push32 "0x0000000000000000000000000000000000000000000000000000000000000004" # 4 + Sdiv stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE" # -2 - assembler: # -4 SDIV 2 = -2 + assembler: # -4 Sdiv 2 = -2 title: "SDIV_9" code: - PUSH32 "0x0000000000000000000000000000000000000000000000000000000000000002" # -4 - PUSH32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC" # 2 - SDIV + Push32 "0x0000000000000000000000000000000000000000000000000000000000000002" # -4 + Push32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC" # 2 + Sdiv stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE" # -2 - assembler: # -1 SDIV 2 = 0 + assembler: # -1 Sdiv 2 = 0 title: "SDIV_10" code: - PUSH32 "0x0000000000000000000000000000000000000000000000000000000000000002" # 2 - PUSH32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" # -1 - SDIV + Push32 "0x0000000000000000000000000000000000000000000000000000000000000002" # 2 + Push32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" # -1 + Sdiv stack: "0x00" # 0 - assembler: # low(int256) SDIV low(int256) = 1 + assembler: # low(int256) Sdiv low(int256) = 1 title: "SDIV_11" code: - PUSH32 "0x8000000000000000000000000000000000000000000000000000000000000000" # low(int256) - PUSH32 "0x8000000000000000000000000000000000000000000000000000000000000000" # low(int256) - SDIV + Push32 "0x8000000000000000000000000000000000000000000000000000000000000000" # low(int256) + Push32 "0x8000000000000000000000000000000000000000000000000000000000000000" # low(int256) + Sdiv stack: "0x01" # 1 - assembler: # low(int256) SDIV 2 + assembler: # low(int256) Sdiv 2 title: "SDIV_12" code: - PUSH32 "0x0000000000000000000000000000000000000000000000000000000000000002" # 2 - PUSH32 "0x8000000000000000000000000000000000000000000000000000000000000000" # low(int256) - SDIV + Push32 "0x0000000000000000000000000000000000000000000000000000000000000002" # 2 + Push32 "0x8000000000000000000000000000000000000000000000000000000000000000" # low(int256) + Sdiv stack: "0xC000000000000000000000000000000000000000000000000000000000000000" # negative half low(int256) - assembler: # low(int256) SDIV -2 + assembler: # low(int256) Sdiv -2 title: "SDIV_13" code: - PUSH32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE" # -2 - PUSH32 "0x8000000000000000000000000000000000000000000000000000000000000000" # low(int256) - SDIV + Push32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE" # -2 + Push32 "0x8000000000000000000000000000000000000000000000000000000000000000" # low(int256) + Sdiv stack: "0x4000000000000000000000000000000000000000000000000000000000000000" # positive version of SDIV_12 assembler: title: "SDIV_14" code: - PUSH1 "0x01" # 1 - PUSH1 "0x7F" # 127 - SHL # 1 shl 127 (move the bit to the center or 128th position) + Push1 "0x01" # 1 + Push1 "0x7F" # 127 + Shl # 1 shl 127 (move the bit to the center or 128th position) - PUSH1 "0x01" # 1 - PUSH1 "0xFF" # 255 - SHL # 1 shl 255 (create low(int256)) + Push1 "0x01" # 1 + Push1 "0xFF" # 255 + Shl # 1 shl 255 (create low(int256)) - SDIV + Sdiv stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000" # half of the hi bits are set fork: Constantinople - assembler: # SUB OP + assembler: # Sub OP title: "SUB_1" code: - PUSH1 "0x04" - PUSH1 "0x06" - SUB + Push1 "0x04" + Push1 "0x06" + Sub stack: "0x0000000000000000000000000000000000000000000000000000000000000002" - assembler: # SUB OP + assembler: # Sub OP title: "SUB_2" code: - PUSH2 "0x4444" - PUSH2 "0x6666" - SUB + Push2 "0x4444" + Push2 "0x6666" + Sub stack: "0x0000000000000000000000000000000000000000000000000000000000002222" - assembler: # SUB OP + assembler: # Sub OP title: "SUB_3" code: - PUSH2 "0x4444" - PUSH4 "0x99996666" - SUB + Push2 "0x4444" + Push4 "0x99996666" + Sub stack: "0x0000000000000000000000000000000000000000000000000000000099992222" - assembler: # SUB OP mal + assembler: # Sub OP mal title: "SUB_4" code: - PUSH4 "0x99996666" - SUB + Push4 "0x99996666" + Sub success: false stack: "0x99996666" - assembler: # EXP OP + assembler: # Exp OP title: "EXP_1" code: - PUSH1 "0x03" - PUSH1 "0x02" - EXP + Push1 "0x03" + Push1 "0x02" + Exp stack: "0x0000000000000000000000000000000000000000000000000000000000000008" #assertEquals(4, gas); - assembler: # EXP OP + assembler: # Exp OP title: "EXP_2" code: - PUSH1 "0x00" - PUSH3 "0x123456" - EXP + Push1 "0x00" + Push3 "0x123456" + Exp stack: "0x0000000000000000000000000000000000000000000000000000000000000001" #assertEquals(3, gas); - assembler: # EXP OP + assembler: # Exp OP title: "EXP_3" code: - PUSH2 "0x1122" - PUSH1 "0x01" - EXP + Push2 "0x1122" + Push1 "0x01" + Exp stack: "0x0000000000000000000000000000000000000000000000000000000000000001" #assertEquals(5, gas); - assembler: # EXP OP mal + assembler: # Exp OP mal title: "EXP_4" code: - PUSH3 "0x123456" - EXP + Push3 "0x123456" + Exp success: false stack: "0x123456" - assembler: # MOD OP + assembler: # Mod OP title: "MOD_1" code: - PUSH1 "0x03" - PUSH1 "0x04" - MOD + Push1 "0x03" + Push1 "0x04" + Mod stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # MOD OP + assembler: # Mod OP title: "MOD_2" code: - PUSH2 "0x012C" - PUSH2 "0x01F4" - MOD + Push2 "0x012C" + Push2 "0x01F4" + Mod stack: "0x00000000000000000000000000000000000000000000000000000000000000C8" - assembler: # MOD OP + assembler: # Mod OP title: "MOD_3" code: - PUSH1 "0x04" - PUSH1 "0x02" - MOD + Push1 "0x04" + Push1 "0x02" + Mod stack: "0x0000000000000000000000000000000000000000000000000000000000000002" - assembler: # MOD OP mal + assembler: # Mod OP mal title: "MOD_4" code: - PUSH1 "0x04" - MOD + Push1 "0x04" + Mod success: false stack: "0x04" - assembler: # SMOD OP + assembler: # Smod OP title: "SMOD_1" code: - PUSH1 "0x03" - PUSH1 "0x04" - SMOD + Push1 "0x03" + Push1 "0x04" + Smod stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # SMOD OP + assembler: # Smod OP title: "SMOD_2" code: - PUSH32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE2" # -30 - PUSH32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56" # -170 - SMOD + Push32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE2" # -30 + Push32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56" # -170 + Smod stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEC" - assembler: # SMOD OP + assembler: # Smod OP title: "SMOD_3" code: - PUSH32 "0x000000000000000000000000000000000000000000000000000000000000001E" # 30 - PUSH32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56" # -170 - SMOD + Push32 "0x000000000000000000000000000000000000000000000000000000000000001E" # 30 + Push32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56" # -170 + Smod stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEC" - assembler: # SMOD OP mal + assembler: # Smod OP mal title: "SMOD_4" code: - PUSH32 "0x000000000000000000000000000000000000000000000000000000000000001E" # 30 - SMOD + Push32 "0x000000000000000000000000000000000000000000000000000000000000001E" # 30 + Smod success: false stack: "0x000000000000000000000000000000000000000000000000000000000000001E" # real case, EVM bug, integer over flow - assembler: # SIGNEXTEND OP + assembler: # SignExtend OP title: "SIGNEXTEND_1" code: - PUSH32 "0x000000000000000000000000000000003f9b347132d29b62d161117bca8c7307" - PUSH1 "0x0F" - SIGNEXTEND + Push32 "0x000000000000000000000000000000003f9b347132d29b62d161117bca8c7307" + Push1 "0x0F" + SignExtend stack: "0x000000000000000000000000000000003f9b347132d29b62d161117bca8c7307" assembler: - title: "BYTE with overflow pos 1" + title: "Byte with overflow pos 1" code: - PUSH32 "0x77676767676760000000000000001002e000000000000040000000e000000000" - PUSH32 "0x0000000000000000000000000000000000000000000000010000000000000000" - BYTE + Push32 "0x77676767676760000000000000001002e000000000000040000000e000000000" + Push32 "0x0000000000000000000000000000000000000000000000010000000000000000" + Byte stack: "0x0000000000000000000000000000000000000000000000000000000000000000" assembler: - title: "BYTE with overflow pos 2" + title: "Byte with overflow pos 2" code: - PUSH32 "0x001f000000000000000000000000000000200000000100000000000000000000" - PUSH32 "0x0000000000000000000000000000000080000000000000000000000000000001" - BYTE + Push32 "0x001f000000000000000000000000000000200000000100000000000000000000" + Push32 "0x0000000000000000000000000000000080000000000000000000000000000001" + Byte stack: "0x0000000000000000000000000000000000000000000000000000000000000000" when isMainModule: diff --git a/tests/test_op_bit.nim b/tests/test_op_bit.nim index 543008f17..408b90a46 100644 --- a/tests/test_op_bit.nim +++ b/tests/test_op_bit.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2019-2023 Status Research & Development GmbH +# Copyright (c) 2019-2024 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or # http://www.apache.org/licenses/LICENSE-2.0) @@ -12,655 +12,655 @@ import macro_assembler, unittest2 proc opBitMain*() = suite "Bitwise Opcodes": - assembler: # AND OP + assembler: # And OP title: "AND_1" code: - PUSH1 "0x0A" - PUSH1 "0x0A" - AND + Push1 "0x0A" + Push1 "0x0A" + And stack: "0x000000000000000000000000000000000000000000000000000000000000000A" - assembler: # AND OP + assembler: # And OP title: "AND_2" code: - PUSH1 "0xC0" - PUSH1 "0x0A" - AND + Push1 "0xC0" + Push1 "0x0A" + And stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # AND OP mal data + assembler: # And OP mal data title: "AND_3" code: - PUSH1 "0xC0" - AND + Push1 "0xC0" + And success: false stack: "0xC0" - assembler: # OR OP + assembler: # Or OP title: "OR_1" code: - PUSH1 "0xF0" - PUSH1 "0x0F" - OR + Push1 "0xF0" + Push1 "0x0F" + Or stack: "0x00000000000000000000000000000000000000000000000000000000000000FF" - assembler: # OR OP + assembler: # Or OP title: "OR_2" code: - PUSH1 "0xC3" - PUSH1 "0x3C" - OR + Push1 "0xC3" + Push1 "0x3C" + Or stack: "0x00000000000000000000000000000000000000000000000000000000000000FF" - assembler: # OR OP mal data + assembler: # Or OP mal data title: "OR_3" code: - PUSH1 "0xC0" - OR + Push1 "0xC0" + Or success: false stack: "0xC0" - assembler: # XOR OP + assembler: # Xor OP title: "XOR_1" code: - PUSH1 "0xFF" - PUSH1 "0xFF" - XOR + Push1 "0xFF" + Push1 "0xFF" + Xor stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # XOR OP + assembler: # Xor OP title: "XOR_2" code: - PUSH1 "0x0F" - PUSH1 "0xF0" - XOR + Push1 "0x0F" + Push1 "0xF0" + Xor stack: "0x00000000000000000000000000000000000000000000000000000000000000FF" - assembler: # XOR OP mal data + assembler: # Xor OP mal data title: "XOR_3" code: - PUSH1 "0xC0" - XOR + Push1 "0xC0" + Xor success: false stack: "0xC0" - assembler: # BYTE OP + assembler: # Byte OP title: "BYTE_1" code: - PUSH6 "0xAABBCCDDEEFF" - PUSH1 "0x1E" - BYTE + Push6 "0xAABBCCDDEEFF" + Push1 "0x1E" + Byte stack: "0x00000000000000000000000000000000000000000000000000000000000000EE" - assembler: # BYTE OP + assembler: # Byte OP title: "BYTE_2" code: - PUSH6 "0xAABBCCDDEEFF" - PUSH1 "0x20" - BYTE + Push6 "0xAABBCCDDEEFF" + Push1 "0x20" + Byte stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # BYTE OP + assembler: # Byte OP title: "BYTE_3" code: - PUSH6 "0xAABBCCDDEE3A" - PUSH1 "0x1F" - BYTE + Push6 "0xAABBCCDDEE3A" + Push1 "0x1F" + Byte stack: "0x000000000000000000000000000000000000000000000000000000000000003A" - assembler: # BYTE OP mal data + assembler: # Byte OP mal data title: "BYTE_4" code: - PUSH6 "0xAABBCCDDEE3A" - BYTE + Push6 "0xAABBCCDDEE3A" + Byte success: false stack: "0xAABBCCDDEE3A" - assembler: # SHL OP + assembler: # Shl OP title: "SHL_1" code: - PUSH32 "0x0000000000000000000000000000000000000000000000000000000000000001" - PUSH1 "0x00" - SHL + Push32 "0x0000000000000000000000000000000000000000000000000000000000000001" + Push1 "0x00" + Shl fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # SHL OP + assembler: # Shl OP title: "SHL_2" code: - PUSH32 "0x0000000000000000000000000000000000000000000000000000000000000001" - PUSH1 "0x01" - SHL + Push32 "0x0000000000000000000000000000000000000000000000000000000000000001" + Push1 "0x01" + Shl fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000002" - assembler: # SHL OP + assembler: # Shl OP title: "SHL_3" code: - PUSH32 "0x0000000000000000000000000000000000000000000000000000000000000001" - PUSH1 "0xff" - SHL + Push32 "0x0000000000000000000000000000000000000000000000000000000000000001" + Push1 "0xff" + Shl fork: Constantinople stack: "0x8000000000000000000000000000000000000000000000000000000000000000" - assembler: # SHL OP + assembler: # Shl OP title: "SHL_4" code: - PUSH32 "0x0000000000000000000000000000000000000000000000000000000000000001" - PUSH2 "0x0100" - SHL + Push32 "0x0000000000000000000000000000000000000000000000000000000000000001" + Push2 "0x0100" + Shl fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # SHL OP + assembler: # Shl OP title: "SHL_5" code: - PUSH32 "0x0000000000000000000000000000000000000000000000000000000000000001" - PUSH2 "0x0101" - SHL + Push32 "0x0000000000000000000000000000000000000000000000000000000000000001" + Push2 "0x0101" + Shl fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # SHL OP + assembler: # Shl OP title: "SHL_6" code: - PUSH32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - PUSH1 "0x00" - SHL + Push32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + Push1 "0x00" + Shl fork: Constantinople stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - assembler: # SHL OP + assembler: # Shl OP title: "SHL_7" code: - PUSH32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - PUSH1 "0x01" - SHL + Push32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + Push1 "0x01" + Shl fork: Constantinople stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE" - assembler: # SHL OP + assembler: # Shl OP title: "SHL_8" code: - PUSH32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - PUSH1 "0xff" - SHL + Push32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + Push1 "0xff" + Shl fork: Constantinople stack: "0x8000000000000000000000000000000000000000000000000000000000000000" - assembler: # SHL OP + assembler: # Shl OP title: "SHL_9" code: - PUSH32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - PUSH2 "0x0100" - SHL + Push32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + Push2 "0x0100" + Shl fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # SHL OP + assembler: # Shl OP title: "SHL_10" code: - PUSH32 "0x0000000000000000000000000000000000000000000000000000000000000000" - PUSH1 "0x01" - SHL + Push32 "0x0000000000000000000000000000000000000000000000000000000000000000" + Push1 "0x01" + Shl fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # SHL OP + assembler: # Shl OP title: "SHL_11" code: - PUSH32 "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - PUSH1 "0x01" - SHL + Push32 "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + Push1 "0x01" + Shl fork: Constantinople stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE" - assembler: # SHR OP + assembler: # Shr OP title: "SHR_1" code: - PUSH32 "0x0000000000000000000000000000000000000000000000000000000000000001" - PUSH1 "0x00" - SHR + Push32 "0x0000000000000000000000000000000000000000000000000000000000000001" + Push1 "0x00" + Shr fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # SHR OP + assembler: # Shr OP title: "SHR_2" code: - PUSH32 "0x0000000000000000000000000000000000000000000000000000000000000001" - PUSH1 "0x01" - SHR + Push32 "0x0000000000000000000000000000000000000000000000000000000000000001" + Push1 "0x01" + Shr fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # SHR OP + assembler: # Shr OP title: "SHR_3" code: - PUSH32 "0x8000000000000000000000000000000000000000000000000000000000000000" - PUSH1 "0x01" - SHR + Push32 "0x8000000000000000000000000000000000000000000000000000000000000000" + Push1 "0x01" + Shr fork: Constantinople stack: "0x4000000000000000000000000000000000000000000000000000000000000000" - assembler: # SHR OP + assembler: # Shr OP title: "SHR_4" code: - PUSH32 "0x8000000000000000000000000000000000000000000000000000000000000000" - PUSH1 "0xff" - SHR + Push32 "0x8000000000000000000000000000000000000000000000000000000000000000" + Push1 "0xff" + Shr fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # SHR OP + assembler: # Shr OP title: "SHR_5" code: - PUSH32 "0x8000000000000000000000000000000000000000000000000000000000000000" - PUSH2 "0x0100" - SHR + Push32 "0x8000000000000000000000000000000000000000000000000000000000000000" + Push2 "0x0100" + Shr fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # SHR OP + assembler: # Shr OP title: "SHR_6" code: - PUSH32 "0x8000000000000000000000000000000000000000000000000000000000000000" - PUSH2 "0x0101" - SHR + Push32 "0x8000000000000000000000000000000000000000000000000000000000000000" + Push2 "0x0101" + Shr fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # SHR OP + assembler: # Shr OP title: "SHR_7" code: - PUSH32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - PUSH1 "0x00" - SHR + Push32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + Push1 "0x00" + Shr fork: Constantinople stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - assembler: # SHR OP + assembler: # Shr OP title: "SHR_8" code: - PUSH32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - PUSH1 "0x01" - SHR + Push32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + Push1 "0x01" + Shr fork: Constantinople stack: "0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - assembler: # SHR OP + assembler: # Shr OP title: "SHR_9" code: - PUSH32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - PUSH1 "0xff" - SHR + Push32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + Push1 "0xff" + Shr fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # SHR OP + assembler: # Shr OP title: "SHR_10" code: - PUSH32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - PUSH2 "0x0100" - SHR + Push32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + Push2 "0x0100" + Shr fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # SHR OP + assembler: # Shr OP title: "SHR_11" code: - PUSH32 "0x0000000000000000000000000000000000000000000000000000000000000000" - PUSH1 "0x01" - SHR + Push32 "0x0000000000000000000000000000000000000000000000000000000000000000" + Push1 "0x01" + Shr fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # SAR OP + assembler: # Sar OP title: "SAR_1" code: - PUSH32 "0x0000000000000000000000000000000000000000000000000000000000000001" - PUSH1 "0x00" - SAR + Push32 "0x0000000000000000000000000000000000000000000000000000000000000001" + Push1 "0x00" + Sar fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # SAR OP + assembler: # Sar OP title: "SAR_2" code: - PUSH32 "0x0000000000000000000000000000000000000000000000000000000000000001" - PUSH1 "0x01" - SAR + Push32 "0x0000000000000000000000000000000000000000000000000000000000000001" + Push1 "0x01" + Sar fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # SAR OP + assembler: # Sar OP title: "SAR_3" code: - PUSH32 "0x8000000000000000000000000000000000000000000000000000000000000000" - PUSH1 "0x01" - SAR + Push32 "0x8000000000000000000000000000000000000000000000000000000000000000" + Push1 "0x01" + Sar fork: Constantinople stack: "0xC000000000000000000000000000000000000000000000000000000000000000" - assembler: # SAR OP + assembler: # Sar OP title: "SAR_4" code: - PUSH32 "0x8000000000000000000000000000000000000000000000000000000000000000" - PUSH1 "0xff" - SAR + Push32 "0x8000000000000000000000000000000000000000000000000000000000000000" + Push1 "0xff" + Sar fork: Constantinople stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - assembler: # SAR OP + assembler: # Sar OP title: "SAR_5" code: - PUSH32 "0x8000000000000000000000000000000000000000000000000000000000000000" - PUSH2 "0x0100" - SAR + Push32 "0x8000000000000000000000000000000000000000000000000000000000000000" + Push2 "0x0100" + Sar fork: Constantinople stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - assembler: # SAR OP + assembler: # Sar OP title: "SAR_6" code: - PUSH32 "0x8000000000000000000000000000000000000000000000000000000000000000" - PUSH2 "0x0101" - SAR + Push32 "0x8000000000000000000000000000000000000000000000000000000000000000" + Push2 "0x0101" + Sar fork: Constantinople stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - assembler: # SAR OP + assembler: # Sar OP title: "SAR_7" code: - PUSH32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - PUSH1 "0x00" - SAR + Push32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + Push1 "0x00" + Sar fork: Constantinople stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - assembler: # SAR OP + assembler: # Sar OP title: "SAR_8" code: - PUSH32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - PUSH1 "0x01" - SAR + Push32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + Push1 "0x01" + Sar fork: Constantinople stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - assembler: # SAR OP + assembler: # Sar OP title: "SAR_9" code: - PUSH32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - PUSH1 "0xff" - SAR + Push32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + Push1 "0xff" + Sar fork: Constantinople stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - assembler: # SAR OP + assembler: # Sar OP title: "SAR_10" code: - PUSH32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - PUSH2 "0x0100" - SAR + Push32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + Push2 "0x0100" + Sar fork: Constantinople stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - assembler: # SAR OP + assembler: # Sar OP title: "SAR_11" code: - PUSH32 "0x0000000000000000000000000000000000000000000000000000000000000000" - PUSH1 "0x01" - SAR + Push32 "0x0000000000000000000000000000000000000000000000000000000000000000" + Push1 "0x01" + Sar fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # SAR OP + assembler: # Sar OP title: "SAR_12" code: - PUSH32 "0x4000000000000000000000000000000000000000000000000000000000000000" - PUSH1 "0xfe" - SAR + Push32 "0x4000000000000000000000000000000000000000000000000000000000000000" + Push1 "0xfe" + Sar fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # SAR OP + assembler: # Sar OP title: "SAR_13" code: - PUSH32 "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - PUSH1 "0xf8" - SAR + Push32 "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + Push1 "0xf8" + Sar fork: Constantinople stack: "0x000000000000000000000000000000000000000000000000000000000000007F" - assembler: # SAR OP + assembler: # Sar OP title: "SAR_14" code: - PUSH32 "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - PUSH1 "0xfe" - SAR + Push32 "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + Push1 "0xfe" + Sar fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # SAR OP + assembler: # Sar OP title: "SAR_15" code: - PUSH32 "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - PUSH1 "0xff" - SAR + Push32 "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + Push1 "0xff" + Sar fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # SAR OP + assembler: # Sar OP title: "SAR_16" code: - PUSH32 "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - PUSH2 "0x0100" - SAR + Push32 "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + Push2 "0x0100" + Sar fork: Constantinople stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # ISZERO OP + assembler: # IsZero OP title: "ISZERO_1" code: - PUSH1 "0x00" - ISZERO + Push1 "0x00" + IsZero stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # ISZERO OP + assembler: # IsZero OP title: "ISZERO_2" code: - PUSH1 "0x2A" - ISZERO + Push1 "0x2A" + IsZero stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # ISZERO OP mal data + assembler: # IsZero OP mal data title: "ISZERO_3" - code: ISZERO + code: IsZero success: false - assembler: # EQ OP + assembler: # Eq OP title: "EQ_1" code: - PUSH1 "0x2A" - PUSH1 "0x2A" - EQ + Push1 "0x2A" + Push1 "0x2A" + Eq stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # EQ OP + assembler: # Eq OP title: "EQ_2" code: - PUSH3 "0x2A3B4C" - PUSH3 "0x2A3B4C" - EQ + Push3 "0x2A3B4C" + Push3 "0x2A3B4C" + Eq stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # EQ OP + assembler: # Eq OP title: "EQ_3" code: - PUSH3 "0x2A3B5C" - PUSH3 "0x2A3B4C" - EQ + Push3 "0x2A3B5C" + Push3 "0x2A3B4C" + Eq stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # EQ OP mal data + assembler: # Eq OP mal data title: "EQ_4" code: - PUSH3 "0x2A3B4C" - EQ + Push3 "0x2A3B4C" + Eq success: false stack: "0x2A3B4C" - assembler: # GT OP + assembler: # Gt OP title: "GT_1" code: - PUSH1 "0x01" - PUSH1 "0x02" - GT + Push1 "0x01" + Push1 "0x02" + Gt stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # GT OP + assembler: # Gt OP title: "GT_2" code: - PUSH1 "0x01" - PUSH2 "0x0F00" - GT + Push1 "0x01" + Push2 "0x0F00" + Gt stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # GT OP + assembler: # Gt OP title: "GT_3" code: - PUSH4 "0x01020304" - PUSH2 "0x0F00" - GT + Push4 "0x01020304" + Push2 "0x0F00" + Gt stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # GT OP mal data + assembler: # Gt OP mal data title: "GT_4" code: - PUSH3 "0x2A3B4C" - GT + Push3 "0x2A3B4C" + Gt success: false stack: "0x2A3B4C" - assembler: # SGT OP + assembler: # Sgt OP title: "SGT_1" code: - PUSH1 "0x01" - PUSH1 "0x02" - SGT + Push1 "0x01" + Push1 "0x02" + Sgt stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # SGT OP + assembler: # Sgt OP title: "SGT_2" code: - PUSH32 "0x000000000000000000000000000000000000000000000000000000000000001E" # 30 - PUSH32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56" # -170 - SGT + Push32 "0x000000000000000000000000000000000000000000000000000000000000001E" # 30 + Push32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56" # -170 + Sgt stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # SGT OP + assembler: # Sgt OP title: "SGT_3" code: - PUSH32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56" # -170 - PUSH32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF57" # -169 - SGT + Push32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56" # -170 + Push32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF57" # -169 + Sgt stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # SGT OP mal + assembler: # Sgt OP mal title: "SGT_4" code: - PUSH32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56" # -170 - SGT + Push32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56" # -170 + Sgt success: false stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56" - assembler: # LT OP + assembler: # Lt OP title: "LT_1" code: - PUSH1 "0x01" - PUSH1 "0x02" - LT + Push1 "0x01" + Push1 "0x02" + Lt stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # LT OP + assembler: # Lt OP title: "LT_2" code: - PUSH1 "0x01" - PUSH2 "0x0F00" - LT + Push1 "0x01" + Push2 "0x0F00" + Lt stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # LT OP + assembler: # Lt OP title: "LT_3" code: - PUSH4 "0x01020304" - PUSH2 "0x0F00" - LT + Push4 "0x01020304" + Push2 "0x0F00" + Lt stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # LT OP mal data + assembler: # Lt OP mal data title: "LT_4" code: - PUSH3 "0x2A3B4C" - LT + Push3 "0x2A3B4C" + Lt success: false stack: "0x2A3B4C" - assembler: # SLT OP + assembler: # Slt OP title: "SLT_1" code: - PUSH1 "0x01" - PUSH1 "0x02" - SLT + Push1 "0x01" + Push1 "0x02" + Slt stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # SLT OP + assembler: # Slt OP title: "SLT_2" code: - PUSH32 "0x000000000000000000000000000000000000000000000000000000000000001E" # 30 - PUSH32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56" # -170 - SLT + Push32 "0x000000000000000000000000000000000000000000000000000000000000001E" # 30 + Push32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56" # -170 + Slt stack: "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # SLT OP + assembler: # Slt OP title: "SLT_3" code: - PUSH32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56" # -170 - PUSH32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF57" # -169 - SLT + Push32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56" # -170 + Push32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF57" # -169 + Slt stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # SLT OP mal + assembler: # Slt OP mal title: "SLT_4" code: - PUSH32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56" # -170 - SLT + Push32 "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56" # -170 + Slt success: false stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF56" - assembler: # NOT OP + assembler: # Not OP title: "NOT_1" code: - PUSH1 "0x01" - NOT + Push1 "0x01" + Not stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE" - assembler: # NOT OP + assembler: # Not OP title: "NOT_2" code: - PUSH2 "0xA003" - NOT + Push2 "0xA003" + Not stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5FFC" assembler: # BNOT OP title: "BNOT_4" - code: NOT + code: Not success: false - assembler: # NOT OP + assembler: # Not OP title: "NOT_5" code: - PUSH1 "0x00" - NOT + Push1 "0x00" + Not stack: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" when isMainModule: diff --git a/tests/test_op_custom.nim b/tests/test_op_custom.nim index d20b3d051..7ac0c57be 100644 --- a/tests/test_op_custom.nim +++ b/tests/test_op_custom.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2019-2023 Status Research & Development GmbH +# Copyright (c) 2019-2024 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or # http://www.apache.org/licenses/LICENSE-2.0) @@ -276,7 +276,7 @@ proc opCustomMain*() = assembler: # TIMESTAMP OP title: "TIMESTAMP_1" code: - TimeStamp + Timestamp stack: "0x0000000000000000000000000000000000000000000000000000000000001234" # current block number diff --git a/tests/test_op_env.nim b/tests/test_op_env.nim index b6d564532..8f33736e4 100644 --- a/tests/test_op_env.nim +++ b/tests/test_op_env.nim @@ -19,108 +19,108 @@ proc opEnvMain*() = assembler: # EVM bug reported in discord title: "stack's operator [] bug" code: - PUSH1 "0x0A" - DUP1 - RETURNDATASIZE - MSIZE - ADDRESS - GAS - STATICCALL - CALL + Push1 "0x0A" + Dup1 + ReturnDataSize + Msize + Address + Gas + StaticCall + Call fork: London success: false memory: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # CODECOPY OP + assembler: # CodeCopy OP title: "CODECOPY_1" code: - PUSH1 "0x03" # size - PUSH1 "0x08" # copy start pos - PUSH1 "0x00" # mem start pos - CODECOPY - STOP - SLT - CALLVALUE - JUMP + Push1 "0x03" # size + Push1 "0x08" # copy start pos + Push1 "0x00" # mem start pos + CodeCopy + Stop + Slt + CallValue + Jump memory: "0x1234560000000000000000000000000000000000000000000000000000000000" - # assertEquals(6, gas); ?? + gasused: 18 - assembler: # CODECOPY OP + assembler: # CodeCopy OP title: "CODECOPY_2" code: - PUSH1 "0x5E" # size - PUSH1 "0x08" # copy start pos - PUSH1 "0x00" # mem start pos - CODECOPY - STOP - PUSH1 "0x00" - PUSH1 "0x5f" - SSTORE - PUSH1 "0x14" - PUSH1 "0x00" - SLOAD - PUSH1 "0x1e" - PUSH1 "0x20" - SLOAD - PUSH4 "0xabcddcba" - PUSH1 "0x40" - SLOAD - JUMPDEST - MLOAD - PUSH1 "0x20" - ADD - PUSH1 "0x0a" - MSTORE - SLOAD - MLOAD - PUSH1 "0x40" - ADD - PUSH1 "0x14" - MSTORE - SLOAD - MLOAD - PUSH1 "0x60" - ADD - PUSH1 "0x1e" - MSTORE - SLOAD - MLOAD - PUSH1 "0x80" - ADD - PUSH1 "0x28" - MSTORE - SLOAD - PUSH1 "0xa0" - MSTORE - SLOAD - PUSH1 "0x16" - PUSH1 "0x48" - PUSH1 "0x00" - CODECOPY - PUSH1 "0x16" - PUSH1 "0x00" - CALLCODE - PUSH1 "0x00" - PUSH1 "0x3f" - SSTORE - PUSH2 "0x03e7" - JUMP - PUSH1 "0x00" - SLOAD - PUSH1 "0x00" - MSTORE8 - PUSH1 "0x20" - MUL - CALLDATALOAD - PUSH1 "0x20" - SLOAD + Push1 "0x5E" # size + Push1 "0x08" # copy start pos + Push1 "0x00" # mem start pos + CodeCopy + Stop + Push1 "0x00" + Push1 "0x5f" + Sstore + Push1 "0x14" + Push1 "0x00" + Sload + Push1 "0x1e" + Push1 "0x20" + Sload + Push4 "0xabcddcba" + Push1 "0x40" + Sload + JumpDest + Mload + Push1 "0x20" + Add + Push1 "0x0a" + Mstore + Sload + Mload + Push1 "0x40" + Add + Push1 "0x14" + Mstore + Sload + Mload + Push1 "0x60" + Add + Push1 "0x1e" + Mstore + Sload + Mload + Push1 "0x80" + Add + Push1 "0x28" + Mstore + Sload + Push1 "0xa0" + Mstore + Sload + Push1 "0x16" + Push1 "0x48" + Push1 "0x00" + CodeCopy + Push1 "0x16" + Push1 "0x00" + CallCode + Push1 "0x00" + Push1 "0x3f" + Sstore + Push2 "0x03e7" + Jump + Push1 "0x00" + Sload + Push1 "0x00" + Mstore8 + Push1 "0x20" + Mul + CallDataLoad + Push1 "0x20" + Sload memory: "0x6000605F556014600054601E60205463ABCDDCBA6040545B51602001600A5254" "0x516040016014525451606001601E5254516080016028525460A0525460166048" "0x60003960166000F26000603F556103E756600054600053602002356020540000" - #assertEquals(10, gas); ?? + gasUsed: 30 - assembler: # CODECOPY OP + assembler: # CodeCopy OP title: "CODECOPY_3" # cost for that: # 94 - data copied @@ -130,7 +130,7 @@ proc opEnvMain*() = Push1 "0x08" Push1 "0x00" CodeCopy - STOP + Stop "0x6000605f556014600054601e60205463abcddcba6040545b" "0x51602001600a5254516040016014525451606001601e52545160800160285254" "0x60a052546016604860003960166000f26000603f556103e75660005460005360" @@ -141,14 +141,14 @@ proc opEnvMain*() = "0x60003960166000F26000603F556103E756600054600053602002350000000000" #assertEquals(10, program.getResult().getGasUsed()); - assembler: # CODECOPY OP + assembler: # CodeCopy OP title: "CODECOPY_4" code: Push1 "0x5E" Push1 "0x07" Push1 "0x00" CodeCopy - STOP + Stop "0x6000605f556014600054601e60205463abcddcba6040545b51" "0x602001600a5254516040016014525451606001601e5254516080016028525460" "0xa052546016604860003960166000f26000603f556103e756600054600053602002351234" @@ -158,7 +158,7 @@ proc opEnvMain*() = "0x4860003960166000F26000603F556103E7566000546000536020023512340000" #assertEquals(10, program.getResult().getGasUsed()); - assembler: # CODECOPY OP + assembler: # CodeCopy OP title: "CODECOPY_5" code: Push2 "0x1234" @@ -171,7 +171,7 @@ proc opEnvMain*() = Push1 "0x00" Push1 "0x20" CodeCopy - STOP + Stop "0x6000605f55601460" "0x0054601e60205463abcddcba6040545b51602001600a525451604001" "0x6014525451606001601e5254516080016028525460a0525460166048" @@ -188,7 +188,7 @@ proc opEnvMain*() = "0x601e5254516080016028525460a052546016604860003960166000f26000603f" "0x556103e756600054600053602002351200000000000000000000000000000000" - assembler: # CODECOPY OP mal + assembler: # CodeCopy OP mal title: "CODECOPY_6" code: "0x605E6007396000605f556014600054601e60205463abcddcba604054" @@ -220,7 +220,7 @@ proc opEnvMain*() = Push1 "0x00" # mem pos Push20 "0xfbe0afcd7658ba86be41922059dd879c192d4c73" ExtCodeCopy - STOP + Stop Slt CallValue Jump @@ -238,7 +238,7 @@ proc opEnvMain*() = Push1 "0x00" Push20 "0xfbe0afcd7658ba86be41922059dd879c192d4c73" ExtCodeCopy - STOP + Stop "0x6000605f" "0x556014600054601e60205463abcddcba6040545b51602001600a525451604001" "0x6014525451606001601e5254516080016028525460a052546016604860003960" @@ -258,7 +258,7 @@ proc opEnvMain*() = Push1 "0x00" Push20 "0xfbe0afcd7658ba86be41922059dd879c192d4c73" ExtCodeCopy - STOP + Stop "0x6000605f" "0x556014600054601e60205463abcddcba6040545b51602001600a525451604001" "0x6014525451606001601e5254516080016028525460a052546016604860003960" @@ -285,7 +285,7 @@ proc opEnvMain*() = Push1 "0x20" Push20 "0xfbe0afcd7658ba86be41922059dd879c192d4c73" ExtCodeCopy - STOP + Stop "0x6000605f556014600054601e60205463abcddcba6040545b" "0x51602001600a5254516040016014525451606001601e52545160800160285254" "0x60a052546016604860003960166000f26000603f556103e756600054600053602002351234" @@ -330,7 +330,7 @@ proc opEnvMain*() = code: Push20 "0xfbe0afcd7658ba86be41922059dd879c192d4c73" ExtCodeSize - STOP + Stop "0x5E60076000396000605f" "0x556014600054601e60205463abcddcba6040545b51602001600a525451604001" "0x6014525451606001601e5254516080016028525460a052546016604860003960" @@ -345,7 +345,7 @@ proc opEnvMain*() = code: Push20 "0xfbe0afcd7658ba86be41922059dd879c192d4c73" ExtCodeSize - STOP + Stop stack: "0x94" fork: Berlin gasused: 2603 @@ -358,7 +358,7 @@ proc opEnvMain*() = code: Push20 "0xfbe0afcd7658ba86be41922059dd879c192d4c73" ExtCodeHash - STOP + Stop stack: "0xc862129bffb73168481c6a51fd36afb8342887fbc5314c763ac731c732d7310c" fork: Berlin @@ -368,7 +368,7 @@ proc opEnvMain*() = title: "EIP-4399 PrevRandao 0" code: PrevRandao - STOP + Stop stack: "0x0000000000000000000000000000000000000000000000000000000000000000" fork: Paris @@ -379,7 +379,7 @@ proc opEnvMain*() = vmState.blockCtx.prevRandao = EMPTY_UNCLE_HASH code: PrevRandao - STOP + Stop stack: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" fork: Paris @@ -387,9 +387,9 @@ proc opEnvMain*() = assembler: title: "EIP-4844: BlobHash 1" code: - PUSH1 "0x01" + Push1 "0x01" BlobHash - STOP + Stop stack: "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" fork: Cancun @@ -397,9 +397,9 @@ proc opEnvMain*() = assembler: title: "EIP-4844: BlobHash 0" code: - PUSH1 "0x00" + Push1 "0x00" BlobHash - STOP + Stop stack: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" fork: Cancun @@ -407,9 +407,9 @@ proc opEnvMain*() = assembler: title: "EIP-4844: BlobHash 2" code: - PUSH1 "0x02" + Push1 "0x02" BlobHash - STOP + Stop stack: "0x0000000000000000000000000000000000000000000000000000000000000000" fork: Cancun @@ -417,9 +417,9 @@ proc opEnvMain*() = assembler: title: "EIP-4844: BlobHash 32 Bit high" code: - PUSH4 "0xffffffff" + Push4 "0xffffffff" BlobHash - STOP + Stop stack: "0x0000000000000000000000000000000000000000000000000000000000000000" fork: Cancun @@ -427,9 +427,9 @@ proc opEnvMain*() = assembler: title: "EIP-4844: BlobHash 64 Bit high" code: - PUSH8 "0xffffffffffffffff" + Push8 "0xffffffffffffffff" BlobHash - STOP + Stop stack: "0x0000000000000000000000000000000000000000000000000000000000000000" fork: Cancun @@ -437,9 +437,9 @@ proc opEnvMain*() = assembler: title: "EIP-4844: BlobHash 128 Bit high" code: - PUSH16 "0xffffffffffffffffffffffffffffffff" + Push16 "0xffffffffffffffffffffffffffffffff" BlobHash - STOP + Stop stack: "0x0000000000000000000000000000000000000000000000000000000000000000" fork: Cancun @@ -447,9 +447,9 @@ proc opEnvMain*() = assembler: title: "EIP-4844: BlobHash 256 Bit high" code: - PUSH32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + Push32 "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" BlobHash - STOP + Stop stack: "0x0000000000000000000000000000000000000000000000000000000000000000" fork: Cancun @@ -458,7 +458,7 @@ proc opEnvMain*() = title: "EIP-7516: BlobBaseFee" code: BlobBaseFee - STOP + Stop stack: "0x0000000000000000000000000000000000000000000000000000000000000001" gasused: 2 diff --git a/tests/test_op_memory.nim b/tests/test_op_memory.nim index 17eb45473..0c27628dd 100644 --- a/tests/test_op_memory.nim +++ b/tests/test_op_memory.nim @@ -17,244 +17,244 @@ macro_assembler.coreDbType = LegacyDbMemory proc opMemoryMain*() = suite "Memory Opcodes": - assembler: # PUSH1 OP - title: "PUSH1" + assembler: # Push1 OP + title: "Push1" code: - PUSH1 "0xa0" + Push1 "0xa0" stack: "0x00000000000000000000000000000000000000000000000000000000000000A0" - assembler: # PUSH2 OP - title: "PUSH2" + assembler: # Push2 OP + title: "Push2" code: - PUSH2 "0xa0b0" + Push2 "0xa0b0" stack: "0x000000000000000000000000000000000000000000000000000000000000A0B0" - assembler: # PUSH3 OP - title: "PUSH3" + assembler: # Push3 OP + title: "Push3" code: - PUSH3 "0xA0B0C0" + Push3 "0xA0B0C0" stack: "0x0000000000000000000000000000000000000000000000000000000000A0B0C0" - assembler: # PUSH4 OP - title: "PUSH4" + assembler: # Push4 OP + title: "Push4" code: - PUSH4 "0xA0B0C0D0" + Push4 "0xA0B0C0D0" stack: "0x00000000000000000000000000000000000000000000000000000000A0B0C0D0" - assembler: # PUSH5 OP - title: "PUSH5" + assembler: # Push5 OP + title: "Push5" code: - PUSH5 "0xA0B0C0D0E0" + Push5 "0xA0B0C0D0E0" stack: "0x000000000000000000000000000000000000000000000000000000A0B0C0D0E0" - assembler: # PUSH6 OP - title: "PUSH6" + assembler: # Push6 OP + title: "Push6" code: - PUSH6 "0xA0B0C0D0E0F0" + Push6 "0xA0B0C0D0E0F0" stack: "0x0000000000000000000000000000000000000000000000000000A0B0C0D0E0F0" - assembler: # PUSH7 OP - title: "PUSH7" + assembler: # Push7 OP + title: "Push7" code: - PUSH7 "0xA0B0C0D0E0F0A1" + Push7 "0xA0B0C0D0E0F0A1" stack: "0x00000000000000000000000000000000000000000000000000A0B0C0D0E0F0A1" - assembler: # PUSH8 OP - title: "PUSH8" + assembler: # Push8 OP + title: "Push8" code: - PUSH8 "0xA0B0C0D0E0F0A1B1" + Push8 "0xA0B0C0D0E0F0A1B1" stack: "0x000000000000000000000000000000000000000000000000A0B0C0D0E0F0A1B1" - assembler: # PUSH9 OP - title: "PUSH9" + assembler: # Push9 OP + title: "Push9" code: - PUSH9 "0xA0B0C0D0E0F0A1B1C1" + Push9 "0xA0B0C0D0E0F0A1B1C1" stack: "0x0000000000000000000000000000000000000000000000A0B0C0D0E0F0A1B1C1" - assembler: # PUSH10 OP - title: "PUSH10" + assembler: # Push10 OP + title: "Push10" code: - PUSH10 "0xA0B0C0D0E0F0A1B1C1D1" + Push10 "0xA0B0C0D0E0F0A1B1C1D1" stack: "0x00000000000000000000000000000000000000000000A0B0C0D0E0F0A1B1C1D1" - assembler: # PUSH11 OP - title: "PUSH11" + assembler: # Push11 OP + title: "Push11" code: - PUSH11 "0xA0B0C0D0E0F0A1B1C1D1E1" + Push11 "0xA0B0C0D0E0F0A1B1C1D1E1" stack: "0x000000000000000000000000000000000000000000A0B0C0D0E0F0A1B1C1D1E1" - assembler: # PUSH12 OP - title: "PUSH12" + assembler: # Push12 OP + title: "Push12" code: - PUSH12 "0xA0B0C0D0E0F0A1B1C1D1E1F1" + Push12 "0xA0B0C0D0E0F0A1B1C1D1E1F1" stack: "0x0000000000000000000000000000000000000000A0B0C0D0E0F0A1B1C1D1E1F1" - assembler: # PUSH13 OP - title: "PUSH13" + assembler: # Push13 OP + title: "Push13" code: - PUSH13 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2" + Push13 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2" stack: "0x00000000000000000000000000000000000000A0B0C0D0E0F0A1B1C1D1E1F1A2" - assembler: # PUSH14 OP - title: "PUSH14" + assembler: # Push14 OP + title: "Push14" code: - PUSH14 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2" + Push14 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2" stack: "0x000000000000000000000000000000000000A0B0C0D0E0F0A1B1C1D1E1F1A2B2" - assembler: # PUSH15 OP - title: "PUSH15" + assembler: # Push15 OP + title: "Push15" code: - PUSH15 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2" + Push15 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2" stack: "0x0000000000000000000000000000000000A0B0C0D0E0F0A1B1C1D1E1F1A2B2C2" - assembler: # PUSH16 OP - title: "PUSH16" + assembler: # Push16 OP + title: "Push16" code: - PUSH16 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2" + Push16 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2" stack: "0x00000000000000000000000000000000A0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2" - assembler: # PUSH17 OP - title: "PUSH17" + assembler: # Push17 OP + title: "Push17" code: - PUSH17 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2" + Push17 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2" stack: "0x000000000000000000000000000000A0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2" - assembler: # PUSH18 OP - title: "PUSH18" + assembler: # Push18 OP + title: "Push18" code: - PUSH18 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2" + Push18 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2" stack: "0x0000000000000000000000000000A0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2" - assembler: # PUSH19 OP - title: "PUSH19" + assembler: # Push19 OP + title: "Push19" code: - PUSH19 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3" + Push19 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3" stack: "0x00000000000000000000000000A0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3" - assembler: # PUSH20 OP - title: "PUSH20" + assembler: # Push20 OP + title: "Push20" code: - PUSH20 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3" + Push20 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3" stack: "0x000000000000000000000000A0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3" - assembler: # PUSH21 OP - title: "PUSH21" + assembler: # Push21 OP + title: "Push21" code: - PUSH21 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3" + Push21 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3" stack: "0x0000000000000000000000A0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3" - assembler: # PUSH22 OP - title: "PUSH22" + assembler: # Push22 OP + title: "Push22" code: - PUSH22 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3" + Push22 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3" stack: "0x00000000000000000000A0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3" - assembler: # PUSH23 OP - title: "PUSH23" + assembler: # Push23 OP + title: "Push23" code: - PUSH23 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3" + Push23 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3" stack: "0x000000000000000000A0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3" - assembler: # PUSH24 OP - title: "PUSH24" + assembler: # Push24 OP + title: "Push24" code: - PUSH24 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3" + Push24 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3" stack: "0x0000000000000000A0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3" - assembler: # PUSH25 OP - title: "PUSH25" + assembler: # Push25 OP + title: "Push25" code: - PUSH25 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4" + Push25 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4" stack: "0x00000000000000A0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4" - assembler: # PUSH26 OP - title: "PUSH26" + assembler: # Push26 OP + title: "Push26" code: - PUSH26 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4" + Push26 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4" stack: "0x000000000000A0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4" - assembler: # PUSH27 OP - title: "PUSH27" + assembler: # Push27 OP + title: "Push27" code: - PUSH27 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4" + Push27 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4" stack: "0x0000000000A0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4" - assembler: # PUSH28 OP - title: "PUSH28" + assembler: # Push28 OP + title: "Push28" code: - PUSH28 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4" + Push28 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4" stack: "0x00000000A0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4" - assembler: # PUSH29 OP - title: "PUSH29" + assembler: # Push29 OP + title: "Push29" code: - PUSH29 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4E4" + Push29 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4E4" stack: "0x000000A0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4E4" - assembler: # PUSH30 OP - title: "PUSH30" + assembler: # Push30 OP + title: "Push30" code: - PUSH30 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4E4F4" + Push30 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4E4F4" stack: "0x0000A0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4E4F4" - assembler: # PUSH31 OP - title: "PUSH31" + assembler: # Push31 OP + title: "Push31" code: - PUSH31 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4E4F4A1" + Push31 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4E4F4A1" stack: "0x00A0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4E4F4A1" - assembler: # PUSH32 OP - title: "PUSH32" + assembler: # Push32 OP + title: "Push32" code: - PUSH32 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4E4F4A1B1" + Push32 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4E4F4A1B1" stack: "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4E4F4A1B1" # macro assembler prevented this - #assembler: # PUSHN OP not enough data - # title: "PUSHN_1" + #assembler: # PushN OP not enough data + # title: "PushN_1" # code: - # PUSH2 "0xAA" + # Push2 "0xAA" # stack: "0x000000000000000000000000000000000000000000000000000000000000AA00" # success: false # - #assembler: # PUSHN OP not enough data - # title: "PUSHN_2" + #assembler: # PushN OP not enough data + # title: "PushN_2" # code: - # PUSH32 "0xAABB" + # Push32 "0xAABB" # stack: "0xAABB000000000000000000000000000000000000000000000000000000000000" # success: false - assembler: # POP OP - title: "POP_1" + assembler: # Pop OP + title: "Pop_1" code: - PUSH2 "0x0000" - PUSH1 "0x01" - PUSH3 "0x000002" - POP + Push2 "0x0000" + Push1 "0x01" + Push3 "0x000002" + Pop stack: "0x0000000000000000000000000000000000000000000000000000000000000000" "0x0000000000000000000000000000000000000000000000000000000000000001" - assembler: # POP OP - title: "POP_2" + assembler: # Pop OP + title: "Pop_2" code: - PUSH2 "0x0000" - PUSH1 "0x01" - PUSH3 "0x000002" - POP - POP + Push2 "0x0000" + Push1 "0x01" + Push3 "0x000002" + Pop + Pop stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler:# POP OP mal data - title: "POP_3" + assembler:# Pop OP mal data + title: "Pop_3" code: - PUSH2 "0x0000" - PUSH1 "0x01" - PUSH3 "0x000002" - POP - POP - POP - POP + Push2 "0x0000" + Push1 "0x01" + Push3 "0x000002" + Pop + Pop + Pop + Pop success: false macro generateDUPS(): untyped = @@ -262,7 +262,7 @@ proc opMemoryMain*() = for i in 1 .. 16: let title = newStmtList(newLit("DUP_" & $i)) - let pushIdent = ident("PUSH1") + let pushIdent = ident("Push1") var body = newStmtList() var stack = newStmtList() @@ -296,7 +296,7 @@ proc opMemoryMain*() = assembler: # DUPN OP mal data title: "DUPN_2" code: - DUP1 + Dup1 success: false macro generateSWAPS(): untyped = @@ -304,7 +304,7 @@ proc opMemoryMain*() = for i in 1 .. 16: let title = newStmtList(newLit("SWAP_" & $i)) - let pushIdent = ident("PUSH1") + let pushIdent = ident("Push1") var body = newStmtList() var stack = newStmtList() @@ -343,52 +343,52 @@ proc opMemoryMain*() = assembler:# SWAPN OP mal data title: "SWAPN_2" code: - SWAP1 + Swap1 success: false - assembler: # MSTORE OP - title: "MSTORE_1" + assembler: # Mstore OP + title: "Mstore_1" code: - PUSH2 "0x1234" - PUSH1 "0x00" - MSTORE + Push2 "0x1234" + Push1 "0x00" + Mstore memory: "0x0000000000000000000000000000000000000000000000000000000000001234" - assembler: # MSTORE OP - title: "MSTORE_2" + assembler: # Mstore OP + title: "Mstore_2" code: - PUSH2 "0x1234" - PUSH1 "0x00" - MSTORE - PUSH2 "0x5566" - PUSH1 "0x20" - MSTORE + Push2 "0x1234" + Push1 "0x00" + Mstore + Push2 "0x5566" + Push1 "0x20" + Mstore memory: "0x0000000000000000000000000000000000000000000000000000000000001234" "0x0000000000000000000000000000000000000000000000000000000000005566" - assembler: # MSTORE OP - title: "MSTORE_3" + assembler: # Mstore OP + title: "Mstore_3" code: - PUSH2 "0x1234" - PUSH1 "0x00" - MSTORE - PUSH2 "0x5566" - PUSH1 "0x20" - MSTORE - PUSH2 "0x8888" - PUSH1 "0x00" - MSTORE + Push2 "0x1234" + Push1 "0x00" + Mstore + Push2 "0x5566" + Push1 "0x20" + Mstore + Push2 "0x8888" + Push1 "0x00" + Mstore memory: "0x0000000000000000000000000000000000000000000000000000000000008888" "0x0000000000000000000000000000000000000000000000000000000000005566" - assembler: # MSTORE OP - title: "MSTORE_4" + assembler: # Mstore OP + title: "Mstore_4" code: - PUSH2 "0x1234" - PUSH1 "0xA0" - MSTORE + Push2 "0x1234" + Push1 "0xA0" + Mstore memory: "0x0000000000000000000000000000000000000000000000000000000000000000" "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -397,169 +397,169 @@ proc opMemoryMain*() = "0x0000000000000000000000000000000000000000000000000000000000000000" "0x0000000000000000000000000000000000000000000000000000000000001234" - assembler: # MSTORE OP - title: "MSTORE_5" + assembler: # Mstore OP + title: "Mstore_5" code: - PUSH2 "0x1234" - MSTORE + Push2 "0x1234" + Mstore success: false stack: "0x1234" - assembler: # MLOAD OP - title: "MLOAD_1" + assembler: # Mload OP + title: "Mload_1" code: - PUSH1 "0x00" - MLOAD + Push1 "0x00" + Mload memory: "0x0000000000000000000000000000000000000000000000000000000000000000" stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # MLOAD OP - title: "MLOAD_2" + assembler: # Mload OP + title: "Mload_2" code: - PUSH1 "0x22" - MLOAD + Push1 "0x22" + Mload memory: "0x0000000000000000000000000000000000000000000000000000000000000000" "0x0000000000000000000000000000000000000000000000000000000000000000" "0x0000000000000000000000000000000000000000000000000000000000000000" stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # MLOAD OP - title: "MLOAD_3" + assembler: # Mload OP + title: "Mload_3" code: - PUSH1 "0x20" - MLOAD + Push1 "0x20" + Mload memory: "0x0000000000000000000000000000000000000000000000000000000000000000" "0x0000000000000000000000000000000000000000000000000000000000000000" stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # MLOAD OP - title: "MLOAD_4" + assembler: # Mload OP + title: "Mload_4" code: - PUSH2 "0x1234" - PUSH1 "0x20" - MSTORE - PUSH1 "0x20" - MLOAD + Push2 "0x1234" + Push1 "0x20" + Mstore + Push1 "0x20" + Mload memory: "0x0000000000000000000000000000000000000000000000000000000000000000" "0x0000000000000000000000000000000000000000000000000000000000001234" stack: "0x0000000000000000000000000000000000000000000000000000000000001234" - assembler: # MLOAD OP - title: "MLOAD_5" + assembler: # Mload OP + title: "Mload_5" code: - PUSH2 "0x1234" - PUSH1 "0x20" - MSTORE - PUSH1 "0x1F" - MLOAD + Push2 "0x1234" + Push1 "0x20" + Mstore + Push1 "0x1F" + Mload memory: "0x0000000000000000000000000000000000000000000000000000000000000000" "0x0000000000000000000000000000000000000000000000000000000000001234" stack: "0x0000000000000000000000000000000000000000000000000000000000000012" - assembler: # MLOAD OP mal data - title: "MLOAD_6" + assembler: # Mload OP mal data + title: "Mload_6" code: - MLOAD + Mload success: false - assembler: # MSTORE8 OP - title: "MSTORE8_1" + assembler: # Mstore8 OP + title: "Mstore8_1" code: - PUSH1 "0x11" - PUSH1 "0x00" - MSTORE8 + Push1 "0x11" + Push1 "0x00" + Mstore8 memory: "0x1100000000000000000000000000000000000000000000000000000000000000" - assembler: # MSTORE8 OP - title: "MSTORE8_2" + assembler: # Mstore8 OP + title: "Mstore8_2" code: - PUSH1 "0x22" - PUSH1 "0x01" - MSTORE8 + Push1 "0x22" + Push1 "0x01" + Mstore8 memory: "0x0022000000000000000000000000000000000000000000000000000000000000" - assembler: # MSTORE8 OP - title: "MSTORE8_3" + assembler: # Mstore8 OP + title: "Mstore8_3" code: - PUSH1 "0x22" - PUSH1 "0x21" - MSTORE8 + Push1 "0x22" + Push1 "0x21" + Mstore8 memory: "0x0000000000000000000000000000000000000000000000000000000000000000" "0x0022000000000000000000000000000000000000000000000000000000000000" - assembler: # MSTORE8 OP mal - title: "MSTORE8_4" + assembler: # Mstore8 OP mal + title: "Mstore8_4" code: - PUSH1 "0x22" - MSTORE8 + Push1 "0x22" + Mstore8 success: false stack: "0x22" - assembler: # SSTORE OP - title: "SSTORE_1" + assembler: # Sstore OP + title: "Sstore_1" code: - PUSH1 "0x22" - PUSH1 "0xAA" - SSTORE + Push1 "0x22" + Push1 "0xAA" + Sstore storage: "0xAA": "0x22" - assembler: # SSTORE OP - title: "SSTORE_2" + assembler: # Sstore OP + title: "Sstore_2" code: - PUSH1 "0x22" - PUSH1 "0xAA" - SSTORE - PUSH1 "0x22" - PUSH1 "0xBB" - SSTORE + Push1 "0x22" + Push1 "0xAA" + Sstore + Push1 "0x22" + Push1 "0xBB" + Sstore storage: "0xAA": "0x22" "0xBB": "0x22" - assembler: # SSTORE OP - title: "SSTORE_3" + assembler: # Sstore OP + title: "Sstore_3" code: - PUSH1 "0x22" - SSTORE + Push1 "0x22" + Sstore success: false stack: "0x22" - assembler: # SSTORE EIP1283 - title: "SSTORE_NET_1" + assembler: # Sstore EIP1283 + title: "Sstore_NET_1" code: "60006000556000600055" fork: Constantinople gasUsed: 412 - assembler: # SSTORE EIP1283 - title: "SSTORE_NET_2" + assembler: # Sstore EIP1283 + title: "Sstore_NET_2" code: "60006000556001600055" fork: Constantinople gasUsed: 20212 - assembler: # SSTORE EIP1283 - title: "SSTORE_NET_3" + assembler: # Sstore EIP1283 + title: "Sstore_NET_3" code: "60016000556000600055" fork: Constantinople gasUsed: 20212 - assembler: # SSTORE EIP1283 - title: "SSTORE_NET_4" + assembler: # Sstore EIP1283 + title: "Sstore_NET_4" code: "60016000556002600055" fork: Constantinople gasUsed: 20212 - assembler: # SSTORE EIP1283 - title: "SSTORE_NET_5" + assembler: # Sstore EIP1283 + title: "Sstore_NET_5" code: "60016000556001600055" fork: Constantinople gasUsed: 20212 -#[ + # Sets Storage row on "cow" address: # 0: 1 # private void setStorageToOne(VM vm) { @@ -569,128 +569,128 @@ proc opMemoryMain*() = # invoke.getRepository().commit() # invoke.setOrigRepository(invoke.getRepository()) - assembler: # SSTORE EIP1283 - title: "SSTORE_NET_6" + assembler: # Sstore EIP1283 + title: "Sstore_NET_6" code: "60006000556000600055" fork: Constantinople - gasUsed: 5212 - - assembler: # SSTORE EIP1283 - title: "SSTORE_NET_7" - code: "60006000556001600055" - fork: Constantinople - gasUsed: 5212 - - assembler: # SSTORE EIP1283 - title: "SSTORE_NET_8" - code: "60006000556002600055" - fork: Constantinople - gasUsed: 5212 - - assembler: # SSTORE EIP1283 - title: "SSTORE_NET_9" - code: "60026000556000600055" - fork: Constantinople - gasUsed: 5212 - - assembler: # SSTORE EIP1283 - title: "SSTORE_NET_10" - code: "60026000556003600055" - fork: Constantinople - gasUsed: 5212 - - assembler: # SSTORE EIP1283 - title: "SSTORE_NET_11" - code: "60026000556001600055" - fork: Constantinople - gasUsed: 5212 - - assembler: # SSTORE EIP1283 - title: "SSTORE_NET_12" - code: "60026000556002600055" - fork: Constantinople - gasUsed: 5212 - - assembler: # SSTORE EIP1283 - title: "SSTORE_NET_13" - code: "60016000556000600055" - fork: Constantinople - gasUsed: 5212 - - assembler: # SSTORE EIP1283 - title: "SSTORE_NET_14" - code: "60016000556002600055" - fork: Constantinople - gasUsed: 5212 - - assembler: # SSTORE EIP1283 - title: "SSTORE_NET_15" - code: "60016000556001600055" - fork: Constantinople gasUsed: 412 - assembler: # SSTORE EIP1283 - title: "SSTORE_NET_16" + assembler: # Sstore EIP1283 + title: "Sstore_NET_7" + code: "60006000556001600055" + fork: Constantinople + gasUsed: 20212 + + assembler: # Sstore EIP1283 + title: "Sstore_NET_8" + code: "60006000556002600055" + fork: Constantinople + gasUsed: 20212 + + assembler: # Sstore EIP1283 + title: "Sstore_NET_9" + code: "60026000556000600055" + fork: Constantinople + gasUsed: 20212 + + assembler: # Sstore EIP1283 + title: "Sstore_NET_10" + code: "60026000556003600055" + fork: Constantinople + gasUsed: 20212 + + assembler: # Sstore EIP1283 + title: "Sstore_NET_11" + code: "60026000556001600055" + fork: Constantinople + gasUsed: 20212 + + assembler: # Sstore EIP1283 + title: "Sstore_NET_12" + code: "60026000556002600055" + fork: Constantinople + gasUsed: 20212 + + assembler: # Sstore EIP1283 + title: "Sstore_NET_13" + code: "60016000556000600055" + fork: Constantinople + gasUsed: 20212 + + assembler: # Sstore EIP1283 + title: "Sstore_NET_14" + code: "60016000556002600055" + fork: Constantinople + gasUsed: 20212 + + assembler: # Sstore EIP1283 + title: "Sstore_NET_15" + code: "60016000556001600055" + fork: Constantinople + gasUsed: 20212 + + assembler: # Sstore EIP1283 + title: "Sstore_NET_16" code: "600160005560006000556001600055" fork: Constantinople gasUsed: 40218 - assembler: # SSTORE EIP1283 - title: "SSTORE_NET_17" + assembler: # Sstore EIP1283 + title: "Sstore_NET_17" code: "600060005560016000556000600055" fork: Constantinople - gasUsed: 10218 -]# - assembler: # SLOAD OP - title: "SLOAD_1" + gasUsed: 20418 + + assembler: # Sload OP + title: "Sload_1" code: - PUSH1 "0xAA" - SLOAD + Push1 "0xAA" + Sload stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # SLOAD OP - title: "SLOAD_2" + assembler: # Sload OP + title: "Sload_2" code: - PUSH1 "0x22" - PUSH1 "0xAA" - SSTORE - PUSH1 "0xAA" - SLOAD + Push1 "0x22" + Push1 "0xAA" + Sstore + Push1 "0xAA" + Sload stack: "0x0000000000000000000000000000000000000000000000000000000000000022" - assembler: # SLOAD OP - title: "SLOAD_3" + assembler: # Sload OP + title: "Sload_3" code: - PUSH1 "0x22" - PUSH1 "0xAA" - SSTORE - PUSH1 "0x33" - PUSH1 "0xCC" - SSTORE - PUSH1 "0xCC" - SLOAD + Push1 "0x22" + Push1 "0xAA" + Sstore + Push1 "0x33" + Push1 "0xCC" + Sstore + Push1 "0xCC" + Sload stack: "0x0000000000000000000000000000000000000000000000000000000000000033" - assembler: # SLOAD OP - title: "SLOAD_4" - code: SLOAD + assembler: # Sload OP + title: "Sload_4" + code: Sload success: false - assembler: # PC OP - title: "PC_1" - code: PC + assembler: # Pc OP + title: "Pc_1" + code: Pc stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # PC OP - title: "PC_2" + assembler: # Pc OP + title: "Pc_2" code: - PUSH1 "0x22" - PUSH1 "0xAA" - MSTORE - PUSH1 "0xAA" - SLOAD - PC + Push1 "0x22" + Push1 "0xAA" + Mstore + Push1 "0xAA" + Sload + Pc stack: "0x0000000000000000000000000000000000000000000000000000000000000000" "0x0000000000000000000000000000000000000000000000000000000000000008" @@ -703,121 +703,121 @@ proc opMemoryMain*() = "0x00" "0x0000000000000000002200000000000000000000000000000000000000000000" - assembler: # JUMP OP mal data - title: "JUMP_1" + assembler: # Jump OP mal data + title: "Jump_1" code: - PUSH1 "0xAA" - PUSH1 "0xBB" - PUSH1 "0x0E" - JUMP - PUSH1 "0xCC" - PUSH1 "0xDD" - PUSH1 "0xEE" - JUMPDEST - PUSH1 "0xFF" + Push1 "0xAA" + Push1 "0xBB" + Push1 "0x0E" + Jump + Push1 "0xCC" + Push1 "0xDD" + Push1 "0xEE" + JumpDest + Push1 "0xFF" stack: "0xaa" "0x00000000000000000000000000000000000000000000000000000000000000bb" success: false - assembler: # JUMP OP mal data - title: "JUMP_2" + assembler: # Jump OP mal data + title: "Jump_2" code: - PUSH1 "0x0C" - PUSH1 "0x0C" - SWAP1 - JUMP - PUSH1 "0xCC" - PUSH1 "0xDD" - PUSH1 "0xEE" - PUSH1 "0xFF" + Push1 "0x0C" + Push1 "0x0C" + Swap1 + Jump + Push1 "0xCC" + Push1 "0xDD" + Push1 "0xEE" + Push1 "0xFF" success: false stack : "0x0C" - assembler: # JUMPI OP - title: "JUMPI_1" + assembler: # JumpI OP + title: "JumpI_1" code: - PUSH1 "0x01" - PUSH1 "0x05" - JUMPI - JUMPDEST - PUSH1 "0xCC" + Push1 "0x01" + Push1 "0x05" + JumpI + JumpDest + Push1 "0xCC" stack: "0x00000000000000000000000000000000000000000000000000000000000000CC" - assembler: # JUMPI OP - title: "JUMPI_2" + assembler: # JumpI OP + title: "JumpI_2" code: - PUSH4 "0x00000000" - PUSH1 "0x44" - JUMPI - PUSH1 "0xCC" - PUSH1 "0xDD" + Push4 "0x00000000" + Push1 "0x44" + JumpI + Push1 "0xCC" + Push1 "0xDD" stack: "0x00000000000000000000000000000000000000000000000000000000000000CC" "0x00000000000000000000000000000000000000000000000000000000000000DD" - assembler: # JUMPI OP mal - title: "JUMPI_3" + assembler: # JumpI OP mal + title: "JumpI_3" code: - PUSH1 "0x01" - JUMPI + Push1 "0x01" + JumpI success: false stack: "0x01" - assembler: # JUMPI OP mal - title: "JUMPI_4" + assembler: # JumpI OP mal + title: "JumpI_4" code: - PUSH1 "0x01" - PUSH1 "0x22" - SWAP1 - SWAP1 - JUMPI + Push1 "0x01" + Push1 "0x22" + Swap1 + Swap1 + JumpI success: false - assembler: # JUMP OP mal data - title: "JUMPDEST_1" + assembler: # Jump OP mal data + title: "JumpDest_1" code: - PUSH1 "0x23" - PUSH1 "0x08" - JUMP - PUSH1 "0x01" - JUMPDEST - PUSH1 "0x02" - SSTORE + Push1 "0x23" + Push1 "0x08" + Jump + Push1 "0x01" + JumpDest + Push1 "0x02" + Sstore storage: "0x02": "0x00" stack: "0x23" success: false # success or not? - assembler: # JUMPDEST OP for JUMPI - title: "JUMPDEST_2" + assembler: # JumpDest OP for JumpI + title: "JumpDest_2" code: - PUSH1 "0x23" - PUSH1 "0x01" - PUSH1 "0x09" - JUMPI - PUSH1 "0x01" - JUMPDEST - PUSH1 "0x02" - SSTORE + Push1 "0x23" + Push1 "0x01" + Push1 "0x09" + JumpI + Push1 "0x01" + JumpDest + Push1 "0x02" + Sstore #success: false storage: "0x02": "0x23" - assembler: # MSIZE OP - title: "MSIZE_1" + assembler: # Msize OP + title: "Msize_1" code: - MSIZE + Msize stack: "0x0000000000000000000000000000000000000000000000000000000000000000" - assembler: # MSIZE OP - title: "MSIZE_2" + assembler: # Msize OP + title: "Msize_2" code: - PUSH1 "0x20" - PUSH1 "0x30" - MSTORE - MSIZE + Push1 "0x20" + Push1 "0x30" + Mstore + Msize stack: "0x60" memory: @@ -826,132 +826,132 @@ proc opMemoryMain*() = "0x0000000000000000000000000000002000000000000000000000000000000000" assembler: - title: "MCOPY 1" + title: "Mcopy 1" code: - PUSH32 "0x0000000000000000000000000000000000000000000000000000000000000000" - PUSH1 "0x00" - MSTORE - PUSH32 "0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f" - PUSH1 "0x20" - MSTORE - PUSH1 "0x20" # len - PUSH1 "0x20" # src - PUSH1 "0x00" # dst - MCOPY + Push32 "0x0000000000000000000000000000000000000000000000000000000000000000" + Push1 "0x00" + Mstore + Push32 "0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f" + Push1 "0x20" + Mstore + Push1 "0x20" # len + Push1 "0x20" # src + Push1 "0x00" # dst + Mcopy memory: "0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f" "0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f" fork: Cancun assembler: - title: "MCOPY 2: Overlap" + title: "Mcopy 2: Overlap" code: - PUSH32 "0x0101010101010101010101010101010101010101010101010101010101010101" - PUSH1 "0x00" - MSTORE - PUSH1 "0x20" # len - PUSH1 "0x00" # src - PUSH1 "0x00" # dst - MCOPY + Push32 "0x0101010101010101010101010101010101010101010101010101010101010101" + Push1 "0x00" + Mstore + Push1 "0x20" # len + Push1 "0x00" # src + Push1 "0x00" # dst + Mcopy memory: "0x0101010101010101010101010101010101010101010101010101010101010101" fork: Cancun assembler: - title: "MCOPY 3" + title: "Mcopy 3" code: - PUSH1 "0x00" - PUSH1 "0x00" - MSTORE8 - PUSH1 "0x01" - PUSH1 "0x01" - MSTORE8 - PUSH1 "0x02" - PUSH1 "0x02" - MSTORE8 - PUSH1 "0x03" - PUSH1 "0x03" - MSTORE8 - PUSH1 "0x04" - PUSH1 "0x04" - MSTORE8 - PUSH1 "0x05" - PUSH1 "0x05" - MSTORE8 - PUSH1 "0x06" - PUSH1 "0x06" - MSTORE8 - PUSH1 "0x07" - PUSH1 "0x07" - MSTORE8 - PUSH1 "0x08" - PUSH1 "0x08" - MSTORE8 - PUSH1 "0x08" # len - PUSH1 "0x01" # src - PUSH1 "0x00" # dst - MCOPY + Push1 "0x00" + Push1 "0x00" + Mstore8 + Push1 "0x01" + Push1 "0x01" + Mstore8 + Push1 "0x02" + Push1 "0x02" + Mstore8 + Push1 "0x03" + Push1 "0x03" + Mstore8 + Push1 "0x04" + Push1 "0x04" + Mstore8 + Push1 "0x05" + Push1 "0x05" + Mstore8 + Push1 "0x06" + Push1 "0x06" + Mstore8 + Push1 "0x07" + Push1 "0x07" + Mstore8 + Push1 "0x08" + Push1 "0x08" + Mstore8 + Push1 "0x08" # len + Push1 "0x01" # src + Push1 "0x00" # dst + Mcopy memory: "0x0102030405060708080000000000000000000000000000000000000000000000" fork: Cancun assembler: - title: "MCOPY 4" + title: "Mcopy 4" code: - PUSH1 "0x00" - PUSH1 "0x00" - MSTORE8 - PUSH1 "0x01" - PUSH1 "0x01" - MSTORE8 - PUSH1 "0x02" - PUSH1 "0x02" - MSTORE8 - PUSH1 "0x03" - PUSH1 "0x03" - MSTORE8 - PUSH1 "0x04" - PUSH1 "0x04" - MSTORE8 - PUSH1 "0x05" - PUSH1 "0x05" - MSTORE8 - PUSH1 "0x06" - PUSH1 "0x06" - MSTORE8 - PUSH1 "0x07" - PUSH1 "0x07" - MSTORE8 - PUSH1 "0x08" - PUSH1 "0x08" - MSTORE8 - PUSH1 "0x08" # len - PUSH1 "0x00" # src - PUSH1 "0x01" # dst - MCOPY + Push1 "0x00" + Push1 "0x00" + Mstore8 + Push1 "0x01" + Push1 "0x01" + Mstore8 + Push1 "0x02" + Push1 "0x02" + Mstore8 + Push1 "0x03" + Push1 "0x03" + Mstore8 + Push1 "0x04" + Push1 "0x04" + Mstore8 + Push1 "0x05" + Push1 "0x05" + Mstore8 + Push1 "0x06" + Push1 "0x06" + Mstore8 + Push1 "0x07" + Push1 "0x07" + Mstore8 + Push1 "0x08" + Push1 "0x08" + Mstore8 + Push1 "0x08" # len + Push1 "0x00" # src + Push1 "0x01" # dst + Mcopy memory: "0x0000010203040506070000000000000000000000000000000000000000000000" fork: Cancun assembler: - title: "TSTORE/TLOAD" + title: "Tstore/Tload" code: - PUSH1 "0xAA" - PUSH1 "0xBB" - TSTORE - PUSH1 "0xBB" - TLOAD + Push1 "0xAA" + Push1 "0xBB" + Tstore + Push1 "0xBB" + Tload stack: "0x00000000000000000000000000000000000000000000000000000000000000AA" fork: Cancun assembler: - title: "TLOAD stack underflow not crash" + title: "Tload stack underflow not crash" code: - PUSH1 "0xAA" - PUSH1 "0xBB" - TSTORE - TLOAD + Push1 "0xAA" + Push1 "0xBB" + Tstore + Tload success: false fork: Cancun diff --git a/tests/test_op_misc.nim b/tests/test_op_misc.nim index 0d81cde8a..389df4f6b 100644 --- a/tests/test_op_misc.nim +++ b/tests/test_op_misc.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2019-2023 Status Research & Development GmbH +# Copyright (c) 2019-2024 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or # http://www.apache.org/licenses/LICENSE-2.0) @@ -15,15 +15,15 @@ import proc opMiscMain*() = suite "Misc Opcodes": - assembler: # LOG0 OP + assembler: # Log0 OP title: "Log0" code: - PUSH2 "0x1234" - PUSH1 "0x00" - MSTORE - PUSH1 "0x20" - PUSH1 "0x00" - LOG0 + Push2 "0x1234" + Push1 "0x00" + Mstore + Push1 "0x20" + Push1 "0x00" + Log0 memory: "0x1234" logs: @@ -32,16 +32,16 @@ proc opMiscMain*() = data: "0x0000000000000000000000000000000000000000000000000000000000001234" ) - assembler: # LOG1 OP + assembler: # Log1 OP title: "Log1" code: - PUSH2 "0x1234" - PUSH1 "0x00" - MSTORE - PUSH2 "0x9999" - PUSH1 "0x20" - PUSH1 "0x00" - LOG1 + Push2 "0x1234" + Push1 "0x00" + Mstore + Push2 "0x9999" + Push1 "0x20" + Push1 "0x00" + Log1 memory: "0x1234" logs: @@ -51,17 +51,17 @@ proc opMiscMain*() = data: "0x0000000000000000000000000000000000000000000000000000000000001234" ) - assembler: # LOG2 OP + assembler: # Log2 OP title: "Log2" code: - PUSH2 "0x1234" - PUSH1 "0x00" - MSTORE - PUSH2 "0x9999" - PUSH2 "0x6666" - PUSH1 "0x20" - PUSH1 "0x00" - LOG2 + Push2 "0x1234" + Push1 "0x00" + Mstore + Push2 "0x9999" + Push2 "0x6666" + Push1 "0x20" + Push1 "0x00" + Log2 memory: "0x1234" logs: @@ -71,18 +71,18 @@ proc opMiscMain*() = data: "0x0000000000000000000000000000000000000000000000000000000000001234" ) - assembler: # LOG3 OP + assembler: # Log3 OP title: "Log3" code: - PUSH2 "0x1234" - PUSH1 "0x00" - MSTORE - PUSH2 "0x9999" - PUSH2 "0x6666" - PUSH2 "0x3333" - PUSH1 "0x20" - PUSH1 "0x00" - LOG3 + Push2 "0x1234" + Push1 "0x00" + Mstore + Push2 "0x9999" + Push2 "0x6666" + Push2 "0x3333" + Push1 "0x20" + Push1 "0x00" + Log3 memory: "0x1234" logs: @@ -92,19 +92,19 @@ proc opMiscMain*() = data: "0x0000000000000000000000000000000000000000000000000000000000001234" ) - assembler: # LOG4 OP + assembler: # Log4 OP title: "Log4" code: - PUSH2 "0x1234" - PUSH1 "0x00" - MSTORE - PUSH2 "0x9999" - PUSH2 "0x6666" - PUSH2 "0x3333" - PUSH2 "0x5555" - PUSH1 "0x20" - PUSH1 "0x00" - LOG4 + Push2 "0x1234" + Push1 "0x00" + Mstore + Push2 "0x9999" + Push2 "0x6666" + Push2 "0x3333" + Push2 "0x5555" + Push1 "0x20" + Push1 "0x00" + Log4 memory: "0x1234" logs: @@ -114,16 +114,16 @@ proc opMiscMain*() = data: "0x0000000000000000000000000000000000000000000000000000000000001234" ) - assembler: # STOP OP - title: "STOP_1" + assembler: # Stop OP + title: "Stop_1" code: - PUSH1 "0x20" - PUSH1 "0x30" - PUSH1 "0x10" - PUSH1 "0x30" - PUSH1 "0x11" - PUSH1 "0x23" - STOP + Push1 "0x20" + Push1 "0x30" + Push1 "0x10" + Push1 "0x30" + Push1 "0x11" + Push1 "0x23" + Stop stack: "0x20" "0x30" @@ -132,53 +132,53 @@ proc opMiscMain*() = "0x11" "0x23" - assembler: # RETURN OP - title: "RETURN_1" + assembler: # Return OP + title: "Return_1" code: - PUSH2 "0x1234" - PUSH1 "0x00" - MSTORE - PUSH1 "0x20" - PUSH1 "0x00" - RETURN + Push2 "0x1234" + Push1 "0x00" + Mstore + Push1 "0x20" + Push1 "0x00" + Return memory: "0x1234" output: "0x0000000000000000000000000000000000000000000000000000000000001234" - assembler: # RETURN OP - title: "RETURN_2" + assembler: # Return OP + title: "Return_2" code: - PUSH2 "0x1234" - PUSH1 "0x00" - MSTORE - PUSH1 "0x20" - PUSH1 "0x1F" - RETURN + Push2 "0x1234" + Push1 "0x00" + Mstore + Push1 "0x20" + Push1 "0x1F" + Return memory: "0x1234" "0x00" output: "0x3400000000000000000000000000000000000000000000000000000000000000" - assembler: # RETURN OP - title: "RETURN_3" + assembler: # Return OP + title: "Return_3" code: - PUSH32 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4E4F4A1B1" - PUSH1 "0x00" - MSTORE - PUSH1 "0x20" - PUSH1 "0x00" - RETURN + Push32 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4E4F4A1B1" + Push1 "0x00" + Mstore + Push1 "0x20" + Push1 "0x00" + Return memory: "0xa0b0c0d0e0f0a1b1c1d1e1f1a2b2c2d2e2f2a3b3c3d3e3f3a4b4c4d4e4f4a1b1" output: "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4E4F4A1B1" - assembler: # RETURN OP - title: "RETURN_4" + assembler: # Return OP + title: "Return_4" code: - PUSH32 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4E4F4A1B1" - PUSH1 "0x00" - MSTORE - PUSH1 "0x20" - PUSH1 "0x10" - RETURN + Push32 "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4E4F4A1B1" + Push1 "0x00" + Mstore + Push1 "0x20" + Push1 "0x10" + Return output: "0xE2F2A3B3C3D3E3F3A4B4C4D4E4F4A1B100000000000000000000000000000000" memory: "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4E4F4A1B1" @@ -189,48 +189,48 @@ proc opMiscMain*() = assembler: title: "Simple routine" code: - PUSH1 "0x04" + Push1 "0x04" JUMPSUB - STOP + Stop BEGINSUB - RETURNSUB + ReturnSUB gasUsed: 18 fork: berlin assembler: title: "Two levels of subroutines" code: - PUSH9 "0x00000000000000000C" + Push9 "0x00000000000000000C" JUMPSUB - STOP + Stop BEGINSUB - PUSH1 "0x11" + Push1 "0x11" JUMPSUB - RETURNSUB + ReturnSUB BEGINSUB - RETURNSUB + ReturnSUB gasUsed: 36 fork: berlin assembler: title: "Failure 1: invalid jump" code: - PUSH9 "0x01000000000000000C" + Push9 "0x01000000000000000C" JUMPSUB - STOP + Stop BEGINSUB - PUSH1 "0x11" + Push1 "0x11" JUMPSUB - RETURNSUB + ReturnSUB BEGINSUB - RETURNSUB + ReturnSUB success: false fork: berlin assembler: title: "Failure 2: shallow return stack" code: - RETURNSUB + ReturnSUB PC PC success: false @@ -239,12 +239,12 @@ proc opMiscMain*() = assembler: title: "Subroutine at end of code" code: - PUSH1 "0x05" + Push1 "0x05" JUMP BEGINSUB - RETURNSUB + ReturnSUB JUMPDEST - PUSH1 "0x03" + Push1 "0x03" JUMPSUB gasUsed: 30 fork: berlin @@ -253,30 +253,30 @@ proc opMiscMain*() = title: "Error on 'walk-into-subroutine'" code: BEGINSUB - RETURNSUB - STOP + ReturnSUB + Stop success: false fork: berlin assembler: title: "sol test" code: - PUSH1 "0x02" - PUSH1 "0x03" - PUSH1 "0x08" # jumpdest + Push1 "0x02" + Push1 "0x03" + Push1 "0x08" # jumpdest JUMPSUB - STOP + Stop # 0x08 BEGINSUB - PUSH1 "0x0D" # jumpdest + Push1 "0x0D" # jumpdest JUMPSUB - RETURNSUB + ReturnSUB # 0x0D BEGINSUB MUL - RETURNSUB + ReturnSUB gasUsed: 47 fork: berlin stack: diff --git a/tests/test_sync_snap.nim b/tests/test_sync_snap.nim index f45ac9a79..0df478814 100644 --- a/tests/test_sync_snap.nim +++ b/tests/test_sync_snap.nim @@ -380,7 +380,7 @@ proc snapRunner(noisy = true; specs: SnapSyncSpecs) {.used.} = let tailInfo = specs.tailBlocks.splitPath.tail.replace(".txt.gz","") tailPath = specs.tailBlocks.findFilePath.value - allFile = "mainnet332160.txt.gz".findFilePath.value + # allFile = "mainnet332160.txt.gz".findFilePath.value pivot = specs.pivotBlock updateSize = specs.nItems diff --git a/tools/evmstate/evmstate.nim b/tools/evmstate/evmstate.nim index f26f743cb..c5da0804c 100644 --- a/tools/evmstate/evmstate.nim +++ b/tools/evmstate/evmstate.nim @@ -98,25 +98,27 @@ proc writeResultToStdout(stateRes: seq[StateResult]) = stdout.write(n.pretty) stdout.write("\n") -proc dumpAccounts(db: LedgerRef): Table[EthAddress, DumpAccount] = - for accAddr in db.addresses(): - let acc = DumpAccount( - balance : db.getBalance(accAddr), - nonce : db.getNonce(accAddr), - root : db.getStorageRoot(accAddr), - codeHash: db.getCodeHash(accAddr), - code : db.getCode(accAddr), - key : keccakHash(accAddr) - ) - for k, v in db.storage(accAddr): - acc.storage[k] = v - result[accAddr] = acc +when false: + proc dumpAccounts(db: LedgerRef): Table[EthAddress, DumpAccount] = + for accAddr in db.addresses(): + let acc = DumpAccount( + balance : db.getBalance(accAddr), + nonce : db.getNonce(accAddr), + root : db.getStorageRoot(accAddr), + codeHash: db.getCodeHash(accAddr), + code : db.getCode(accAddr), + key : keccakHash(accAddr) + ) + for k, v in db.storage(accAddr): + acc.storage[k] = v + result[accAddr] = acc -proc dumpState(vmState: BaseVMState): StateDump = - StateDump( - root: vmState.readOnlyStateDB.rootHash, - accounts: dumpAccounts(vmState.stateDB) - ) + + proc dumpState(vmState: BaseVMState): StateDump = + StateDump( + root: vmState.readOnlyStateDB.rootHash, + accounts: dumpAccounts(vmState.stateDB) + ) proc writeRootHashToStderr(vmState: BaseVMState) = let stateRoot = %{ diff --git a/tools/evmstate/evmstate_test.nim b/tools/evmstate/evmstate_test.nim index adedce7fe..0099c6969 100644 --- a/tools/evmstate/evmstate_test.nim +++ b/tools/evmstate/evmstate_test.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2022 Status Research & Development GmbH +# Copyright (c) 2022-2024 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or # http://www.apache.org/licenses/LICENSE-2.0) @@ -39,7 +39,7 @@ template skipTest(folder, name: untyped): bool = skipNewGSTTests(folder, name) proc collectFileNames(inputPath: string, map: var StatusMap, fileNames: var seq[TestFile]) = - for filename in walkDirRec(inputPath): + for fileName in walkDirRec(inputPath): if not fileName.endsWith(".json"): continue @@ -52,8 +52,8 @@ proc collectFileNames(inputPath: string, map: var StatusMap, fileNames: var seq[ continue fileNames.add TestFile( - fullPath: filename, - dispName: substr(filename, inputPath.len+1) + fullPath: fileName, + dispName: substr(fileName, inputPath.len+1) ) proc main() =