From cdc3f21dae1ab0cbb4c25460885ce075239cb063 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 21 Jan 2019 11:21:09 +0000 Subject: [PATCH 1/2] Reserve post-Constantinople EVM revision number as Constantinople2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Paweł Bylica --- bindings/go/evmc/evmc.go | 1 + include/evmc/evmc.h | 9 ++++++++- lib/instructions/instruction_metrics.c | 2 +- lib/instructions/instruction_names.c | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/bindings/go/evmc/evmc.go b/bindings/go/evmc/evmc.go index f0b1a05fc..fdb91bcab 100644 --- a/bindings/go/evmc/evmc.go +++ b/bindings/go/evmc/evmc.go @@ -141,6 +141,7 @@ const ( SpuriousDragon Revision = C.EVMC_SPURIOUS_DRAGON Byzantium Revision = C.EVMC_BYZANTIUM Constantinople Revision = C.EVMC_CONSTANTINOPLE + Constantinople2 Revision = C.EVMC_CONSTANTINOPLE2 Istanbul Revision = C.EVMC_ISTANBUL ) diff --git a/include/evmc/evmc.h b/include/evmc/evmc.h index ee02a72fe..fbce04092 100644 --- a/include/evmc/evmc.h +++ b/include/evmc/evmc.h @@ -717,7 +717,14 @@ enum evmc_revision EVMC_SPURIOUS_DRAGON = 3, EVMC_BYZANTIUM = 4, EVMC_CONSTANTINOPLE = 5, - EVMC_ISTANBUL = 6, + + /** + * Reserved for the post-Constantinople upgrade. The name is likely to + * be changed, but the assigned number should stay. + */ + EVMC_CONSTANTINOPLE2 = 6, + + EVMC_ISTANBUL = 7, /** The maximum EVM revision supported. */ EVMC_MAX_REVISION = EVMC_ISTANBUL, diff --git a/lib/instructions/instruction_metrics.c b/lib/instructions/instruction_metrics.c index 41c9a3ab7..47ae85c6d 100644 --- a/lib/instructions/instruction_metrics.c +++ b/lib/instructions/instruction_metrics.c @@ -1322,7 +1322,7 @@ const struct evmc_instruction_metrics* evmc_get_instruction_metrics_table( switch (revision) { case EVMC_ISTANBUL: - /* Currently the same as Costantinople */ + case EVMC_CONSTANTINOPLE2: case EVMC_CONSTANTINOPLE: return constantinople_metrics; case EVMC_BYZANTIUM: diff --git a/lib/instructions/instruction_names.c b/lib/instructions/instruction_names.c index 8ebe49c95..c3347e4a7 100644 --- a/lib/instructions/instruction_names.c +++ b/lib/instructions/instruction_names.c @@ -1046,7 +1046,7 @@ const char* const* evmc_get_instruction_names_table(enum evmc_revision revision) switch (revision) { case EVMC_ISTANBUL: - /* Currently the same as Costantinople */ + case EVMC_CONSTANTINOPLE2: case EVMC_CONSTANTINOPLE: return constantinople_names; case EVMC_BYZANTIUM: From 97e40acf59cf2bb0fbe38ee92f90890e10aaa704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Mon, 21 Jan 2019 16:24:11 +0100 Subject: [PATCH 2/2] Changelog: Add entry about Constantinople2 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index be31eb80a..033508b7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The **Istanbul** EVM revision. - Added: [[#182](https://github.com/ethereum/evmc/pull/182)] The `is_zero()` C++ helper for basic data types. +- Added: [[#186](https://github.com/ethereum/evmc/pull/186)] + Reserved the post-Constantinople EVM revision number. - Deprecated: [[#184](https://github.com/ethereum/evmc/pull/184)] The `EVMC_LATEST_REVISION` is deprecated, replaced with `EVMC_MAX_REVISION`.