Remove EVM indirect imports and unused EVM errors (#2370)

Those indirect imports are used when there was two EVMs.
This commit is contained in:
andri lim 2024-06-17 14:56:39 +07:00 committed by GitHub
parent a949c3d78a
commit 61a809cf4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
61 changed files with 119 additions and 529 deletions

View File

@ -15,8 +15,8 @@ import
constants, constants,
db/ledger, db/ledger,
transaction, transaction,
vm_state, evm/state,
vm_types, evm/types,
core/dao, core/dao,
core/validate, core/validate,
core/chain/chain_desc, core/chain/chain_desc,

View File

@ -24,7 +24,7 @@ import
confutils/std/net confutils/std/net
], ],
eth/[common, net/utils, net/nat, p2p/bootnodes, p2p/enode, p2p/discoveryv5/enr], eth/[common, net/utils, net/nat, p2p/bootnodes, p2p/enode, p2p/discoveryv5/enr],
"."/[constants, vm_compile_info, version], "."/[constants, compile_info, version],
common/chain_config, common/chain_config,
db/opts db/opts

View File

@ -13,7 +13,7 @@
import import
../../common/common, ../../common/common,
../../utils/utils, ../../utils/utils,
../../vm_types ../../evm/types
export export
common common

View File

@ -13,8 +13,8 @@
import import
results, results,
../../db/ledger, ../../db/ledger,
../../vm_state, ../../evm/state,
../../vm_types, ../../evm/types,
../executor, ../executor,
../validate, ../validate,
./chain_desc, ./chain_desc,

View File

@ -11,8 +11,8 @@
import import
../../db/ledger, ../../db/ledger,
../../common/common, ../../common/common,
../../vm_state, ../../evm/state,
../../vm_types ../../evm/types
{.push raises: [].} {.push raises: [].}

View File

@ -13,8 +13,8 @@
import import
../../common/common, ../../common/common,
../../db/ledger, ../../db/ledger,
../../vm_state, ../../evm/state,
../../vm_types, ../../evm/types,
eth/[bloom] eth/[bloom]
type type

View File

@ -14,8 +14,8 @@ import
../../constants, ../../constants,
../../db/ledger, ../../db/ledger,
../../transaction, ../../transaction,
../../vm_state, ../../evm/state,
../../vm_types, ../../evm/types,
../dao, ../dao,
./calculate_reward, ./calculate_reward,
./executor_helpers, ./executor_helpers,

View File

@ -18,8 +18,8 @@ import
../../transaction/call_evm, ../../transaction/call_evm,
../../transaction/call_common, ../../transaction/call_common,
../../transaction, ../../transaction,
../../vm_state, ../../evm/state,
../../vm_types, ../../evm/types,
../../constants, ../../constants,
../validate ../validate

View File

@ -20,8 +20,8 @@ import
../../constants, ../../constants,
../../db/ledger, ../../db/ledger,
../../utils/utils, ../../utils/utils,
../../vm_state, ../../evm/state,
../../vm_types, ../../evm/types,
../eip4844, ../eip4844,
../pow/difficulty, ../pow/difficulty,
../executor, ../executor,

View File

@ -14,8 +14,8 @@
import import
../../../common/common, ../../../common/common,
../../../vm_state, ../../../evm/state,
../../../vm_types, ../../../evm/types,
../../validate, ../../validate,
../../eip4844, ../../eip4844,
../tx_chain, ../tx_chain,

View File

@ -25,8 +25,8 @@ import
"../.."/[dao, executor, validate, eip4844, casper], "../.."/[dao, executor, validate, eip4844, casper],
../../../transaction/call_evm, ../../../transaction/call_evm,
../../../transaction, ../../../transaction,
../../../vm_state, ../../../evm/state,
../../../vm_types, ../../../evm/types,
".."/[tx_chain, tx_desc, tx_item, tx_tabs, tx_tabs/tx_status, tx_info], ".."/[tx_chain, tx_desc, tx_item, tx_tabs, tx_tabs/tx_status, tx_info],
"."/[tx_bucket, tx_classify] "."/[tx_bucket, tx_classify]

View File

