* export kvstore from beacon_chain_db
* fix rest HashList deserialization
* fix asTrusted
This commit is contained in:
Jacek Sieka 2021-09-27 11:24:58 +02:00 committed by GitHub
parent 71da905629
commit e47a8cbe42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 12 additions and 15 deletions

View File

@ -17,7 +17,9 @@ import
./spec/datatypes/[phase0, altair],
./filepath
export phase0, altair, eth2_ssz_serialization, eth2_merkleization
export
phase0, altair, eth2_ssz_serialization, eth2_merkleization, kvstore,
kvstore_sqlite3
logScope: topics = "bc_db"

View File

@ -15,7 +15,7 @@ import
".."/[beacon_clock],
../spec/[eth2_merkleization, forks, helpers, signatures, signatures_batch, state_transition],
../spec/datatypes/[phase0, altair],
"."/[block_pools_types, blockchain_dag, block_quarantine]
"."/[blockchain_dag, block_quarantine]
from libp2p/protocols/pubsub/pubsub import ValidationResult

View File

@ -16,7 +16,7 @@ import
./block_pools_types, blockchain_dag
export
base, extras
base, extras, block_pools_types
# Spec functions implemented based on cached values instead of the full state
func count_active_validators*(epochInfo: EpochRef): uint64 =

View File

@ -19,7 +19,6 @@ import
taskpools,
eth/[keys, async_utils], eth/net/nat,
eth/db/[kvstore, kvstore_sqlite3],
eth/p2p/discoveryv5/[protocol, enr, random2],
# Local modules
@ -40,8 +39,8 @@ import
beaconstate, forks, helpers, network, weak_subjectivity, signatures,
validator],
./consensus_object_pools/[
blockchain_dag, block_quarantine, block_clearance, block_pools_types,
attestation_pool, sync_committee_msg_pool, exit_pool, spec_cache],
blockchain_dag, block_quarantine, block_clearance, attestation_pool,
sync_committee_msg_pool, exit_pool, spec_cache],
./eth1/eth1_monitor
from eth/common/eth_types import BlockHashOrNumber

View File

@ -541,6 +541,7 @@ proc writeValue*(writer: var JsonWriter[RestJson], value: HashArray) {.
proc readValue*(reader: var JsonReader[RestJson], value: var HashList) {.
raises: [IOError, SerializationError, Defect].} =
readValue(reader, value.data)
value.resetCache()
proc writeValue*(writer: var JsonWriter[RestJson], value: HashList) {.
raises: [IOError, Defect].} =

View File

@ -317,7 +317,7 @@ template asTrusted*(x: altair.SignedBeaconBlock or altair.SigVerifiedBeaconBlock
altair.TrustedSignedBeaconBlock =
isomorphicCast[altair.TrustedSignedBeaconBlock](x)
template asTrusted*(x: ForkedSignedBeaconBlock): ForkedSignedBeaconBlock =
template asTrusted*(x: ForkedSignedBeaconBlock): ForkedTrustedSignedBeaconBlock =
isomorphicCast[ForkedTrustedSignedBeaconBlock](x)
template withBlck*(x: ForkedBeaconBlock | ForkedSignedBeaconBlock | ForkedTrustedSignedBeaconBlock, body: untyped): untyped =

View File

@ -1,8 +1,7 @@
import std/[tables, os, sequtils, strutils]
import chronos, presto, presto/client as presto_client, chronicles, confutils,
json_serialization/std/[options, net],
stew/[base10, results, byteutils],
eth/db/[kvstore, kvstore_sqlite3]
stew/[base10, results, byteutils]
# Local modules
import
@ -21,7 +20,6 @@ export os, tables, sequtils, sequtils, chronos, presto, chronicles, confutils,
export rest_beacon_client,
phase0, altair, helpers, signatures, validator, eth2_merkleization,
beacon_clock,
kvstore, kvstore_sqlite3,
keystore_management, slashing_protection, validator_pool,
beacon_node_types

View File

@ -20,7 +20,7 @@ import
./slashing_protection_v1,
./slashing_protection_v2
export slashing_protection_common
export slashing_protection_common, kvstore, kvstore_sqlite3
# Generic sandwich
export chronicles

View File

@ -11,9 +11,7 @@ import
# Stdlib
std/[typetraits, strutils, algorithm],
# Status
eth/db/[kvstore, kvstore_sqlite3],
stew/results,
stew/byteutils,
stew/[byteutils, results],
serialization,
json_serialization,
chronicles,

View File

@ -11,7 +11,6 @@ import
std/[tables, json, streams],
chronos, chronicles, metrics,
json_serialization/std/[sets, net],
eth/db/[kvstore, kvstore_sqlite3],
../spec/[signatures, helpers],
../spec/datatypes/[phase0, altair],
../beacon_node_types,