From 5c88e74c08bf2c15d230b8b05d959809065a2894 Mon Sep 17 00:00:00 2001 From: andri lim Date: Wed, 13 Sep 2023 01:16:04 +0700 Subject: [PATCH] Bump stint to v2.0: new array backend (#5113) * bump stint to v2.0: new array backend * Fix missing isEven in libnimbus_lc.nim * bump nim-stint: compiles with arm64 --- beacon_chain/el/el_manager.nim | 4 ++-- beacon_chain/libnimbus_lc/libnimbus_lc.nim | 3 +++ beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim | 2 +- beacon_chain/spec/eth2_apis/rest_light_client_calls.nim | 2 +- beacon_chain/spec/eth2_merkleization.nim | 1 + tests/slashing_protection/test_slashing_protection_db.nim | 4 ++-- tests/test_attestation_pool.nim | 2 +- vendor/nim-stint | 2 +- 8 files changed, 12 insertions(+), 8 deletions(-) diff --git a/beacon_chain/el/el_manager.nim b/beacon_chain/el/el_manager.nim index 9cec29915..be5f95195 100644 --- a/beacon_chain/el/el_manager.nim +++ b/beacon_chain/el/el_manager.nim @@ -10,11 +10,11 @@ import std/[deques, strformat, strutils, sequtils, tables, typetraits, uri, json], # Nimble packages: - chronos, metrics, chronicles/timings, stint/endians2, + chronos, metrics, chronicles/timings, json_rpc/[client, errors], web3, web3/ethhexstrings, web3/engine_api, eth/common/[eth_types, transaction], - eth/async_utils, stew/[assign2, byteutils, objects, results, shims/hashes], + eth/async_utils, stew/[assign2, byteutils, objects, results, shims/hashes, endians2], # Local modules: ../spec/[deposit_snapshots, eth2_merkleization, forks, helpers], ../spec/datatypes/[base, phase0, bellatrix, deneb], diff --git a/beacon_chain/libnimbus_lc/libnimbus_lc.nim b/beacon_chain/libnimbus_lc/libnimbus_lc.nim index 591996507..a18d0678d 100644 --- a/beacon_chain/libnimbus_lc/libnimbus_lc.nim +++ b/beacon_chain/libnimbus_lc/libnimbus_lc.nim @@ -1561,6 +1561,9 @@ proc ETHTransactionsCreateFromJson( if data.hash.asEth2Digest != hash: return nil + template isEven(x: int64): bool = + (x and 1) == 0 + # Compute from execution address var rawSig {.noinit.}: array[65, byte] rawSig[0 ..< 32] = tx.R.toBytesBE() diff --git a/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim b/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim index aa9066643..e562193d6 100644 --- a/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim +++ b/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim @@ -6,7 +6,7 @@ # at your option. This file may not be copied, modified, or distributed except according to those terms. import std/[typetraits, strutils] -import stew/[assign2, results, base10, byteutils], presto/common, +import stew/[assign2, results, base10, byteutils, endians2], presto/common, libp2p/peerid, serialization, json_serialization, json_serialization/std/[options, net, sets], chronicles diff --git a/beacon_chain/spec/eth2_apis/rest_light_client_calls.nim b/beacon_chain/spec/eth2_apis/rest_light_client_calls.nim index a164296fa..3fb504d6f 100644 --- a/beacon_chain/spec/eth2_apis/rest_light_client_calls.nim +++ b/beacon_chain/spec/eth2_apis/rest_light_client_calls.nim @@ -8,7 +8,7 @@ import chronos, - stew/results, + stew/[results, endians2], presto/client, ../helpers, "."/[rest_common, eth2_rest_serialization] diff --git a/beacon_chain/spec/eth2_merkleization.nim b/beacon_chain/spec/eth2_merkleization.nim index 1858397e0..f01173f0d 100644 --- a/beacon_chain/spec/eth2_merkleization.nim +++ b/beacon_chain/spec/eth2_merkleization.nim @@ -10,6 +10,7 @@ # Import this module to get access to `hash_tree_root` for spec types import + stew/endians2, ssz_serialization/[merkleization, proofs], ./ssz_codec diff --git a/tests/slashing_protection/test_slashing_protection_db.nim b/tests/slashing_protection/test_slashing_protection_db.nim index 242f5d487..7e5454001 100644 --- a/tests/slashing_protection/test_slashing_protection_db.nim +++ b/tests/slashing_protection/test_slashing_protection_db.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2018-2022 Status Research & Development GmbH +# Copyright (c) 2018-2023 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0) # * MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT) @@ -12,7 +12,7 @@ import std/[os], # Status lib eth/db/[kvstore, kvstore_sqlite3], - stew/results, + stew/[results, endians2], # Internal ../../beacon_chain/validators/slashing_protection, ../../beacon_chain/spec/[helpers], diff --git a/tests/test_attestation_pool.nim b/tests/test_attestation_pool.nim index 6a5ad558d..cc7f0f78d 100644 --- a/tests/test_attestation_pool.nim +++ b/tests/test_attestation_pool.nim @@ -12,7 +12,7 @@ import # Status lib unittest2, chronicles, chronos, - stew/byteutils, + stew/[byteutils, endians2], taskpools, # Internal ../beacon_chain/gossip_processing/[gossip_validation], diff --git a/vendor/nim-stint b/vendor/nim-stint index 94fc521ee..54e24cae4 160000 --- a/vendor/nim-stint +++ b/vendor/nim-stint @@ -1 +1 @@ -Subproject commit 94fc521ee0f1e113d09ceeaa3568d4d7a6c0b67d +Subproject commit 54e24cae415b1bed39a987ecd08c19a34f740972