re-named v2gas_costs.nim to its original name v2gas_costs.nim
why: the v2 prefix of the file name was used as a visual aid when comparing vm2 against vm sources
This commit is contained in:
parent
72b36e154b
commit
a86bcefc7a
|
@ -5,9 +5,6 @@
|
||||||
# * 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.
|
||||||
|
|
||||||
when defined(evmc_enabled):
|
|
||||||
{.fatal: "Flags \"evmc_enabled\" and \"vm2_enabled\" are mutually exclusive"}
|
|
||||||
|
|
||||||
import
|
import
|
||||||
math, eth/common/eth_types,
|
math, eth/common/eth_types,
|
||||||
./utils/[macros_gen_opcodes, v2utils_numeric],
|
./utils/[macros_gen_opcodes, v2utils_numeric],
|
|
@ -30,9 +30,9 @@ when not breakCircularDependency:
|
||||||
../../compu_helper,
|
../../compu_helper,
|
||||||
../../stack,
|
../../stack,
|
||||||
../../v2types,
|
../../v2types,
|
||||||
|
../gas_costs,
|
||||||
../gas_meter,
|
../gas_meter,
|
||||||
../utils/v2utils_numeric,
|
../utils/v2utils_numeric,
|
||||||
../v2gas_costs,
|
|
||||||
chronicles,
|
chronicles,
|
||||||
eth/common,
|
eth/common,
|
||||||
options,
|
options,
|
||||||
|
@ -64,7 +64,7 @@ else:
|
||||||
# function stubs from gas_meter.nim
|
# function stubs from gas_meter.nim
|
||||||
proc consumeGas(gasMeter: var GasMeter; amount: int; reason: string) = discard
|
proc consumeGas(gasMeter: var GasMeter; amount: int; reason: string) = discard
|
||||||
|
|
||||||
# stubs from v2gas_costs.nim
|
# stubs from gas_costs.nim
|
||||||
proc d_handler(x: int; value: Uint256): int = result
|
proc d_handler(x: int; value: Uint256): int = result
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
|
@ -36,9 +36,9 @@ when not breakCircularDependency:
|
||||||
../../v2memory,
|
../../v2memory,
|
||||||
../../v2state,
|
../../v2state,
|
||||||
../../v2types,
|
../../v2types,
|
||||||
|
../gas_costs,
|
||||||
../gas_meter,
|
../gas_meter,
|
||||||
../utils/v2utils_numeric,
|
../utils/v2utils_numeric,
|
||||||
../v2gas_costs,
|
|
||||||
eth/common
|
eth/common
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -98,7 +98,7 @@ else:
|
||||||
# function stubs from v2utils_numeric.nim
|
# function stubs from v2utils_numeric.nim
|
||||||
func cleanMemRef(x: UInt256): int = result
|
func cleanMemRef(x: UInt256): int = result
|
||||||
|
|
||||||
# stubs from v2gas_costs.nim
|
# stubs from gas_costs.nim
|
||||||
type GasParams = object
|
type GasParams = object
|
||||||
case kind*: Op
|
case kind*: Op
|
||||||
of Call, CallCode, DelegateCall, StaticCall:
|
of Call, CallCode, DelegateCall, StaticCall:
|
||||||
|
|
|
@ -37,9 +37,9 @@ when not breakCircularDependency:
|
||||||
../../v2memory,
|
../../v2memory,
|
||||||
../../v2state,
|
../../v2state,
|
||||||
../../v2types,
|
../../v2types,
|
||||||
|
../gas_costs,
|
||||||
../gas_meter,
|
../gas_meter,
|
||||||
../utils/v2utils_numeric,
|
../utils/v2utils_numeric,
|
||||||
../v2gas_costs,
|
|
||||||
eth/common
|
eth/common
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -81,7 +81,7 @@ else:
|
||||||
proc consumeGas(gasMeter: var GasMeter; amount: int; reason: string) = discard
|
proc consumeGas(gasMeter: var GasMeter; amount: int; reason: string) = discard
|
||||||
proc returnGas(gasMeter: var GasMeter; amount: GasInt) = discard
|
proc returnGas(gasMeter: var GasMeter; amount: GasInt) = discard
|
||||||
|
|
||||||
# stubs from v2gas_costs.nim
|
# stubs from gas_costs.nim
|
||||||
type GasParams = object
|
type GasParams = object
|
||||||
case kind*: Op
|
case kind*: Op
|
||||||
of Create:
|
of Create:
|
||||||
|
|
|
@ -35,9 +35,9 @@ when not breakCircularDependency:
|
||||||
../../stack,
|
../../stack,
|
||||||
../../v2memory,
|
../../v2memory,
|
||||||
../../v2state,
|
../../v2state,
|
||||||
|
../gas_costs,
|
||||||
../gas_meter,
|
../gas_meter,
|
||||||
../utils/v2utils_numeric,
|
../utils/v2utils_numeric,
|
||||||
../v2gas_costs,
|
|
||||||
eth/common
|
eth/common
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -85,7 +85,7 @@ else:
|
||||||
# function stubs from gas_meter.nim
|
# function stubs from gas_meter.nim
|
||||||
proc consumeGas(gasMeter: var GasMeter; amount: int; reason: string) = discard
|
proc consumeGas(gasMeter: var GasMeter; amount: int; reason: string) = discard
|
||||||
|
|
||||||
# stubs from v2gas_costs.nim
|
# stubs from gas_costs.nim
|
||||||
proc m_handler(x: int; curMemSize, memOffset, memLen: int64): int = 0
|
proc m_handler(x: int; curMemSize, memOffset, memLen: int64): int = 0
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
|
@ -31,9 +31,9 @@ when not breakCircularDependency:
|
||||||
../../compu_helper,
|
../../compu_helper,
|
||||||
../../stack,
|
../../stack,
|
||||||
../../v2memory,
|
../../v2memory,
|
||||||
|
../gas_costs,
|
||||||
../gas_meter,
|
../gas_meter,
|
||||||
../utils/v2utils_numeric,
|
../utils/v2utils_numeric,
|
||||||
../v2gas_costs,
|
|
||||||
eth/common,
|
eth/common,
|
||||||
nimcrypto
|
nimcrypto
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ else:
|
||||||
const keccak256 = 0xfeedbeef
|
const keccak256 = 0xfeedbeef
|
||||||
proc digest(dummy: int64, data: openarray[byte]): UInt256 = EMPTY_SHA3
|
proc digest(dummy: int64, data: openarray[byte]): UInt256 = EMPTY_SHA3
|
||||||
|
|
||||||
# stubs from v2gas_costs.nim
|
# stubs from gas_costs.nim
|
||||||
proc m_handler(x: int; curMemSize, memOffset, memLen: int64): int = 0
|
proc m_handler(x: int; curMemSize, memOffset, memLen: int64): int = 0
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
|
@ -39,8 +39,8 @@ when not breakCircularDependency:
|
||||||
../../../db/accounts_cache,
|
../../../db/accounts_cache,
|
||||||
../../v2state,
|
../../v2state,
|
||||||
../../v2types,
|
../../v2types,
|
||||||
|
../gas_costs,
|
||||||
../gas_meter,
|
../gas_meter,
|
||||||
../v2gas_costs,
|
|
||||||
eth/common
|
eth/common
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -37,9 +37,9 @@ when not breakCircularDependency:
|
||||||
../../stack,
|
../../stack,
|
||||||
../../v2memory,
|
../../v2memory,
|
||||||
../../v2types,
|
../../v2types,
|
||||||
|
../gas_costs,
|
||||||
../gas_meter,
|
../gas_meter,
|
||||||
../utils/v2utils_numeric,
|
../utils/v2utils_numeric,
|
||||||
../v2gas_costs,
|
|
||||||
eth/common
|
eth/common
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -75,7 +75,7 @@ else:
|
||||||
# function stubs from gas_meter.nim
|
# function stubs from gas_meter.nim
|
||||||
proc consumeGas(gasMeter: var GasMeter; amount: int; reason: string) = discard
|
proc consumeGas(gasMeter: var GasMeter; amount: int; reason: string) = discard
|
||||||
|
|
||||||
# stubs from v2gas_costs.nim
|
# stubs from gas_costs.nim
|
||||||
proc m_handler(x: int; curMemSize, memOffset, memLen: int64): int = 0
|
proc m_handler(x: int; curMemSize, memOffset, memLen: int64): int = 0
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
|
@ -36,9 +36,9 @@ when not breakCircularDependency:
|
||||||
../../v2memory,
|
../../v2memory,
|
||||||
../../v2state,
|
../../v2state,
|
||||||
../../v2types,
|
../../v2types,
|
||||||
|
../gas_costs,
|
||||||
../gas_meter,
|
../gas_meter,
|
||||||
../utils/v2utils_numeric,
|
../utils/v2utils_numeric,
|
||||||
../v2gas_costs,
|
|
||||||
eth/common
|
eth/common
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -89,7 +89,7 @@ else:
|
||||||
proc refundGas(gasMeter: var GasMeter; amount: int) = discard
|
proc refundGas(gasMeter: var GasMeter; amount: int) = discard
|
||||||
proc consumeGas(gasMeter: var GasMeter; amount: int; reason: string) = discard
|
proc consumeGas(gasMeter: var GasMeter; amount: int; reason: string) = discard
|
||||||
|
|
||||||
# stubs from v2gas_costs.nim
|
# stubs from gas_costs.nim
|
||||||
type GasParams = object
|
type GasParams = object
|
||||||
case kind*: Op
|
case kind*: Op
|
||||||
of Sstore:
|
of Sstore:
|
||||||
|
|
|
@ -34,9 +34,9 @@ when not breakCircularDependency:
|
||||||
../../v2memory,
|
../../v2memory,
|
||||||
../../v2state,
|
../../v2state,
|
||||||
../../v2types,
|
../../v2types,
|
||||||
|
../gas_costs,
|
||||||
../gas_meter,
|
../gas_meter,
|
||||||
../utils/v2utils_numeric,
|
../utils/v2utils_numeric,
|
||||||
../v2gas_costs,
|
|
||||||
eth/common
|
eth/common
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -82,7 +82,7 @@ else:
|
||||||
# function stubs from gas_meter.nim
|
# function stubs from gas_meter.nim
|
||||||
proc consumeGas(gasMeter: var GasMeter; amount: int; reason: string) = discard
|
proc consumeGas(gasMeter: var GasMeter; amount: int; reason: string) = discard
|
||||||
|
|
||||||
# stubs from v2gas_costs.nim
|
# stubs from gas_costs.nim
|
||||||
type GasParams = object
|
type GasParams = object
|
||||||
case kind*: Op
|
case kind*: Op
|
||||||
of SelfDestruct:
|
of SelfDestruct:
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
import
|
import
|
||||||
./compu_helper,
|
./compu_helper,
|
||||||
./interpreter/[gas_meter, op_handlers, op_handlers/oph_defs, v2gas_costs],
|
./interpreter/[gas_meter, op_handlers, op_handlers/oph_defs, gas_costs],
|
||||||
./code_stream,
|
./code_stream,
|
||||||
./v2types,
|
./v2types,
|
||||||
chronicles
|
chronicles
|
||||||
|
|
|
@ -13,7 +13,7 @@ import
|
||||||
sets, eth/[common, keys],
|
sets, eth/[common, keys],
|
||||||
../constants,
|
../constants,
|
||||||
./compu_helper,
|
./compu_helper,
|
||||||
./interpreter/[op_codes, gas_meter, v2gas_costs, forks_list],
|
./interpreter/[op_codes, gas_meter, gas_costs, forks_list],
|
||||||
./code_stream, ./memory_defs, ./v2message, ./stack, ./v2types, ./v2state,
|
./code_stream, ./memory_defs, ./v2message, ./stack, ./v2types, ./v2state,
|
||||||
../db/accounts_cache,
|
../db/accounts_cache,
|
||||||
./v2precompiles,
|
./v2precompiles,
|
||||||
|
|
|
@ -13,7 +13,7 @@ when defined(evmc_enabled):
|
||||||
|
|
||||||
import
|
import
|
||||||
./v2types,
|
./v2types,
|
||||||
./interpreter/[gas_meter, v2gas_costs, utils/v2utils_numeric, forks_list],
|
./interpreter/[gas_meter, gas_costs, utils/v2utils_numeric, forks_list],
|
||||||
../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
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ 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/[forks_list, v2gas_costs], ../errors,
|
./interpreter/[forks_list, gas_costs], ../errors,
|
||||||
../constants, ../db/[db_chain, accounts_cache],
|
../constants, ../db/[db_chain, accounts_cache],
|
||||||
../utils, json, ./transaction_tracer, ./v2types,
|
../utils, json, ./transaction_tracer, ./v2types,
|
||||||
../config, ../../stateless/[witness_from_tree, witness_types]
|
../config, ../../stateless/[witness_from_tree, witness_types]
|
||||||
|
|
|
@ -15,7 +15,7 @@ import
|
||||||
tables, eth/common,
|
tables, eth/common,
|
||||||
options, json, sets,
|
options, json, sets,
|
||||||
./stack_defs, ./memory_defs, ./code_stream,
|
./stack_defs, ./memory_defs, ./code_stream,
|
||||||
./interpreter/[v2gas_costs, op_codes, forks_list],
|
./interpreter/[gas_costs, op_codes, forks_list],
|
||||||
# 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/interpreter/gas_costs as vmg
|
./vm/interpreter/gas_costs as vmg
|
||||||
else:
|
else:
|
||||||
import
|
import
|
||||||
./vm2/interpreter/v2gas_costs as vmg
|
./vm2/interpreter/gas_costs as vmg
|
||||||
|
|
||||||
export
|
export
|
||||||
vmg.Bls12381G1AddGas,
|
vmg.Bls12381G1AddGas,
|
||||||
|
|
Loading…
Reference in New Issue