renamed types.nim, vm_fork.nim, opcode_values.nim => v2*.nim
why: these files provide part of the externally accessible interface provided by vm_types*.nim. so the new filename indicates that the source code belongs to vm2 (rather than vm).
This commit is contained in:
parent
cf2d771c4d
commit
7b6767c4a3
|
@ -8,7 +8,7 @@
|
||||||
import
|
import
|
||||||
chronicles, strformat, strutils, sequtils, parseutils, sets, macros,
|
chronicles, strformat, strutils, sequtils, parseutils, sets, macros,
|
||||||
eth/common,
|
eth/common,
|
||||||
./interpreter/opcode_values
|
./interpreter/v2opcode_values
|
||||||
|
|
||||||
logScope:
|
logScope:
|
||||||
topics = "vm code_stream"
|
topics = "vm code_stream"
|
||||||
|
|
|
@ -14,8 +14,8 @@ import
|
||||||
chronicles, strformat, macros, options, times,
|
chronicles, strformat, macros, options, times,
|
||||||
sets, eth/[common, keys],
|
sets, eth/[common, keys],
|
||||||
../constants, ../errors,
|
../constants, ../errors,
|
||||||
./interpreter/[opcode_values, gas_meter, gas_costs, vm_forks],
|
./interpreter/[v2opcode_values, gas_meter, gas_costs, v2forks],
|
||||||
./code_stream, ./memory, ./message, ./stack, ./types, ./state,
|
./code_stream, ./memory, ./message, ./stack, ./v2types, ./state,
|
||||||
../db/[accounts_cache, db_chain],
|
../db/[accounts_cache, db_chain],
|
||||||
../utils/header, ./precompiles,
|
../utils/header, ./precompiles,
|
||||||
./transaction_tracer, ../utils
|
./transaction_tracer, ../utils
|
||||||
|
|
|
@ -16,14 +16,14 @@ when defined(evmc_enabled):
|
||||||
|
|
||||||
# see vm_opcode_value
|
# see vm_opcode_value
|
||||||
import
|
import
|
||||||
./interpreter/opcode_values as vmo
|
./interpreter/v2opcode_values as vmo
|
||||||
export
|
export
|
||||||
vmo.Op
|
vmo.Op
|
||||||
|
|
||||||
|
|
||||||
# see vm_forks
|
# see v2forks
|
||||||
import
|
import
|
||||||
./interpreter/vm_forks as vmf
|
./interpreter/v2forks as vmf
|
||||||
export
|
export
|
||||||
vmf.Fork
|
vmf.Fork
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ when defined(evmc_enabled):
|
||||||
import
|
import
|
||||||
math, eth/common/eth_types,
|
math, eth/common/eth_types,
|
||||||
./utils/[macros_gen_opcodes, utils_numeric],
|
./utils/[macros_gen_opcodes, utils_numeric],
|
||||||
./opcode_values, ./vm_forks, ../../errors
|
./v2opcode_values, ./v2forks, ../../errors
|
||||||
|
|
||||||
# Gas Fee Schedule
|
# Gas Fee Schedule
|
||||||
# Yellow Paper Appendix G - https://ethereum.github.io/yellowpaper/paper.pdf
|
# Yellow Paper Appendix G - https://ethereum.github.io/yellowpaper/paper.pdf
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
import
|
import
|
||||||
chronicles, strformat, eth/common, # GasInt
|
chronicles, strformat, eth/common, # GasInt
|
||||||
../../errors, ../types
|
../../errors, ../v2types
|
||||||
|
|
||||||
logScope:
|
logScope:
|
||||||
topics = "vm gas"
|
topics = "vm gas"
|
||||||
|
|
|
@ -9,8 +9,8 @@ import
|
||||||
strformat, times, sets, sequtils, options,
|
strformat, times, sets, sequtils, options,
|
||||||
chronicles, stint, nimcrypto, stew/ranges/ptr_arith, eth/common,
|
chronicles, stint, nimcrypto, stew/ranges/ptr_arith, eth/common,
|
||||||
./utils/[macros_procs_opcodes, utils_numeric],
|
./utils/[macros_procs_opcodes, utils_numeric],
|
||||||
./gas_meter, ./gas_costs, ./opcode_values, ./vm_forks,
|
./gas_meter, ./gas_costs, ./v2opcode_values, ./v2forks,
|
||||||
../memory, ../stack, ../code_stream, ../computation, ../state, ../types,
|
../memory, ../stack, ../code_stream, ../computation, ../state, ../v2types,
|
||||||
../../errors, ../../constants,
|
../../errors, ../../constants,
|
||||||
../../db/[db_chain, accounts_cache]
|
../../db/[db_chain, accounts_cache]
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
import
|
import
|
||||||
macros, strformat, stint, eth/common,
|
macros, strformat, stint, eth/common,
|
||||||
../../computation, ../../stack, ../../code_stream, ../../memory,
|
../../computation, ../../stack, ../../code_stream, ../../memory,
|
||||||
../../types, ../../../errors, ../gas_meter, ../opcode_values,
|
../../v2types, ../../../errors, ../gas_meter, ../v2opcode_values,
|
||||||
./utils_numeric
|
./utils_numeric
|
||||||
|
|
||||||
proc pop(tree: var NimNode): NimNode =
|
proc pop(tree: var NimNode): NimNode =
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
import
|
import
|
||||||
tables, macros,
|
tables, macros,
|
||||||
chronicles,
|
chronicles,
|
||||||
./interpreter/[opcode_values, opcodes_impl, vm_forks, gas_costs, gas_meter, utils/macros_gen_opcodes],
|
./interpreter/[v2opcode_values, opcodes_impl, v2forks, gas_costs, gas_meter, utils/macros_gen_opcodes],
|
||||||
./code_stream, ./types, ../errors, ./precompiles, ./stack,
|
./code_stream, ./v2types, ../errors, ./precompiles, ./stack,
|
||||||
terminal # Those are only needed for logging
|
terminal # Those are only needed for logging
|
||||||
|
|
||||||
logScope:
|
logScope:
|
||||||
|
|
|
@ -10,7 +10,7 @@ when not defined(vm2_enabled):
|
||||||
when defined(evmc_enabled):
|
when defined(evmc_enabled):
|
||||||
{.fatal: "Flags \"evmc_enabled\" and \"vm2_enabled\" are mutually exclusive"}
|
{.fatal: "Flags \"evmc_enabled\" and \"vm2_enabled\" are mutually exclusive"}
|
||||||
|
|
||||||
import ./types
|
import ./v2types
|
||||||
|
|
||||||
proc isCreate*(message: Message): bool =
|
proc isCreate*(message: Message): bool =
|
||||||
message.kind in {evmcCreate, evmcCreate2}
|
message.kind in {evmcCreate, evmcCreate2}
|
||||||
|
|
|
@ -14,8 +14,8 @@ when defined(evmc_enabled):
|
||||||
{.fatal: "Flags \"evmc_enabled\" and \"vm2_enabled\" are mutually exclusive"}
|
{.fatal: "Flags \"evmc_enabled\" and \"vm2_enabled\" are mutually exclusive"}
|
||||||
|
|
||||||
import
|
import
|
||||||
./types,
|
./v2types,
|
||||||
./interpreter/[gas_meter, gas_costs, utils/utils_numeric, vm_forks],
|
./interpreter/[gas_meter, gas_costs, utils/utils_numeric, v2forks],
|
||||||
../errors, stint, eth/[keys, common], chronicles, tables, macros,
|
../errors, stint, eth/[keys, common], chronicles, tables, macros,
|
||||||
math, nimcrypto, bncurve/[fields, groups], ./blake2b_f, ./blscurve
|
math, nimcrypto, bncurve/[fields, groups], ./blake2b_f, ./blscurve
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,9 @@ when defined(evmc_enabled):
|
||||||
import
|
import
|
||||||
macros, strformat, tables, sets, options,
|
macros, strformat, tables, sets, options,
|
||||||
eth/[common, keys, rlp], nimcrypto/keccak,
|
eth/[common, keys, rlp], nimcrypto/keccak,
|
||||||
./interpreter/[vm_forks, gas_costs], ../errors,
|
./interpreter/[v2forks, gas_costs], ../errors,
|
||||||
../constants, ../db/[db_chain, accounts_cache],
|
../constants, ../db/[db_chain, accounts_cache],
|
||||||
../utils, json, ./transaction_tracer, ./types,
|
../utils, json, ./transaction_tracer, ./v2types,
|
||||||
../config, ../../stateless/[witness_from_tree, witness_types]
|
../config, ../../stateless/[witness_from_tree, witness_types]
|
||||||
|
|
||||||
proc newAccessLogs*: AccessLogs =
|
proc newAccessLogs*: AccessLogs =
|
||||||
|
|
|
@ -14,7 +14,7 @@ import
|
||||||
options, sets,
|
options, sets,
|
||||||
eth/common, chronicles, ../db/accounts_cache,
|
eth/common, chronicles, ../db/accounts_cache,
|
||||||
../transaction,
|
../transaction,
|
||||||
./computation, ./interpreter, ./state, ./types
|
./computation, ./interpreter, ./state, ./v2types
|
||||||
|
|
||||||
proc setupComputation*(vmState: BaseVMState, tx: Transaction, sender: EthAddress, fork: Fork) : Computation =
|
proc setupComputation*(vmState: BaseVMState, tx: Transaction, sender: EthAddress, fork: Fork) : Computation =
|
||||||
var gas = tx.gasLimit - tx.intrinsicGas(fork)
|
var gas = tx.gasLimit - tx.intrinsicGas(fork)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import
|
import
|
||||||
json, strutils, sets, hashes,
|
json, strutils, sets, hashes,
|
||||||
chronicles, nimcrypto, eth/common, stint,
|
chronicles, nimcrypto, eth/common, stint,
|
||||||
./types, ./memory, ./stack, ../db/accounts_cache,
|
./v2types, ./memory, ./stack, ../db/accounts_cache,
|
||||||
eth/trie/hexary,
|
eth/trie/hexary,
|
||||||
./interpreter/opcode_values
|
./interpreter/v2opcode_values
|
||||||
|
|
||||||
logScope:
|
logScope:
|
||||||
topics = "vm opcode"
|
topics = "vm opcode"
|
||||||
|
|
|
@ -17,7 +17,7 @@ import
|
||||||
tables, eth/common,
|
tables, eth/common,
|
||||||
options, json, sets,
|
options, json, sets,
|
||||||
./memory, ./stack, ./code_stream,
|
./memory, ./stack, ./code_stream,
|
||||||
./interpreter/[gas_costs, opcode_values, vm_forks],
|
./interpreter/[gas_costs, v2opcode_values, v2forks],
|
||||||
# TODO - will be hidden at a lower layer
|
# TODO - will be hidden at a lower layer
|
||||||
../db/[db_chain, accounts_cache]
|
../db/[db_chain, accounts_cache]
|
||||||
|
|
|
@ -13,7 +13,7 @@ when defined(evmc_enabled) or not defined(vm2_enabled):
|
||||||
./vm/types as vmt
|
./vm/types as vmt
|
||||||
else:
|
else:
|
||||||
import
|
import
|
||||||
./vm2/types as vmt
|
./vm2/v2types as vmt
|
||||||
|
|
||||||
export
|
export
|
||||||
vmt.AccessLogs,
|
vmt.AccessLogs,
|
||||||
|
|
|
@ -16,7 +16,7 @@ when defined(evmc_enabled) or not defined(vm2_enabled):
|
||||||
./vm/interpreter/vm_forks as vmf
|
./vm/interpreter/vm_forks as vmf
|
||||||
else:
|
else:
|
||||||
import
|
import
|
||||||
./vm2/interpreter/vm_forks as vmf
|
./vm2/interpreter/v2forks as vmf
|
||||||
|
|
||||||
export
|
export
|
||||||
vmf.Fork
|
vmf.Fork
|
||||||
|
@ -26,7 +26,7 @@ when defined(evmc_enabled) or not defined(vm2_enabled):
|
||||||
./vm/interpreter/opcode_values as vmo
|
./vm/interpreter/opcode_values as vmo
|
||||||
else:
|
else:
|
||||||
import
|
import
|
||||||
./vm2/interpreter/opcode_values as vmo
|
./vm2/interpreter/v2opcode_values as vmo
|
||||||
|
|
||||||
export
|
export
|
||||||
vmo.Op
|
vmo.Op
|
||||||
|
|
Loading…
Reference in New Issue