@ -1,5 +1,5 @@
# Nimbus # Nimbus
# Copyright (c) 2018 Status Research & Development GmbH # Copyright (c) 2018-2024 Status Research & Development GmbH
# Licensed under either of # Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) # * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
@ -12,65 +12,11 @@ type
BlockNotFound* = object of EVMError BlockNotFound* = object of EVMError
## The block with the given number/hash does not exist. ## The block with the given number/hash does not exist.
ParentNotFound* = object of EVMError
## The parent of a given block does not exist.
CanonicalHeadNotFound* = object of EVMError CanonicalHeadNotFound* = object of EVMError
## The chain has no canonical head. ## The chain has no canonical head.
ValidationError* = object of EVMError ValidationError* = object of EVMError
## Error to signal something does not pass a validation check. ## Error to signal something does not pass a validation check.
VMError* = object of EVMError
## Class of errors which can be raised during VM execution.
OutOfGas* = object of VMError
## Error signaling that VM execution has run out of gas.
InsufficientStack* = object of VMError
## Error signaling that the stack is empty.
FullStack* = object of VMError
## Error signaling that the stack is full.
InvalidJumpDestination* = object of VMError
## Error signaling that the jump destination for a JUMPDEST operation is invalid.
InvalidInstruction* = object of VMError
## Error signaling that an opcode is invalid.
InsufficientFunds* = object of VMError
## Error signaling that an account has insufficient funds to transfer the
## requested value.
StackDepthError* = object of VMError
## Error signaling that the call stack has exceeded it's maximum allowed depth.
ContractCreationCollision* = object of VMError
## Error signaling that there was an address collision during contract creation.
WriteProtection* = object of VMError
## Error raised if an attempt to modify the state database is made while
## operating inside of a STATICCALL context.
OutOfBoundsRead* = object of VMError
## Error raised to indicate an attempt was made to read data beyond the
## boundaries of the buffer (such as with RETURNDATACOPY)
TypeError* = object of VMError
## Error when invalid values are found
NotImplementedError* = object of VMError
## Not implemented error
StaticContextError* = object of VMError
## State changes not allowed in static call context
VmStateError* = object of VMError
## VM state error relay
InitcodeError* = object of EVMError
## Error to signal inicode size > EIP3860_MAX_INITCODE_SIZE
CoreDbApiError* = object of CatchableError CoreDbApiError* = object of CatchableError
## Errors related to `CoreDB` API ## Errors related to `CoreDB` API

View File

@ -1,5 +1,5 @@
# Nimbus # Nimbus
# Copyright (c) 2021-2024 Status Research & Development GmbH # Copyright (c) 2023-2024 Status Research & Development GmbH
# Licensed under either of # Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
# http://www.apache.org/licenses/LICENSE-2.0) # http://www.apache.org/licenses/LICENSE-2.0)
@ -9,10 +9,19 @@
# according to those terms. # according to those terms.
import import
evm/state_transactions as vmx ./interpreter/utils/utils_numeric,
./interpreter/gas_costs,
./interpreter/gas_meter,
./interpreter/op_codes,
./code_stream,
./stack,
./memory
export export
vmx.execComputation, utils_numeric,
vmx.execSysCall code_stream,
gas_costs,
# End gas_meter,
op_codes,
memory,
stack

View File

@ -18,7 +18,7 @@ import
../db/[ledger], ../db/[ledger],
../rpc/rpc_types, ../rpc/rpc_types,
../rpc/rpc_utils, ../rpc/rpc_utils,
".."/[transaction, vm_state, config, constants], ".."/[transaction, evm/state, config, constants],
../common/common, ../common/common,
../transaction/call_evm, ../transaction/call_evm,
../core/[tx_pool, tx_pool/tx_item], ../core/[tx_pool, tx_pool/tx_item],

View File

@ -8,7 +8,7 @@
# those terms. # those terms.
import import
../nimbus/vm_compile_info ../nimbus/compile_info
import import
std/[os, strutils, net], std/[os, strutils, net],

View File

@ -12,7 +12,7 @@ import
json_rpc/rpcserver, json_rpc/rpcserver,
./rpc_utils, ./rpc_utils,
./rpc_types, ./rpc_types,
../tracer, ../vm_types, ../tracer, ../evm/types,
../common/common, ../common/common,
../beacon/web3_eth_conv, ../beacon/web3_eth_conv,
../core/tx_pool, ../core/tx_pool,

View File

@ -11,17 +11,21 @@
import import
std/[typetraits], std/[typetraits],
json_rpc/rpcserver, stint, web3/conversions, json_rpc/rpcserver,
web3/conversions,
eth/p2p, eth/p2p,
../[transaction, vm_state, constants, vm_types], stint,
rpc_types, rpc_utils, ../core/executor/process_block,
../[transaction, constants],
../beacon/web3_eth_conv,
../stateless/multi_keys,
../evm/[state, types],
../common/common, ../common/common,
../utils/utils, ../utils/utils,
../beacon/web3_eth_conv,
./filters,
../core/executor/process_block,
../db/ledger, ../db/ledger,
../stateless/multi_keys, ./rpc_types,
./rpc_utils,
./filters,
./p2p ./p2p
type type

View File

@ -15,7 +15,7 @@ import
json_serialization, web3/conversions, json_serialization/stew/results, json_serialization, web3/conversions, json_serialization/stew/results,
eth/common/eth_types_json_serialization, eth/common/eth_types_json_serialization,
eth/[keys, rlp, p2p], eth/[keys, rlp, p2p],
".."/[transaction, vm_state, constants], ".."/[transaction, evm/state, constants],
../db/ledger, ../db/ledger,
./rpc_types, ./rpc_utils, ./oracle, ./rpc_types, ./rpc_utils, ./oracle,
../transaction/call_evm, ../transaction/call_evm,

