mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-02-28 11:50:45 +00:00
Update Nimbus EVM code to use the latest nim-evmc which supports EVMC v12.1.0 (#3065)
* Update Nimbus EVM code to use the latest nim-evmc which is now on EVMC v12.1.0 * Fix copyright. * Fix tests. * Update to use FkLatest. * Fix copyright and update test helper.
This commit is contained in:
parent
67dbe817a9
commit
f513e1dc53
2
Makefile
2
Makefile
@ -359,7 +359,7 @@ txparse: | build deps
|
|||||||
|
|
||||||
# builds the nimbus evmc shared library
|
# builds the nimbus evmc shared library
|
||||||
libnimbusevm: | build deps
|
libnimbusevm: | build deps
|
||||||
$(ENV_SCRIPT) nim c $(NIM_PARAMS) -d:evmc_enabled --app:lib --noMain -o:build/libnimbusevm/$@.$(SHAREDLIBEXT) nimbus/transaction/evmc_vm_glue.nim
|
$(ENV_SCRIPT) nim c $(NIM_PARAMS) -d:evmc_enabled --app:lib --noMain -o:build/libnimbusevm/$@.$(SHAREDLIBEXT) execution_chain/transaction/evmc_vm_glue.nim
|
||||||
|
|
||||||
# usual cleaning
|
# usual cleaning
|
||||||
clean: | clean-common
|
clean: | clean-common
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Nimbus
|
# Nimbus
|
||||||
# Copyright (c) 2018-2024 Status Research & Development GmbH
|
# Copyright (c) 2018-2025 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)
|
||||||
@ -30,3 +30,4 @@ const
|
|||||||
FkCancun* = EVMC_CANCUN
|
FkCancun* = EVMC_CANCUN
|
||||||
FkPrague* = EVMC_PRAGUE
|
FkPrague* = EVMC_PRAGUE
|
||||||
FkOsaka* = EVMC_OSAKA
|
FkOsaka* = EVMC_OSAKA
|
||||||
|
FkLatest* = EVMFork(EVMFork.high.int - 1)
|
||||||
|
@ -25,10 +25,10 @@ func getTargetBlobGasPerBlock*(electra: bool): uint64 =
|
|||||||
else: TARGET_BLOB_GAS_PER_BLOCK.uint64
|
else: TARGET_BLOB_GAS_PER_BLOCK.uint64
|
||||||
|
|
||||||
const
|
const
|
||||||
EVMForkToFork: array[FkCancun..EVMFork.high, HardFork] = [
|
EVMForkToFork: array[FkCancun..FkLatest, HardFork] = [
|
||||||
Cancun,
|
Cancun,
|
||||||
Prague,
|
Prague,
|
||||||
Osaka
|
Osaka,
|
||||||
]
|
]
|
||||||
|
|
||||||
func getMaxBlobsPerBlock*(com: CommonRef, fork: EVMFork): uint64 =
|
func getMaxBlobsPerBlock*(com: CommonRef, fork: EVMFork): uint64 =
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Nimbus
|
# Nimbus
|
||||||
# Copyright (c) 2018-2024 Status Research & Development GmbH
|
# Copyright (c) 2018-2025 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)
|
||||||
@ -31,7 +31,7 @@ const
|
|||||||
eth2 = 2.eth
|
eth2 = 2.eth
|
||||||
eth0 = 0.u256
|
eth0 = 0.u256
|
||||||
|
|
||||||
BlockRewards: array[EVMFork, UInt256] = [
|
BlockRewards: array[FkFrontier..FkLatest, UInt256] = [
|
||||||
eth5, # Frontier
|
eth5, # Frontier
|
||||||
eth5, # Homestead
|
eth5, # Homestead
|
||||||
eth5, # Tangerine
|
eth5, # Tangerine
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Nimbus
|
# Nimbus
|
||||||
# Copyright (c) 2018-2024 Status Research & Development GmbH
|
# Copyright (c) 2018-2025 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)
|
||||||
@ -774,7 +774,7 @@ const
|
|||||||
LondonGasFees = BerlinGasFees.londonGasFees
|
LondonGasFees = BerlinGasFees.londonGasFees
|
||||||
ShanghaiGasFees = LondonGasFees.shanghaiGasFees
|
ShanghaiGasFees = LondonGasFees.shanghaiGasFees
|
||||||
|
|
||||||
gasFees*: array[EVMFork, GasFeeSchedule] = [
|
gasFees*: array[FkFrontier..FkLatest, GasFeeSchedule] = [
|
||||||
FkFrontier: BaseGasFees,
|
FkFrontier: BaseGasFees,
|
||||||
FkHomestead: HomesteadGasFees,
|
FkHomestead: HomesteadGasFees,
|
||||||
FkTangerine: TangerineGasFees,
|
FkTangerine: TangerineGasFees,
|
||||||
|
@ -13,13 +13,13 @@ import
|
|||||||
../execution_chain/db/ledger,
|
../execution_chain/db/ledger,
|
||||||
../execution_chain/common/[context, common]
|
../execution_chain/common/[context, common]
|
||||||
|
|
||||||
func revTable(list: array[EVMFork, string]): Table[string, EVMFork] =
|
func revTable(list: array[FkFrontier..FkLatest, string]): Table[string, EVMFork] =
|
||||||
for k, v in list:
|
for k, v in list:
|
||||||
result[v] = k
|
result[v] = k
|
||||||
|
|
||||||
const
|
const
|
||||||
# from https://ethereum-tests.readthedocs.io/en/latest/test_types/state_tests.html
|
# from https://ethereum-tests.readthedocs.io/en/latest/test_types/state_tests.html
|
||||||
ForkToName: array[EVMFork, string] = [
|
ForkToName: array[FkFrontier..FkLatest, string] = [
|
||||||
"Frontier", # FkFrontier
|
"Frontier", # FkFrontier
|
||||||
"Homestead", # FkHomestead
|
"Homestead", # FkHomestead
|
||||||
"EIP150", # FkTangerine
|
"EIP150", # FkTangerine
|
||||||
|
2
vendor/nim-evmc
vendored
2
vendor/nim-evmc
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 730d35d8572e1b3957b0c6c986ecd86413976da0
|
Subproject commit 0b758ff7a59dd6b3728309fa7ffeeea3d46454e0
|
Loading…
x
Reference in New Issue
Block a user