From ac7498b898f8a16a28b5396ef0ff34bd2c28927e Mon Sep 17 00:00:00 2001 From: Matias Romeo Date: Tue, 4 Jun 2024 14:41:44 -0300 Subject: [PATCH 1/3] Bump 1.0.1 version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76a81c9b..bddac276 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ if(NOT SILKWORM_HAS_PARENT) endif() project(silkworm) -set(PROJECT_VERSION 1.0.0-rc2) +set(PROJECT_VERSION 1.0.1) # conan must be initiailzed after project definition to properly detect target architecture. if(NOT SILKWORM_HAS_PARENT) From af7435eb58d53f7faf49979287dfd715dd47aacc Mon Sep 17 00:00:00 2001 From: Matias Romeo Date: Thu, 13 Jun 2024 18:22:06 -0300 Subject: [PATCH 2/3] Fix ConsensusParameters::decode --- eosevm/consensus_parameters.cpp | 10 +++++----- silkworm/node/db/access_layer_test.cpp | 8 ++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/eosevm/consensus_parameters.cpp b/eosevm/consensus_parameters.cpp index cb0bb7b4..8948238d 100644 --- a/eosevm/consensus_parameters.cpp +++ b/eosevm/consensus_parameters.cpp @@ -62,12 +62,12 @@ std::optional ConsensusParameters::decode(silkworm::ByteVie // Parse according to version. For now, only 0. switch (version) { case 0: { - constexpr size_t size_before_fee_param = sizeof(uint64_t); - SILKWORM_ASSERT(encoded.length() > size_before_fee_param); - config.gas_fee_parameters = GasFeeParameters::decode(silkworm::ByteView{&encoded[size_before_fee_param], encoded.length() - size_before_fee_param}); + config.gas_fee_parameters = GasFeeParameters::decode(silkworm::ByteView{&encoded[sizeof(uint64_t)], encoded.length() - sizeof(uint64_t)}); break; - } - default: SILKWORM_ASSERT(version <= 0); + } + default: { + SILKWORM_ASSERT(false); + } } return config; diff --git a/silkworm/node/db/access_layer_test.cpp b/silkworm/node/db/access_layer_test.cpp index dd0b903e..97dcd71d 100644 --- a/silkworm/node/db/access_layer_test.cpp +++ b/silkworm/node/db/access_layer_test.cpp @@ -949,6 +949,14 @@ TEST_CASE("ConsensusParameters") { } }; + auto tmp = value1.encode(); + REQUIRE_THROWS(eosevm::ConsensusParameters::decode({})); + + ByteView bv{tmp}; + REQUIRE_NOTHROW(eosevm::ConsensusParameters::decode(bv)); + + REQUIRE_THROWS(eosevm::ConsensusParameters::decode(ByteView{bv.data(), bv.size()-1})); + constexpr eosevm::ConsensusParameters value2{ .gas_fee_parameters = eosevm::GasFeeParameters{ .gas_txnewaccount = 2, From 97b2a417b3d03539617b0476aeb51a09681cad4c Mon Sep 17 00:00:00 2001 From: Matias Romeo Date: Mon, 17 Jun 2024 15:37:36 -0300 Subject: [PATCH 3/3] Remove SILKWORM_ASSERT/std::abort() tests for ConsensusParameters::decode --- silkworm/node/db/access_layer_test.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/silkworm/node/db/access_layer_test.cpp b/silkworm/node/db/access_layer_test.cpp index 97dcd71d..71fdfb9c 100644 --- a/silkworm/node/db/access_layer_test.cpp +++ b/silkworm/node/db/access_layer_test.cpp @@ -950,13 +950,10 @@ TEST_CASE("ConsensusParameters") { }; auto tmp = value1.encode(); - REQUIRE_THROWS(eosevm::ConsensusParameters::decode({})); ByteView bv{tmp}; REQUIRE_NOTHROW(eosevm::ConsensusParameters::decode(bv)); - REQUIRE_THROWS(eosevm::ConsensusParameters::decode(ByteView{bv.data(), bv.size()-1})); - constexpr eosevm::ConsensusParameters value2{ .gas_fee_parameters = eosevm::GasFeeParameters{ .gas_txnewaccount = 2,