View File

@ -13,7 +13,7 @@ import
chronicles, chronicles,
../common/common, ../common/common,
../transaction/call_common, ../transaction/call_common,
../vm_types, ../evm/types,
../beacon/web3_eth_conv, ../beacon/web3_eth_conv,
../evm/evm_errors, ../evm/evm_errors,
./rpc_types ./rpc_types

View File

@ -22,8 +22,8 @@ import
../transaction/call_evm, ../transaction/call_evm,
../core/eip4844, ../core/eip4844,
../beacon/web3_eth_conv, ../beacon/web3_eth_conv,
../vm_types, ../evm/types,
../vm_state, ../evm/state,
../evm/precompiles, ../evm/precompiles,
../evm/tracer/access_list_tracer, ../evm/tracer/access_list_tracer,
../evm/evm_errors ../evm/evm_errors

View File

@ -91,7 +91,7 @@ proc inPool(ctx: EthWireRef, txHash: Hash256): bool =
proc successorHeader(db: CoreDbRef, proc successorHeader(db: CoreDbRef,
h: BlockHeader, h: BlockHeader,
output: var BlockHeader, output: var BlockHeader,
skip = 0'u): bool {.gcsafe, raises: [RlpError].} = skip = 0'u): bool =
let offset = 1 + skip.BlockNumber let offset = 1 + skip.BlockNumber
if h.number <= (not 0.BlockNumber) - offset: if h.number <= (not 0.BlockNumber) - offset:
result = db.getBlockHeader(h.number + offset, output) result = db.getBlockHeader(h.number + offset, output)
@ -99,15 +99,14 @@ proc successorHeader(db: CoreDbRef,
proc ancestorHeader(db: CoreDbRef, proc ancestorHeader(db: CoreDbRef,
h: BlockHeader, h: BlockHeader,
output: var BlockHeader, output: var BlockHeader,
skip = 0'u): bool {.gcsafe, raises: [RlpError].} = skip = 0'u): bool =
let offset = 1 + skip.BlockNumber let offset = 1 + skip.BlockNumber
if h.number >= offset: if h.number >= offset:
result = db.getBlockHeader(h.number - offset, output) result = db.getBlockHeader(h.number - offset, output)
proc blockHeader(db: CoreDbRef, proc blockHeader(db: CoreDbRef,
b: HashOrNum, b: HashOrNum,
output: var BlockHeader): bool output: var BlockHeader): bool =
{.gcsafe, raises: [RlpError].} =
if b.isHash: if b.isHash:
db.getBlockHeader(b.hash, output) db.getBlockHeader(b.hash, output)
else: else:

View File

@ -14,7 +14,10 @@ import
./db/[core_db, ledger], ./db/[core_db, ledger],
./utils/utils, ./utils/utils,
./evm/tracer/legacy_tracer, ./evm/tracer/legacy_tracer,
"."/[constants, vm_state, vm_types, transaction, core/executor], ./constants,
./transaction,
./core/executor,
./evm/[state, types],
nimcrypto/utils as ncrutils, nimcrypto/utils as ncrutils,
web3/conversions, ./launcher, web3/conversions, ./launcher,
results, results,

View File

@ -7,7 +7,7 @@
import import
./constants, ./errors, eth/[common, keys], ./utils/utils, ./constants, ./errors, eth/[common, keys], ./utils/utils,
common/evmforks, ./vm_gas_costs common/evmforks, ./evm/internals
import eth/common/transaction as common_transaction import eth/common/transaction as common_transaction
export common_transaction, errors export common_transaction, errors

View File

@ -12,18 +12,20 @@ import
eth/common/eth_types, stint, stew/ptrops, eth/common/eth_types, stint, stew/ptrops,
chronos, chronos,
results, results,
".."/[vm_types, vm_state, vm_computation], ../evm/[types, state, state_transactions],
".."/[vm_internals, vm_precompiles, vm_gas_costs], ../evm/[precompiles, internals],
".."/[db/ledger], ../db/ledger,
../common/evmforks, ../common/evmforks,
../core/eip4844, ../core/eip4844,
./host_types ./host_types
import ../evm/computation except fromEvmc, toEvmc
when defined(evmc_enabled): when defined(evmc_enabled):
import ../utils/utils import ../utils/utils
import ./host_services import ./host_services
else: #else:
import ../vm_state_transactions #import ../evm/state_transactions
type type
# Standard call parameters. # Standard call parameters.

View File

@ -12,7 +12,7 @@ import
chronicles, chronicles,
chronos, chronos,
eth/common/eth_types_rlp, eth/common/eth_types_rlp,
".."/[vm_types, vm_state, vm_gas_costs], ../evm/[types, state, internals],
../db/ledger, ../db/ledger,
../common/common, ../common/common,
../evm/evm_errors, ../evm/evm_errors,

View File

@ -10,7 +10,7 @@
import import
./host_types, evmc/evmc, ./host_types, evmc/evmc,
".."/[vm_types, vm_computation, vm_state_transactions] ".."/[evm/types, evm/computation, evm/state_transactions]
proc evmcReleaseResult(result: var evmc_result) {.cdecl.} = proc evmcReleaseResult(result: var evmc_result) {.cdecl.} =
dealloc(result.output_data) dealloc(result.output_data)

View File

@ -12,10 +12,13 @@ import
eth/common/eth_types, eth/common/eth_types,
stew/ptrops, stew/ptrops,
stint, stint,
".."/[vm_types, vm_computation], ../evm/types,
../evm/interpreter_dispatch,
../utils/utils, ../utils/utils,
"."/[host_types, host_trace] "."/[host_types, host_trace]
import ../evm/computation except fromEvmc, toEvmc
proc evmcResultRelease(res: var EvmcResult) {.cdecl, gcsafe.} = proc evmcResultRelease(res: var EvmcResult) {.cdecl, gcsafe.} =
dealloc(res.output_data) dealloc(res.output_data)

View File

@ -13,10 +13,12 @@ import
stint, chronicles, stint, chronicles,
eth/common/eth_types, ../db/ledger, eth/common/eth_types, ../db/ledger,
../common/[evmforks, common], ../common/[evmforks, common],
".."/[vm_state, vm_computation, vm_internals, vm_gas_costs], ../evm/[state, internals],
./host_types, ./host_trace, ./host_call_nested, ./host_types, ./host_trace, ./host_call_nested,
stew/saturation_arith stew/saturation_arith
import ../evm/computation except fromEvmc, toEvmc
proc setupTxContext(host: TransactionHost) = proc setupTxContext(host: TransactionHost) =
# Conversion issues: # Conversion issues:
# #

View File

@ -1,13 +1,16 @@
# Nimbus - Types and helpers used at the boundary of transactions/RPC and EVMC/EVM # Nimbus - Types and helpers used at the boundary of transactions/RPC and EVMC/EVM
# #
# Copyright (c) 2019-2021 Status Research & Development GmbH # Copyright (c) 2019-2024 Status Research & Development GmbH
# Licensed under either of # Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) # * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except according to those terms. # at your option. This file may not be copied, modified, or distributed except according to those terms.
import import
sets, stint, evmc/evmc, eth/common/eth_types, ../vm_types std/sets,
stint, evmc/evmc,
eth/common/eth_types,
../evm/types
# Object `TransactionHost` represents "EVMC host" to the EVM. "Host services" # Object `TransactionHost` represents "EVMC host" to the EVM. "Host services"
# manage account state outside EVM such as balance transfers, storage, logs and # manage account state outside EVM such as balance transfers, storage, logs and

View File

@ -12,8 +12,8 @@ import
std/[options, json], std/[options, json],
../common/common, ../common/common,
stew/byteutils, stew/byteutils,
../vm_state, ../evm/state,
../vm_types, ../evm/types,
../db/ledger, ../db/ledger,
./utils, ./utils,
./state_dump ./state_dump

View File

@ -1,60 +0,0 @@
# Nimbus
# Copyright (c) 2018-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)
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or
# http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except
# according to those terms.
import
./evm/computation as vmc,
./evm/interpreter_dispatch as vmi
export
vmi.execCallOrCreate,
vmi.executeOpcodes
export
vmc.accountExists,
vmc.addLogEntry,
vmc.chainTo,
vmc.commit,
vmc.dispose,
vmc.execSelfDestruct,
vmc.fork,
vmc.getBalance,
vmc.getBlockHash,
vmc.getBlockNumber,
vmc.getChainId,
vmc.getCode,
vmc.getCodeHash,
vmc.getCodeSize,
vmc.getCoinbase,
vmc.getDifficulty,
vmc.getGasLimit,
vmc.getGasPrice,
vmc.getGasRefund,
vmc.getOrigin,
vmc.getStorage,
vmc.getTimestamp,
vmc.isError,
vmc.isSuccess,
vmc.merge,
vmc.newComputation,
vmc.prepareTracer,
vmc.refundSelfDestruct,
vmc.rollback,
vmc.selfDestruct,
vmc.setError,
vmc.shouldBurnGas,
vmc.snapshot,
vmc.traceError,
vmc.traceOpCodeEnded,
vmc.traceOpCodeStarted,
vmc.tracingEnabled,
vmc.writeContract,
vmc.evmcStatus,
vmc.errorOpt
# End

View File

@ -1,55 +0,0 @@
# Nimbus
# Copyright (c) 2018 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)
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or
# http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except
# according to those terms.
import
./evm/interpreter/gas_costs as vmg
export
vmg.Bls12381G1AddGas,
vmg.Bls12381G1MulGas,
vmg.Bls12381G2AddGas,
vmg.Bls12381G2MulGas,
vmg.Bls12381MapG1Gas,
vmg.Bls12381MapG2Gas,
vmg.Bls12381PairingBaseGas,
vmg.Bls12381PairingPerPairGas,
vmg.ColdAccountAccessCost,
vmg.ColdSloadCost,
vmg.GasCostKind,
vmg.GasCosts,
vmg.GasECAdd,
vmg.GasECAddIstanbul,
vmg.GasECMul,
vmg.GasECMulIstanbul,
vmg.GasECPairingBase,
vmg.GasECPairingBaseIstanbul,
vmg.GasECPairingPerPoint,
vmg.GasECPairingPerPointIstanbul,
vmg.GasECRecover,
vmg.GasFeeKind,
vmg.GasIdentity,
vmg.GasIdentityWord,
vmg.GasParams,
vmg.GasQuadDivisorEIP2565,
vmg.GasRIPEMD160,
vmg.GasRIPEMD160Word,
vmg.GasSHA256,
vmg.GasSHA256Word,
vmg.WarmStorageReadCost,
vmg.forkToSchedule,
vmg.gasFees,
vmg.ACCESS_LIST_STORAGE_KEY_COST,
vmg.ACCESS_LIST_ADDRESS_COST
when defined(evmc_enabled):
export
vmg.SstoreCost
# End

View File

@ -1,141 +0,0 @@
# Nimbus
# Copyright (c) 2018-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)
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or
# http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except
# according to those terms.
# At the moment, this header file interface is only used for testing.
import
./evm/memory as vmm
export
vmm.EvmMemoryRef,
vmm.extend,
vmm.len,
vmm.new,
vmm.read,
vmm.write
when defined(evmc_enabled):
export
vmm.readPtr
import
./evm/interpreter/utils/utils_numeric as vmn
export
vmn.GasNatural,
vmn.calcMemSize,
vmn.ceil32,
vmn.cleanMemRef,
vmn.log2,
vmn.log256,
vmn.rangeToPadded,
vmn.safeInt,
vmn.setSign,
vmn.toInt,
vmn.wordCount
# Wrapping the wrapper -- lol
import
./evm/code_stream as aCst,
./evm/computation as bChp,
./evm/interpreter_dispatch as cVmc,
./evm/interpreter/gas_meter as eGmt,
./evm/interpreter/op_codes as fVmo,
./evm/message as gVmg,
./evm/stack as hStk
export
aCst.CodeStream,
aCst.`$`,
aCst.`[]`,
aCst.atEnd,
aCst.decompile,
aCst.displayDecompiled,
aCst.hasSStore,
aCst.isValidOpcode,
aCst.items,
aCst.len,
aCst.newCodeStream,
aCst.newCodeStreamFromUnescaped,
aCst.next,
aCst.peek,
aCst.read,
aCst.readVmWord,
aCst.updatePc,
bChp.accountExists,
bChp.addLogEntry,
bChp.chainTo,
bChp.commit,
bChp.dispose,
bChp.fork,
bChp.getBalance,
bChp.getBlockHash,
bChp.getBlockNumber,
bChp.getChainId,
bChp.getCode,
bChp.getCodeHash,
bChp.getCodeSize,
bChp.getCoinbase,
bChp.getDifficulty,
bChp.getGasLimit,
bChp.getGasPrice,
bChp.getGasRefund,
bChp.getOrigin,
bChp.getStorage,
bChp.getTimestamp,
bChp.isError,
bChp.isSuccess,
bChp.merge,
bChp.newComputation,
bChp.prepareTracer,
bChp.refundSelfDestruct,
bChp.rollback,
bChp.selfDestruct,
bChp.setError,
bChp.shouldBurnGas,
bChp.snapshot,
bChp.traceError,
bChp.traceOpCodeEnded,
bChp.traceOpCodeStarted,
bChp.tracingEnabled,
bChp.writeContract,
cVmc.execCallOrCreate,
cVmc.executeOpcodes,
eGmt.consumeGas,
eGmt.init,
eGmt.refundGas,
eGmt.returnGas,
fVmo.Op,
fVmo.PrevRandao,
gVmg.isCreate,
hStk.EvmStackRef,
hStk.`[]`,
hStk.dup,
hStk.len,
hStk.new,
hStk.peek,
hStk.peekInt,
hStk.popAddress,
hStk.popInt,
hStk.popTopic,
hStk.push,
hStk.swap,
hStk.top,
hStk.items,
hStk.pairs
import
./evm/evm_errors
export
evm_errors
# End

View File

@ -1,19 +0,0 @@
# Nimbus
# Copyright (c) 2018-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)
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or
# http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except
# according to those terms.
import
./evm/precompiles as vmp
export
vmp.PrecompileAddresses,
vmp.activePrecompiles,
vmp.execPrecompiles
# End

View File

@ -1,49 +0,0 @@
# Nimbus
# 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)
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or
# http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except
# according to those terms.
import
./evm/state_transactions as vmx,
./evm/state as vms
export
vmx.setupTxContext
export
vms.`$`,
vms.blockNumber,
vms.coinbase,
vms.determineFork,
vms.difficultyOrPrevRandao,
vms.baseFeePerGas,
vms.forkDeterminationInfoForVMState,
vms.collectWitnessData,
vms.`collectWitnessData=`,
vms.getAncestorHash,
vms.getAndClearLogEntries,
vms.init,
vms.mutateStateDB,
vms.new,
vms.reinit,
vms.readOnlyStateDB,
vms.status,
vms.`status=`,
vms.tracingEnabled,
vms.captureTxStart,
vms.captureTxEnd,
vms.captureStart,
vms.captureEnd,
vms.captureEnter,
vms.captureExit,
vms.captureOpStart,
vms.captureGasCost,
vms.captureOpEnd,
vms.captureFault,
vms.capturePrepare
# End

View File

@ -1,57 +0,0 @@
# Nimbus
# Copyright (c) 2018-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)
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or
# http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except
# according to those terms.
{.used.}
import
./evm/types as vmt
export
vmt.BaseVMState,
vmt.CallKind,
vmt.Computation,
vmt.Error,
vmt.GasMeter,
vmt.Message,
vmt.MsgFlags,
vmt.TracerFlags,
vmt.TracerRef,
vmt.VMFlag,
vmt.BlockContext,
vmt.TxContext
when defined(evmc_enabled):
import
./evm/evmc_api as evmc
export
evmc.HostContext,
evmc.accountExists,
evmc.call,
evmc.copyCode,
evmc.emitLog,
evmc.getBalance,
evmc.getBlockHash,
evmc.getCodeHash,
evmc.getCodeSize,
evmc.getStorage,
evmc.getTxContext,
evmc.init,
evmc.nim_create_nimbus_vm,
evmc.nim_host_create_context,
evmc.nim_host_destroy_context,
evmc.nim_host_get_interface,
evmc.nimbus_host_interface,
evmc.nimbus_message,
evmc.nimbus_result,
evmc.nimbus_tx_context,
evmc.selfDestruct,
evmc.setStorage
# End

View File

@ -13,7 +13,7 @@ import
stew/byteutils, stew/byteutils,
chronicles, chronicles,
results, results,
../nimbus/[vm_state, vm_types], ../nimbus/[evm/state, evm/types],
../nimbus/core/executor, ../nimbus/core/executor,
./premixcore, ./prestate, ./premixcore, ./prestate,
../nimbus/tracer, ../nimbus/tracer,

View File

@ -19,7 +19,7 @@ import
../nimbus/db/opts, ../nimbus/db/opts,
../nimbus/db/core_db/persistent, ../nimbus/db/core_db/persistent,
../nimbus/core/executor, ../nimbus/core/executor,
../nimbus/[vm_state, vm_types], ../nimbus/[evm/state, evm/types],
../nimbus/tracer, ../nimbus/tracer,
./configuration # must be late (compilation annoyance) ./configuration # must be late (compilation annoyance)

View File

@ -12,7 +12,7 @@ import
std/[json, tables, hashes], std/[json, tables, hashes],
eth/trie/trie_defs, eth/trie/trie_defs,
stint, stew/byteutils, chronicles, stint, stew/byteutils, chronicles,
../nimbus/[vm_state, vm_types], ../nimbus/[evm/state, evm/types],
../nimbus/utils/utils, ../nimbus/utils/utils,
../nimbus/tracer, ../nimbus/tracer,
../nimbus/db/[core_db, state_db/read_write], ../nimbus/db/[core_db, state_db/read_write],

View File

@ -10,7 +10,7 @@
import import
chronicles, chronicles,
../nimbus/[vm_state, vm_types], ../nimbus/[evm/state, evm/types],
../nimbus/core/executor, ../nimbus/core/executor,
../nimbus/common/common, ../nimbus/common/common,
../nimbus/db/opts, ../nimbus/db/opts,

View File

@ -1,5 +1,5 @@
# Nimbus # Nimbus
# Copyright (c) 2018-2023 Status Research & Development GmbH # Copyright (c) 2018-2024 Status Research & Development GmbH
# Licensed under either of # Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) # * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
@ -8,7 +8,7 @@
import import
std/[times, macros, strutils, os, osproc, threadpool], std/[times, macros, strutils, os, osproc, threadpool],
unittest2, unittest2,
../nimbus/vm_compile_info, ../nimbus/compile_info,
../nimbus/utils/utils ../nimbus/utils/utils
export strutils, os, unittest2, osproc, threadpool export strutils, os, unittest2, osproc, threadpool

View File

@ -19,9 +19,9 @@ import
import import
../nimbus/db/ledger, ../nimbus/db/ledger,
../nimbus/evm/types, ../nimbus/evm/types,
../nimbus/vm_internals, ../nimbus/evm/internals,
../nimbus/transaction/[call_common, call_evm], ../nimbus/transaction/[call_common, call_evm],
../nimbus/[vm_types, vm_state], ../nimbus/evm/state,
../nimbus/core/pow/difficulty ../nimbus/core/pow/difficulty
from ../nimbus/db/aristo from ../nimbus/db/aristo

View File

@ -17,8 +17,8 @@ import
../nimbus/core/chain, ../nimbus/core/chain,
../nimbus/transaction, ../nimbus/transaction,
../nimbus/constants, ../nimbus/constants,
../nimbus/vm_state, ../nimbus/evm/state,
../nimbus/vm_types, ../nimbus/evm/types,
./replay/undump_blocks, ./replay/undump_blocks,
unittest2 unittest2

View File

@ -15,7 +15,7 @@ import
stew/byteutils, stew/byteutils,
./test_helpers, ./test_allowed_to_fail, ./test_helpers, ./test_allowed_to_fail,
../premix/parser, test_config, ../premix/parser, test_config,
../nimbus/[vm_state, vm_types, errors, constants], ../nimbus/[evm/state, evm/types, errors, constants],
../nimbus/db/ledger, ../nimbus/db/ledger,
../nimbus/utils/[utils, debug], ../nimbus/utils/[utils, debug],
../nimbus/evm/tracer/legacy_tracer, ../nimbus/evm/tracer/legacy_tracer,

View File

@ -1,12 +1,12 @@
# Nimbus # Nimbus
# Copyright (c) 2018-2023 Status Research & Development GmbH # Copyright (c) 2018-2024 Status Research & Development GmbH
# Licensed under either of # Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) # * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except according to those terms. # at your option. This file may not be copied, modified, or distributed except according to those terms.
import unittest2, sequtils, import unittest2, sequtils,
../nimbus/vm_internals ../nimbus/evm/internals
proc codeStreamMain*() = proc codeStreamMain*() =
suite "parse bytecode": suite "parse bytecode":

View File

@ -8,7 +8,7 @@
import import
unittest2, macros, strformat, unittest2, macros, strformat,
eth/common/eth_types, eth/common/eth_types,
../nimbus/[vm_types, vm_internals] ../nimbus/[evm/types, evm/internals, evm/evm_errors]
# TODO: quicktest # TODO: quicktest
# PS: parametrize can be easily immitated, but still quicktests would be even more useful # PS: parametrize can be easily immitated, but still quicktests would be even more useful

View File

@ -10,7 +10,7 @@ import
./test_helpers, ./test_allowed_to_fail, ./test_helpers, ./test_allowed_to_fail,
../nimbus/core/executor, test_config, ../nimbus/core/executor, test_config,
../nimbus/transaction, ../nimbus/transaction,
../nimbus/[vm_state, vm_types], ../nimbus/[evm/state, evm/types],
../nimbus/db/ledger, ../nimbus/db/ledger,
../nimbus/common/common, ../nimbus/common/common,
../nimbus/utils/[utils, debug], ../nimbus/utils/[utils, debug],

View File

@ -1,5 +1,5 @@
# Nimbus # Nimbus
# Copyright (c) 2019-2023 Status Research & Development GmbH # Copyright (c) 2019-2024 Status Research & Development GmbH
# Licensed under either of # Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
# http://www.apache.org/licenses/LICENSE-2.0) # http://www.apache.org/licenses/LICENSE-2.0)
@ -11,7 +11,7 @@
import import
unittest2, unittest2,
eth/common/eth_types, eth/common/eth_types,
../nimbus/vm_internals, ../nimbus/evm/internals,
../nimbus/core/pow/header ../nimbus/core/pow/header
func toAddress(n: int): EthAddress = func toAddress(n: int): EthAddress =

View File

@ -11,7 +11,7 @@
import import
macro_assembler, unittest2, macro_assembler, unittest2,
stew/byteutils, ../nimbus/common/common, stew/byteutils, ../nimbus/common/common,
../nimbus/[vm_state, constants], ../nimbus/[evm/state, constants],
../nimbus/db/ledger ../nimbus/db/ledger
proc opEnvMain*() = proc opEnvMain*() =

View File

@ -12,8 +12,8 @@ import eth/[keys, trie]
import stew/byteutils import stew/byteutils
import unittest2 import unittest2
import ../nimbus/common import ../nimbus/common
import ../nimbus/vm_state import ../nimbus/evm/state
import ../nimbus/vm_types import ../nimbus/evm/types
import ../nimbus/transaction import ../nimbus/transaction
import ../nimbus/transaction/call_evm import ../nimbus/transaction/call_evm
import ../nimbus/db/core_db import ../nimbus/db/core_db

View File

@ -10,11 +10,11 @@ import
unittest2, stew/byteutils, unittest2, stew/byteutils,
eth/[keys, trie], eth/[keys, trie],
../nimbus/common/common, ../nimbus/common/common,
../nimbus/[vm_computation, ../nimbus/[evm/computation,
vm_state, evm/state,
vm_types, evm/types,
constants, constants,
vm_precompiles {.all.}, evm/precompiles {.all.},
transaction, transaction,
transaction/call_evm transaction/call_evm
], ],

View File

@ -12,7 +12,7 @@ import
json_rpc/[rpcserver, rpcclient], json_rpc/[rpcserver, rpcclient],
nimcrypto/[keccak, hash], nimcrypto/[keccak, hash],
eth/[rlp, keys, trie/hexary_proof_verification], eth/[rlp, keys, trie/hexary_proof_verification],
../nimbus/[constants, transaction, config, vm_state, vm_types, version], ../nimbus/[constants, transaction, config, evm/state, evm/types, version],
../nimbus/db/[ledger, storage_types], ../nimbus/db/[ledger, storage_types],
../nimbus/sync/protocol, ../nimbus/sync/protocol,
../nimbus/core/[tx_pool, chain, executor, executor/executor_helpers, pow/difficulty], ../nimbus/core/[tx_pool, chain, executor, executor/executor_helpers, pow/difficulty],

View File

@ -19,7 +19,7 @@ import
../nimbus/db/aristo/aristo_merge, ../nimbus/db/aristo/aristo_merge,
../nimbus/db/kvt/kvt_utils, ../nimbus/db/kvt/kvt_utils,
../nimbus/db/aristo, ../nimbus/db/aristo,
../nimbus/[tracer, vm_types], ../nimbus/[tracer, evm/types],
../nimbus/common/common ../nimbus/common/common
proc setErrorLevel {.used.} = proc setErrorLevel {.used.} =

View File

@ -1,5 +1,5 @@
# Nimbus # Nimbus
# Copyright (c) 2019-2023 Status Research & Development GmbH # Copyright (c) 2019-2024 Status Research & Development GmbH
# Licensed under either of # Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
# http://www.apache.org/licenses/LICENSE-2.0) # http://www.apache.org/licenses/LICENSE-2.0)
@ -13,7 +13,7 @@ import
unittest2, unittest2,
eth/rlp, eth/rlp,
./test_helpers, ./test_helpers,
../nimbus/[errors, transaction, vm_types], ../nimbus/[errors, transaction, evm/types],
../nimbus/utils/utils ../nimbus/utils/utils
const const

View File

@ -13,7 +13,7 @@ import
../nimbus/core/chain, # must be early (compilation annoyance) ../nimbus/core/chain, # must be early (compilation annoyance)
../nimbus/common/common, ../nimbus/common/common,
../nimbus/core/[executor, casper, tx_pool, tx_pool/tx_item], ../nimbus/core/[executor, casper, tx_pool, tx_pool/tx_item],
../nimbus/[config, vm_state, vm_types], ../nimbus/[config, evm/state, evm/types],
./test_txpool/[helpers, setup, sign_helper], ./test_txpool/[helpers, setup, sign_helper],
chronos, chronos,
eth/[keys, p2p], eth/[keys, p2p],

View File

@ -19,7 +19,7 @@ import
../nimbus/core/casper, ../nimbus/core/casper,
../nimbus/common/common, ../nimbus/common/common,
../nimbus/utils/utils, ../nimbus/utils/utils,
../nimbus/vm_types, ../nimbus/evm/types,
./test_txpool/helpers, ./test_txpool/helpers,
./macro_assembler ./macro_assembler

View File

@ -14,7 +14,7 @@ import
../nimbus/common/common, # must be early (compilation annoyance) ../nimbus/common/common, # must be early (compilation annoyance)
../nimbus/db/opts, ../nimbus/db/opts,
../nimbus/db/core_db/persistent, ../nimbus/db/core_db/persistent,
../nimbus/[config, tracer, vm_types] ../nimbus/[config, tracer, evm/types]
proc dumpTest(com: CommonRef, blockNumber: BlockNumber) = proc dumpTest(com: CommonRef, blockNumber: BlockNumber) =
var var

View File

@ -10,7 +10,7 @@
import import
../../nimbus/common/common, ../../nimbus/common/common,
../../nimbus/[vm_state, vm_types], ../../nimbus/[evm/state, evm/types],
../../nimbus/db/ledger ../../nimbus/db/ledger
proc coinbaseStateClearing*(vmState: BaseVMState, proc coinbaseStateClearing*(vmState: BaseVMState,

View File

@ -16,7 +16,7 @@ import
results, results,
stint, stint,
eth/trie/[trie_defs], eth/trie/[trie_defs],
../../nimbus/[vm_types, vm_state], ../../nimbus/[evm/types, evm/state],
../../nimbus/db/ledger, ../../nimbus/db/ledger,
../../nimbus/transaction, ../../nimbus/transaction,
../../nimbus/core/executor, ../../nimbus/core/executor,

View File

@ -14,7 +14,7 @@ import
stint, results, stint, results,
"."/[config, types, helpers], "."/[config, types, helpers],
../common/state_clearing, ../common/state_clearing,
../../nimbus/[vm_types, vm_state, transaction], ../../nimbus/[evm/types, evm/state, transaction],
../../nimbus/common/common, ../../nimbus/common/common,
../../nimbus/db/ledger, ../../nimbus/db/ledger,
../../nimbus/utils/utils, ../../nimbus/utils/utils,