Remove EVM indirect imports and unused EVM errors (#2370)
Those indirect imports are used when there was two EVMs.
This commit is contained in:
parent
a949c3d78a
commit
61a809cf4d
|
@ -15,8 +15,8 @@ import
|
|||
constants,
|
||||
db/ledger,
|
||||
transaction,
|
||||
vm_state,
|
||||
vm_types,
|
||||
evm/state,
|
||||
evm/types,
|
||||
core/dao,
|
||||
core/validate,
|
||||
core/chain/chain_desc,
|
||||
|
|
|
@ -24,7 +24,7 @@ import
|
|||
confutils/std/net
|
||||
],
|
||||
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,
|
||||
db/opts
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
import
|
||||
../../common/common,
|
||||
../../utils/utils,
|
||||
../../vm_types
|
||||
../../evm/types
|
||||
|
||||
export
|
||||
common
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
import
|
||||
results,
|
||||
../../db/ledger,
|
||||
../../vm_state,
|
||||
../../vm_types,
|
||||
../../evm/state,
|
||||
../../evm/types,
|
||||
../executor,
|
||||
../validate,
|
||||
./chain_desc,
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
import
|
||||
../../db/ledger,
|
||||
../../common/common,
|
||||
../../vm_state,
|
||||
../../vm_types
|
||||
../../evm/state,
|
||||
../../evm/types
|
||||
|
||||
{.push raises: [].}
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
import
|
||||
../../common/common,
|
||||
../../db/ledger,
|
||||
../../vm_state,
|
||||
../../vm_types,
|
||||
../../evm/state,
|
||||
../../evm/types,
|
||||
eth/[bloom]
|
||||
|
||||
type
|
||||
|
|
|
@ -14,8 +14,8 @@ import
|
|||
../../constants,
|
||||
../../db/ledger,
|
||||
../../transaction,
|
||||
../../vm_state,
|
||||
../../vm_types,
|
||||
../../evm/state,
|
||||
../../evm/types,
|
||||
../dao,
|
||||
./calculate_reward,
|
||||
./executor_helpers,
|
||||
|
|
|
@ -18,8 +18,8 @@ import
|
|||
../../transaction/call_evm,
|
||||
../../transaction/call_common,
|
||||
../../transaction,
|
||||
../../vm_state,
|
||||
../../vm_types,
|
||||
../../evm/state,
|
||||
../../evm/types,
|
||||
../../constants,
|
||||
../validate
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ import
|
|||
../../constants,
|
||||
../../db/ledger,
|
||||
../../utils/utils,
|
||||
../../vm_state,
|
||||
../../vm_types,
|
||||
../../evm/state,
|
||||
../../evm/types,
|
||||
../eip4844,
|
||||
../pow/difficulty,
|
||||
../executor,
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
|
||||
import
|
||||
../../../common/common,
|
||||
../../../vm_state,
|
||||
../../../vm_types,
|
||||
../../../evm/state,
|
||||
../../../evm/types,
|
||||
../../validate,
|
||||
../../eip4844,
|
||||
../tx_chain,
|
||||
|
|
|
@ -25,8 +25,8 @@ import
|
|||
"../.."/[dao, executor, validate, eip4844, casper],
|
||||
../../../transaction/call_evm,
|
||||
../../../transaction,
|
||||
../../../vm_state,
|
||||
../../../vm_types,
|
||||
../../../evm/state,
|
||||
../../../evm/types,
|
||||
".."/[tx_chain, tx_desc, tx_item, tx_tabs, tx_tabs/tx_status, tx_info],
|
||||
"."/[tx_bucket, tx_classify]
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Nimbus
|
||||
# Copyright (c) 2018 Status Research & Development GmbH
|
||||
# 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)
|
||||
|
@ -12,65 +12,11 @@ type
|
|||
BlockNotFound* = object of EVMError
|
||||
## 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
|
||||
## The chain has no canonical head.
|
||||
|
||||
ValidationError* = object of EVMError
|
||||
## 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
|
||||
## Errors related to `CoreDB` API
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Nimbus
|
||||
# Copyright (c) 2021-2024 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)
|
||||
|
@ -9,10 +9,19 @@
|
|||
# according to those terms.
|
||||
|
||||
import
|
||||
evm/state_transactions as vmx
|
||||
./interpreter/utils/utils_numeric,
|
||||
./interpreter/gas_costs,
|
||||
./interpreter/gas_meter,
|
||||
./interpreter/op_codes,
|
||||
./code_stream,
|
||||
./stack,
|
||||
./memory
|
||||
|
||||
export
|
||||
vmx.execComputation,
|
||||
vmx.execSysCall
|
||||
|
||||
# End
|
||||
utils_numeric,
|
||||
code_stream,
|
||||
gas_costs,
|
||||
gas_meter,
|
||||
op_codes,
|
||||
memory,
|
||||
stack
|
|
@ -18,7 +18,7 @@ import
|
|||
../db/[ledger],
|
||||
../rpc/rpc_types,
|
||||
../rpc/rpc_utils,
|
||||
".."/[transaction, vm_state, config, constants],
|
||||
".."/[transaction, evm/state, config, constants],
|
||||
../common/common,
|
||||
../transaction/call_evm,
|
||||
../core/[tx_pool, tx_pool/tx_item],
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
# those terms.
|
||||
|
||||
import
|
||||
../nimbus/vm_compile_info
|
||||
../nimbus/compile_info
|
||||
|
||||
import
|
||||
std/[os, strutils, net],
|
||||
|
|
|
@ -12,7 +12,7 @@ import
|
|||
json_rpc/rpcserver,
|
||||
./rpc_utils,
|
||||
./rpc_types,
|
||||
../tracer, ../vm_types,
|
||||
../tracer, ../evm/types,
|
||||
../common/common,
|
||||
../beacon/web3_eth_conv,
|
||||
../core/tx_pool,
|
||||
|
|
|
@ -11,17 +11,21 @@
|
|||
|
||||
import
|
||||
std/[typetraits],
|
||||
json_rpc/rpcserver, stint, web3/conversions,
|
||||
json_rpc/rpcserver,
|
||||
web3/conversions,
|
||||
eth/p2p,
|
||||
../[transaction, vm_state, constants, vm_types],
|
||||
rpc_types, rpc_utils,
|
||||
stint,
|
||||
../core/executor/process_block,
|
||||
../[transaction, constants],
|
||||
../beacon/web3_eth_conv,
|
||||
../stateless/multi_keys,
|
||||
../evm/[state, types],
|
||||
../common/common,
|
||||
../utils/utils,
|
||||
../beacon/web3_eth_conv,
|
||||
./filters,
|
||||
../core/executor/process_block,
|
||||
../db/ledger,
|
||||
../stateless/multi_keys,
|
||||
./rpc_types,
|
||||
./rpc_utils,
|
||||
./filters,
|
||||
./p2p
|
||||
|
||||
type
|
||||
|
|
|
@ -15,7 +15,7 @@ import
|
|||
json_serialization, web3/conversions, json_serialization/stew/results,
|
||||
eth/common/eth_types_json_serialization,
|
||||
eth/[keys, rlp, p2p],
|
||||
".."/[transaction, vm_state, constants],
|
||||
".."/[transaction, evm/state, constants],
|
||||
../db/ledger,
|
||||
./rpc_types, ./rpc_utils, ./oracle,
|
||||
../transaction/call_evm,
|
||||
|
|
|
@ -13,7 +13,7 @@ import
|
|||
chronicles,
|
||||
../common/common,
|
||||
../transaction/call_common,
|
||||
../vm_types,
|
||||
../evm/types,
|
||||
../beacon/web3_eth_conv,
|
||||
../evm/evm_errors,
|
||||
./rpc_types
|
||||
|
|
|
@ -22,8 +22,8 @@ import
|
|||
../transaction/call_evm,
|
||||
../core/eip4844,
|
||||
../beacon/web3_eth_conv,
|
||||
../vm_types,
|
||||
../vm_state,
|
||||
../evm/types,
|
||||
../evm/state,
|
||||
../evm/precompiles,
|
||||
../evm/tracer/access_list_tracer,
|
||||
../evm/evm_errors
|
||||
|
|
|
@ -91,7 +91,7 @@ proc inPool(ctx: EthWireRef, txHash: Hash256): bool =
|
|||
proc successorHeader(db: CoreDbRef,
|
||||
h: BlockHeader,
|
||||
output: var BlockHeader,
|
||||
skip = 0'u): bool {.gcsafe, raises: [RlpError].} =
|
||||
skip = 0'u): bool =
|
||||
let offset = 1 + skip.BlockNumber
|
||||
if h.number <= (not 0.BlockNumber) - offset:
|
||||
result = db.getBlockHeader(h.number + offset, output)
|
||||
|
@ -99,15 +99,14 @@ proc successorHeader(db: CoreDbRef,
|
|||
proc ancestorHeader(db: CoreDbRef,
|
||||
h: BlockHeader,
|
||||
output: var BlockHeader,
|
||||
skip = 0'u): bool {.gcsafe, raises: [RlpError].} =
|
||||
skip = 0'u): bool =
|
||||
let offset = 1 + skip.BlockNumber
|
||||
if h.number >= offset:
|
||||
result = db.getBlockHeader(h.number - offset, output)
|
||||
|
||||
proc blockHeader(db: CoreDbRef,
|
||||
b: HashOrNum,
|
||||
output: var BlockHeader): bool
|
||||
{.gcsafe, raises: [RlpError].} =
|
||||
output: var BlockHeader): bool =
|
||||
if b.isHash:
|
||||
db.getBlockHeader(b.hash, output)
|
||||
else:
|
||||
|
|
|
@ -14,7 +14,10 @@ import
|
|||
./db/[core_db, ledger],
|
||||
./utils/utils,
|
||||
./evm/tracer/legacy_tracer,
|
||||
"."/[constants, vm_state, vm_types, transaction, core/executor],
|
||||
./constants,
|
||||
./transaction,
|
||||
./core/executor,
|
||||
./evm/[state, types],
|
||||
nimcrypto/utils as ncrutils,
|
||||
web3/conversions, ./launcher,
|
||||
results,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import
|
||||
./constants, ./errors, eth/[common, keys], ./utils/utils,
|
||||
common/evmforks, ./vm_gas_costs
|
||||
common/evmforks, ./evm/internals
|
||||
|
||||
import eth/common/transaction as common_transaction
|
||||
export common_transaction, errors
|
||||
|
|
|
@ -12,18 +12,20 @@ import
|
|||
eth/common/eth_types, stint, stew/ptrops,
|
||||
chronos,
|
||||
results,
|
||||
".."/[vm_types, vm_state, vm_computation],
|
||||
".."/[vm_internals, vm_precompiles, vm_gas_costs],
|
||||
".."/[db/ledger],
|
||||
../evm/[types, state, state_transactions],
|
||||
../evm/[precompiles, internals],
|
||||
../db/ledger,
|
||||
../common/evmforks,
|
||||
../core/eip4844,
|
||||
./host_types
|
||||
|
||||
import ../evm/computation except fromEvmc, toEvmc
|
||||
|
||||
when defined(evmc_enabled):
|
||||
import ../utils/utils
|
||||
import ./host_services
|
||||
else:
|
||||
import ../vm_state_transactions
|
||||
#else:
|
||||
#import ../evm/state_transactions
|
||||
|
||||
type
|
||||
# Standard call parameters.
|
||||
|
|
|
@ -12,7 +12,7 @@ import
|
|||
chronicles,
|
||||
chronos,
|
||||
eth/common/eth_types_rlp,
|
||||
".."/[vm_types, vm_state, vm_gas_costs],
|
||||
../evm/[types, state, internals],
|
||||
../db/ledger,
|
||||
../common/common,
|
||||
../evm/evm_errors,
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
import
|
||||
./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.} =
|
||||
dealloc(result.output_data)
|
||||
|
|
|
@ -12,10 +12,13 @@ import
|
|||
eth/common/eth_types,
|
||||
stew/ptrops,
|
||||
stint,
|
||||
".."/[vm_types, vm_computation],
|
||||
../evm/types,
|
||||
../evm/interpreter_dispatch,
|
||||
../utils/utils,
|
||||
"."/[host_types, host_trace]
|
||||
|
||||
import ../evm/computation except fromEvmc, toEvmc
|
||||
|
||||
proc evmcResultRelease(res: var EvmcResult) {.cdecl, gcsafe.} =
|
||||
dealloc(res.output_data)
|
||||
|
||||
|
|
|
@ -13,10 +13,12 @@ import
|
|||
stint, chronicles,
|
||||
eth/common/eth_types, ../db/ledger,
|
||||
../common/[evmforks, common],
|
||||
".."/[vm_state, vm_computation, vm_internals, vm_gas_costs],
|
||||
../evm/[state, internals],
|
||||
./host_types, ./host_trace, ./host_call_nested,
|
||||
stew/saturation_arith
|
||||
|
||||
import ../evm/computation except fromEvmc, toEvmc
|
||||
|
||||
proc setupTxContext(host: TransactionHost) =
|
||||
# Conversion issues:
|
||||
#
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
# 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
|
||||
# * 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
|
||||
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"
|
||||
# manage account state outside EVM such as balance transfers, storage, logs and
|
||||
|
|
|
@ -12,8 +12,8 @@ import
|
|||
std/[options, json],
|
||||
../common/common,
|
||||
stew/byteutils,
|
||||
../vm_state,
|
||||
../vm_types,
|
||||
../evm/state,
|
||||
../evm/types,
|
||||
../db/ledger,
|
||||
./utils,
|
||||
./state_dump
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -13,7 +13,7 @@ import
|
|||
stew/byteutils,
|
||||
chronicles,
|
||||
results,
|
||||
../nimbus/[vm_state, vm_types],
|
||||
../nimbus/[evm/state, evm/types],
|
||||
../nimbus/core/executor,
|
||||
./premixcore, ./prestate,
|
||||
../nimbus/tracer,
|
||||
|
|
|
@ -19,7 +19,7 @@ import
|
|||
../nimbus/db/opts,
|
||||
../nimbus/db/core_db/persistent,
|
||||
../nimbus/core/executor,
|
||||
../nimbus/[vm_state, vm_types],
|
||||
../nimbus/[evm/state, evm/types],
|
||||
../nimbus/tracer,
|
||||
./configuration # must be late (compilation annoyance)
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import
|
|||
std/[json, tables, hashes],
|
||||
eth/trie/trie_defs,
|
||||
stint, stew/byteutils, chronicles,
|
||||
../nimbus/[vm_state, vm_types],
|
||||
../nimbus/[evm/state, evm/types],
|
||||
../nimbus/utils/utils,
|
||||
../nimbus/tracer,
|
||||
../nimbus/db/[core_db, state_db/read_write],
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
import
|
||||
chronicles,
|
||||
../nimbus/[vm_state, vm_types],
|
||||
../nimbus/[evm/state, evm/types],
|
||||
../nimbus/core/executor,
|
||||
../nimbus/common/common,
|
||||
../nimbus/db/opts,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Nimbus
|
||||
# Copyright (c) 2018-2023 Status Research & Development GmbH
|
||||
# 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)
|
||||
|
@ -8,7 +8,7 @@
|
|||
import
|
||||
std/[times, macros, strutils, os, osproc, threadpool],
|
||||
unittest2,
|
||||
../nimbus/vm_compile_info,
|
||||
../nimbus/compile_info,
|
||||
../nimbus/utils/utils
|
||||
|
||||
export strutils, os, unittest2, osproc, threadpool
|
||||
|
|
|
@ -19,9 +19,9 @@ import
|
|||
import
|
||||
../nimbus/db/ledger,
|
||||
../nimbus/evm/types,
|
||||
../nimbus/vm_internals,
|
||||
../nimbus/evm/internals,
|
||||
../nimbus/transaction/[call_common, call_evm],
|
||||
../nimbus/[vm_types, vm_state],
|
||||
../nimbus/evm/state,
|
||||
../nimbus/core/pow/difficulty
|
||||
|
||||
from ../nimbus/db/aristo
|
||||
|
|
|
@ -17,8 +17,8 @@ import
|
|||
../nimbus/core/chain,
|
||||
../nimbus/transaction,
|
||||
../nimbus/constants,
|
||||
../nimbus/vm_state,
|
||||
../nimbus/vm_types,
|
||||
../nimbus/evm/state,
|
||||
../nimbus/evm/types,
|
||||
./replay/undump_blocks,
|
||||
unittest2
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import
|
|||
stew/byteutils,
|
||||
./test_helpers, ./test_allowed_to_fail,
|
||||
../premix/parser, test_config,
|
||||
../nimbus/[vm_state, vm_types, errors, constants],
|
||||
../nimbus/[evm/state, evm/types, errors, constants],
|
||||
../nimbus/db/ledger,
|
||||
../nimbus/utils/[utils, debug],
|
||||
../nimbus/evm/tracer/legacy_tracer,
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
# Nimbus
|
||||
# Copyright (c) 2018-2023 Status Research & Development GmbH
|
||||
# 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 unittest2, sequtils,
|
||||
../nimbus/vm_internals
|
||||
../nimbus/evm/internals
|
||||
|
||||
proc codeStreamMain*() =
|
||||
suite "parse bytecode":
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import
|
||||
unittest2, macros, strformat,
|
||||
eth/common/eth_types,
|
||||
../nimbus/[vm_types, vm_internals]
|
||||
../nimbus/[evm/types, evm/internals, evm/evm_errors]
|
||||
|
||||
# TODO: quicktest
|
||||
# PS: parametrize can be easily immitated, but still quicktests would be even more useful
|
||||
|
|
|
@ -10,7 +10,7 @@ import
|
|||
./test_helpers, ./test_allowed_to_fail,
|
||||
../nimbus/core/executor, test_config,
|
||||
../nimbus/transaction,
|
||||
../nimbus/[vm_state, vm_types],
|
||||
../nimbus/[evm/state, evm/types],
|
||||
../nimbus/db/ledger,
|
||||
../nimbus/common/common,
|
||||
../nimbus/utils/[utils, debug],
|
||||
|
|
|
@ -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)
|
||||
|
@ -11,7 +11,7 @@
|
|||
import
|
||||
unittest2,
|
||||
eth/common/eth_types,
|
||||
../nimbus/vm_internals,
|
||||
../nimbus/evm/internals,
|
||||
../nimbus/core/pow/header
|
||||
|
||||
func toAddress(n: int): EthAddress =
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
import
|
||||
macro_assembler, unittest2,
|
||||
stew/byteutils, ../nimbus/common/common,
|
||||
../nimbus/[vm_state, constants],
|
||||
../nimbus/[evm/state, constants],
|
||||
../nimbus/db/ledger
|
||||
|
||||
proc opEnvMain*() =
|
||||
|
|
|
@ -12,8 +12,8 @@ import eth/[keys, trie]
|
|||
import stew/byteutils
|
||||
import unittest2
|
||||
import ../nimbus/common
|
||||
import ../nimbus/vm_state
|
||||
import ../nimbus/vm_types
|
||||
import ../nimbus/evm/state
|
||||
import ../nimbus/evm/types
|
||||
import ../nimbus/transaction
|
||||
import ../nimbus/transaction/call_evm
|
||||
import ../nimbus/db/core_db
|
||||
|
|
|
@ -10,11 +10,11 @@ import
|
|||
unittest2, stew/byteutils,
|
||||
eth/[keys, trie],
|
||||
../nimbus/common/common,
|
||||
../nimbus/[vm_computation,
|
||||
vm_state,
|
||||
vm_types,
|
||||
../nimbus/[evm/computation,
|
||||
evm/state,
|
||||
evm/types,
|
||||
constants,
|
||||
vm_precompiles {.all.},
|
||||
evm/precompiles {.all.},
|
||||
transaction,
|
||||
transaction/call_evm
|
||||
],
|
||||
|
|
|
@ -12,7 +12,7 @@ import
|
|||
json_rpc/[rpcserver, rpcclient],
|
||||
nimcrypto/[keccak, hash],
|
||||
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/sync/protocol,
|
||||
../nimbus/core/[tx_pool, chain, executor, executor/executor_helpers, pow/difficulty],
|
||||
|
|
|
@ -19,7 +19,7 @@ import
|
|||
../nimbus/db/aristo/aristo_merge,
|
||||
../nimbus/db/kvt/kvt_utils,
|
||||
../nimbus/db/aristo,
|
||||
../nimbus/[tracer, vm_types],
|
||||
../nimbus/[tracer, evm/types],
|
||||
../nimbus/common/common
|
||||
|
||||
proc setErrorLevel {.used.} =
|
||||
|
|
|
@ -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,7 +13,7 @@ import
|
|||
unittest2,
|
||||
eth/rlp,
|
||||
./test_helpers,
|
||||
../nimbus/[errors, transaction, vm_types],
|
||||
../nimbus/[errors, transaction, evm/types],
|
||||
../nimbus/utils/utils
|
||||
|
||||
const
|
||||
|
|
|
@ -13,7 +13,7 @@ import
|
|||
../nimbus/core/chain, # must be early (compilation annoyance)
|
||||
../nimbus/common/common,
|
||||
../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],
|
||||
chronos,
|
||||
eth/[keys, p2p],
|
||||
|
|
|
@ -19,7 +19,7 @@ import
|
|||
../nimbus/core/casper,
|
||||
../nimbus/common/common,
|
||||
../nimbus/utils/utils,
|
||||
../nimbus/vm_types,
|
||||
../nimbus/evm/types,
|
||||
./test_txpool/helpers,
|
||||
./macro_assembler
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import
|
|||
../nimbus/common/common, # must be early (compilation annoyance)
|
||||
../nimbus/db/opts,
|
||||
../nimbus/db/core_db/persistent,
|
||||
../nimbus/[config, tracer, vm_types]
|
||||
../nimbus/[config, tracer, evm/types]
|
||||
|
||||
proc dumpTest(com: CommonRef, blockNumber: BlockNumber) =
|
||||
var
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
import
|
||||
../../nimbus/common/common,
|
||||
../../nimbus/[vm_state, vm_types],
|
||||
../../nimbus/[evm/state, evm/types],
|
||||
../../nimbus/db/ledger
|
||||
|
||||
proc coinbaseStateClearing*(vmState: BaseVMState,
|
||||
|
|
|
@ -16,7 +16,7 @@ import
|
|||
results,
|
||||
stint,
|
||||
eth/trie/[trie_defs],
|
||||
../../nimbus/[vm_types, vm_state],
|
||||
../../nimbus/[evm/types, evm/state],
|
||||
../../nimbus/db/ledger,
|
||||
../../nimbus/transaction,
|
||||
../../nimbus/core/executor,
|
||||
|
|
|
@ -14,7 +14,7 @@ import
|
|||
stint, results,
|
||||
"."/[config, types, helpers],
|
||||
../common/state_clearing,
|
||||
../../nimbus/[vm_types, vm_state, transaction],
|
||||
../../nimbus/[evm/types, evm/state, transaction],
|
||||
../../nimbus/common/common,
|
||||
../../nimbus/db/ledger,
|
||||
../../nimbus/utils/utils,
|
||||
|
|
Loading…
Reference in New Issue