* 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], ./spec/datatypes/[phase0, altair],
./filepath ./filepath
export phase0, altair, eth2_ssz_serialization, eth2_merkleization export
phase0, altair, eth2_ssz_serialization, eth2_merkleization, kvstore,
kvstore_sqlite3
logScope: topics = "bc_db" logScope: topics = "bc_db"

View File

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

View File

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

View File

@ -19,7 +19,6 @@ import
taskpools, taskpools,
eth/[keys, async_utils], eth/net/nat, eth/[keys, async_utils], eth/net/nat,
eth/db/[kvstore, kvstore_sqlite3],
eth/p2p/discoveryv5/[protocol, enr, random2], eth/p2p/discoveryv5/[protocol, enr, random2],
# Local modules # Local modules
@ -40,8 +39,8 @@ import
beaconstate, forks, helpers, network, weak_subjectivity, signatures, beaconstate, forks, helpers, network, weak_subjectivity, signatures,
validator], validator],
./consensus_object_pools/[ ./consensus_object_pools/[
blockchain_dag, block_quarantine, block_clearance, block_pools_types, blockchain_dag, block_quarantine, block_clearance, attestation_pool,
attestation_pool, sync_committee_msg_pool, exit_pool, spec_cache], sync_committee_msg_pool, exit_pool, spec_cache],
./eth1/eth1_monitor ./eth1/eth1_monitor
from eth/common/eth_types import BlockHashOrNumber 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) {. proc readValue*(reader: var JsonReader[RestJson], value: var HashList) {.
raises: [IOError, SerializationError, Defect].} = raises: [IOError, SerializationError, Defect].} =
readValue(reader, value.data) readValue(reader, value.data)
value.resetCache()
proc writeValue*(writer: var JsonWriter[RestJson], value: HashList) {. proc writeValue*(writer: var JsonWriter[RestJson], value: HashList) {.
raises: [IOError, Defect].} = raises: [IOError, Defect].} =

View File

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

View File

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

View File

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

View File

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

View File

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