From 05bc174bef64bc90384fb5e71cb9f09a2a8c3aff Mon Sep 17 00:00:00 2001 From: Jamie Lokier Date: Tue, 1 Jun 2021 11:02:50 +0100 Subject: [PATCH] Forks: Use a common fork list outside the EVMs Many places outside the EVM use `Fork` and the fork list, and in general we want progressively fewer dependencies on EVM internal types and files. This may prove to be a temporary location, especially when we implement issue #640. But it's a fine temporary location if so. Signed-off-by: Jamie Lokier --- nimbus/forks.nim | 19 ++++++++++++++++ nimbus/vm/interpreter/vm_forks.nim | 22 ++----------------- nimbus/vm2/interpreter/forks_list.nim | 31 ++------------------------- 3 files changed, 23 insertions(+), 49 deletions(-) create mode 100644 nimbus/forks.nim diff --git a/nimbus/forks.nim b/nimbus/forks.nim new file mode 100644 index 000000000..dc86f4e9d --- /dev/null +++ b/nimbus/forks.nim @@ -0,0 +1,19 @@ +# Nimbus - Enumerate Eth1 forks +# +# 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. + +type + Fork* = enum + FkFrontier = "frontier" + FkHomestead = "homestead" + FkTangerine = "tangerine whistle" + FkSpurious = "spurious dragon" + FkByzantium = "byzantium" + FkConstantinople = "constantinople" + FkPetersburg = "petersburg" + FkIstanbul = "istanbul" + FkBerlin = "berlin" diff --git a/nimbus/vm/interpreter/vm_forks.nim b/nimbus/vm/interpreter/vm_forks.nim index 269e067a1..8ac097677 100644 --- a/nimbus/vm/interpreter/vm_forks.nim +++ b/nimbus/vm/interpreter/vm_forks.nim @@ -1,20 +1,2 @@ -# 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 stint, eth/common/eth_types - -type - Fork* = enum - FkFrontier = "frontier" - FkHomestead = "homestead" - FkTangerine = "tangerine whistle" - FkSpurious = "spurious dragon" - FkByzantium = "byzantium" - FkConstantinople = "constantinople" - FkPetersburg = "petersburg" - FkIstanbul = "istanbul" - FkBerlin = "berlin" +import ../../forks +export Fork diff --git a/nimbus/vm2/interpreter/forks_list.nim b/nimbus/vm2/interpreter/forks_list.nim index d401d0f57..8ac097677 100644 --- a/nimbus/vm2/interpreter/forks_list.nim +++ b/nimbus/vm2/interpreter/forks_list.nim @@ -1,29 +1,2 @@ -# 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. - -## List of known Ethereum forks -## ============================ -## -## See `here <../../ex/vm/interpreter/forks_list.html>`_ for an -## overview. - -type - Fork* = enum - FkFrontier = "frontier" - FkHomestead = "homestead" - FkTangerine = "tangerine whistle" - FkSpurious = "spurious dragon" - FkByzantium = "byzantium" - FkConstantinople = "constantinople" - FkPetersburg = "petersburg" - FkIstanbul = "istanbul" - FkBerlin = "berlin" - -# End +import ../../forks +export Fork