From fbbc5004453cb6795fb17bf1539d5e385177c891 Mon Sep 17 00:00:00 2001 From: andri lim Date: Wed, 27 Nov 2024 16:08:14 +0700 Subject: [PATCH] Bump nim-evmc to 730d35d8572e1b3957b0c6c986ecd86413976da0 (#2879) --- nimbus/common/evmforks.nim | 1 + nimbus/common/hardforks.nim | 7 ++++++- nimbus/core/executor/calculate_reward.nim | 1 + nimbus/evm/interpreter/gas_costs.nim | 1 + vendor/nim-evmc | 2 +- 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/nimbus/common/evmforks.nim b/nimbus/common/evmforks.nim index 0172fbf67..2abe45b86 100644 --- a/nimbus/common/evmforks.nim +++ b/nimbus/common/evmforks.nim @@ -29,3 +29,4 @@ const FkShanghai* = EVMC_SHANGHAI FkCancun* = EVMC_CANCUN FkPrague* = EVMC_PRAGUE + FkOsaka* = EVMC_OSAKA diff --git a/nimbus/common/hardforks.nim b/nimbus/common/hardforks.nim index 7ed02deb1..da108e9c0 100644 --- a/nimbus/common/hardforks.nim +++ b/nimbus/common/hardforks.nim @@ -37,6 +37,7 @@ type Shanghai Cancun Prague + Osaka const lastPurelyBlockNumberBasedFork* = GrayGlacier # MergeFork is special because of TTD. @@ -52,7 +53,7 @@ type ForkTransitionTable* = object blockNumberThresholds*: array[Frontier..GrayGlacier, Opt[BlockNumber]] mergeForkTransitionThreshold*: MergeForkTransitionThreshold - timeThresholds*: array[Shanghai..Prague, Opt[EthTime]] + timeThresholds*: array[Shanghai..Osaka, Opt[EthTime]] # Starting with Shanghai, forking is based on timestamp # rather than block number. @@ -173,6 +174,7 @@ type shanghaiTime* : Opt[EthTime] cancunTime* : Opt[EthTime] pragueTime* : Opt[EthTime] + osakaTime* : Opt[EthTime] terminalTotalDifficulty*: Opt[UInt256] terminalTotalDifficultyPassed*: Opt[bool] @@ -265,6 +267,7 @@ func toForkTransitionTable*(conf: ChainConfig): ForkTransitionTable = result.timeThresholds[Shanghai] = conf.shanghaiTime result.timeThresholds[Cancun] = conf.cancunTime result.timeThresholds[Prague] = conf.pragueTime + result.timeThresholds[Osaka] = conf.osakaTime func populateFromForkTransitionTable*(conf: ChainConfig, t: ForkTransitionTable) = conf.homesteadBlock = t.blockNumberThresholds[HardFork.Homestead] @@ -289,6 +292,7 @@ func populateFromForkTransitionTable*(conf: ChainConfig, t: ForkTransitionTable) conf.shanghaiTime = t.timeThresholds[HardFork.Shanghai] conf.cancunTime = t.timeThresholds[HardFork.Cancun] conf.pragueTime = t.timeThresholds[HardFork.Prague] + conf.osakaTime = t.timeThresholds[HardFork.Osaka] # ------------------------------------------------------------------------------ # Map HardFork to EVM/EVMC Fork @@ -314,6 +318,7 @@ const FkShanghai, # Shanghai FkCancun, # Cancun FkPrague, # Prague + FkOsaka, # Osaka ] # ------------------------------------------------------------------------------ diff --git a/nimbus/core/executor/calculate_reward.nim b/nimbus/core/executor/calculate_reward.nim index 6c0c757b9..33f41bb23 100644 --- a/nimbus/core/executor/calculate_reward.nim +++ b/nimbus/core/executor/calculate_reward.nim @@ -46,6 +46,7 @@ const eth0, # Shanghai eth0, # Cancun eth0, # Prague + eth0, # Osaka ] proc calculateReward*(vmState: BaseVMState; account: Address; diff --git a/nimbus/evm/interpreter/gas_costs.nim b/nimbus/evm/interpreter/gas_costs.nim index b71864b1a..ceda544a4 100644 --- a/nimbus/evm/interpreter/gas_costs.nim +++ b/nimbus/evm/interpreter/gas_costs.nim @@ -789,6 +789,7 @@ const FkShanghai: ShanghaiGasFees, FkCancun: ShanghaiGasFees, FkPrague: ShanghaiGasFees, + FkOsaka: ShanghaiGasFees, ] gasCosts(FkFrontier, base, BaseGasCosts) diff --git a/vendor/nim-evmc b/vendor/nim-evmc index 6e2611485..730d35d85 160000 --- a/vendor/nim-evmc +++ b/vendor/nim-evmc @@ -1 +1 @@ -Subproject commit 6e261148565a311536b1a29f1568e8c4470baf9d +Subproject commit 730d35d8572e1b3957b0c6c986ecd86413976da0