Skip to content

Commit

Permalink
db: fix Windows build after PR 2686 (#2689)
Browse files Browse the repository at this point in the history
  • Loading branch information
canepat authored Jan 31, 2025
1 parent cd80428 commit 204a86e
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion silkworm/db/blocks/bodies/body_queries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

namespace silkworm::snapshots {

using BodyFindByBlockNumSegmentQuery = FindByIdSegmentQuery<BodySegmentWordDecoder, &db::blocks::kBodySegmentAndIdxNames>;
using BodyFindByBlockNumSegmentQuery = FindByIdSegmentQuery<BodySegmentWordDecoder, db::blocks::kBodySegmentAndIdxNames>;

struct BodyFindByBlockNumQuery : public FindByTimestampMapQuery<BodyFindByBlockNumSegmentQuery> {
using FindByTimestampMapQuery::FindByTimestampMapQuery;
Expand Down
4 changes: 2 additions & 2 deletions silkworm/db/blocks/headers/header_queries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace silkworm::snapshots {

using HeaderFindByBlockNumSegmentQuery = FindByIdSegmentQuery<HeaderSegmentWordDecoder, &db::blocks::kHeaderSegmentAndIdxNames>;
using HeaderFindByBlockNumSegmentQuery = FindByIdSegmentQuery<HeaderSegmentWordDecoder, db::blocks::kHeaderSegmentAndIdxNames>;

struct HeaderFindByBlockNumQuery : public FindByTimestampMapQuery<HeaderFindByBlockNumSegmentQuery> {
using FindByTimestampMapQuery::FindByTimestampMapQuery;
Expand All @@ -32,7 +32,7 @@ struct HeaderFindByBlockNumQuery : public FindByTimestampMapQuery<HeaderFindByBl
}
};

using HeaderFindByHashSegmentQuery = FindByHashSegmentQuery<HeaderSegmentWordDecoder, &db::blocks::kHeaderSegmentAndIdxNames>;
using HeaderFindByHashSegmentQuery = FindByHashSegmentQuery<HeaderSegmentWordDecoder, db::blocks::kHeaderSegmentAndIdxNames>;
using HeaderFindByHashQuery = FindMapQuery<HeaderFindByHashSegmentQuery>;

} // namespace silkworm::snapshots
8 changes: 4 additions & 4 deletions silkworm/db/blocks/transactions/txn_queries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@

namespace silkworm::snapshots {

using TransactionFindByIdSegmentQuery = FindByIdSegmentQuery<TransactionSegmentWordDecoder, &db::blocks::kTxnSegmentAndIdxNames>;
using TransactionFindByHashSegmentQuery = FindByHashSegmentQuery<TransactionSegmentWordDecoder, &db::blocks::kTxnSegmentAndIdxNames>;
using TransactionFindByIdSegmentQuery = FindByIdSegmentQuery<TransactionSegmentWordDecoder, db::blocks::kTxnSegmentAndIdxNames>;
using TransactionFindByHashSegmentQuery = FindByHashSegmentQuery<TransactionSegmentWordDecoder, db::blocks::kTxnSegmentAndIdxNames>;

using TransactionRangeFromIdSegmentQuery = RangeFromIdSegmentQuery<TransactionSegmentWordDecoder, &db::blocks::kTxnSegmentAndIdxNames>;
using TransactionRangeFromIdSegmentQuery = RangeFromIdSegmentQuery<TransactionSegmentWordDecoder, db::blocks::kTxnSegmentAndIdxNames>;
using TransactionRangeFromIdQuery = FindByTimestampMapQuery<TransactionRangeFromIdSegmentQuery>;

using TransactionPayloadRlpRangeFromIdSegmentQuery = RangeFromIdSegmentQuery<TransactionSegmentWordPayloadRlpDecoder<Bytes>, &db::blocks::kTxnSegmentAndIdxNames>;
using TransactionPayloadRlpRangeFromIdSegmentQuery = RangeFromIdSegmentQuery<TransactionSegmentWordPayloadRlpDecoder<Bytes>, db::blocks::kTxnSegmentAndIdxNames>;
using TransactionPayloadRlpRangeFromIdQuery = FindByTimestampMapQuery<TransactionPayloadRlpRangeFromIdSegmentQuery>;

class TransactionBlockNumByTxnHashSegmentQuery {
Expand Down
6 changes: 3 additions & 3 deletions silkworm/db/datastore/domain_get_as_of_query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ namespace silkworm::datastore {
template <
kvdb::EncoderConcept TKeyEncoder1, snapshots::EncoderConcept TKeyEncoder2,
kvdb::DecoderConcept TValueDecoder1, snapshots::DecoderConcept TValueDecoder2,
const snapshots::SegmentAndAccessorIndexNames* history_segment_names>
const snapshots::SegmentAndAccessorIndexNames& history_segment_names>
struct DomainGetAsOfQuery {
DomainGetAsOfQuery(
kvdb::Domain kvdb_entity,
kvdb::ROTxn& tx,
const snapshots::SnapshotRepositoryROAccess& repository)
: query1_{*kvdb_entity.history, tx, repository},
query2_{history_segment_names->front(), kvdb_entity, tx, repository} {}
query2_{history_segment_names.front(), kvdb_entity, tx, repository} {}

DomainGetAsOfQuery(
const kvdb::DatabaseRef& database,
kvdb::ROTxn& tx,
const snapshots::SnapshotRepositoryROAccess& repository)
: query1_{database, tx, repository},
query2_{history_segment_names->front(), database, tx, repository} {}
query2_{history_segment_names.front(), database, tx, repository} {}

using Key = decltype(TKeyEncoder1::value);
using Value = decltype(TValueDecoder1::value);
Expand Down
4 changes: 2 additions & 2 deletions silkworm/db/datastore/history_get_query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace silkworm::datastore {
template <
kvdb::EncoderConcept TKeyEncoder1, snapshots::EncoderConcept TKeyEncoder2,
kvdb::DecoderConcept TValueDecoder1, snapshots::DecoderConcept TValueDecoder2,
const snapshots::SegmentAndAccessorIndexNames* segment_names>
const snapshots::SegmentAndAccessorIndexNames& segment_names>
struct HistoryGetQuery {
HistoryGetQuery(
kvdb::History kvdb_entity,
Expand All @@ -39,7 +39,7 @@ struct HistoryGetQuery {
kvdb::ROTxn& tx,
const snapshots::SnapshotRepositoryROAccess& repository)
: HistoryGetQuery{
database.domain(segment_names->front()).history.value(),
database.domain(segment_names.front()).history.value(),
tx,
repository,
} {}
Expand Down
12 changes: 6 additions & 6 deletions silkworm/db/datastore/snapshots/basic_queries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace silkworm::snapshots {

template <
DecoderConcept TDecoder,
const SegmentAndAccessorIndexNames* segment_names>
const SegmentAndAccessorIndexNames& segment_names>
class BasicSegmentQuery {
public:
explicit BasicSegmentQuery(
Expand All @@ -39,7 +39,7 @@ class BasicSegmentQuery {
index_{segment_and_index.index} {}

explicit BasicSegmentQuery(const SegmentAndAccessorIndexProvider& bundle)
: BasicSegmentQuery{bundle.segment_and_accessor_index(*segment_names)} {}
: BasicSegmentQuery{bundle.segment_and_accessor_index(segment_names)} {}

protected:
segment::SegmentReader<TDecoder> reader_;
Expand All @@ -48,7 +48,7 @@ class BasicSegmentQuery {

template <
DecoderConcept TDecoder,
const SegmentAndAccessorIndexNames* segment_names>
const SegmentAndAccessorIndexNames& segment_names>
struct FindByIdSegmentQuery : public BasicSegmentQuery<TDecoder, segment_names> {
using BasicSegmentQuery<TDecoder, segment_names>::BasicSegmentQuery;

Expand All @@ -65,7 +65,7 @@ struct FindByIdSegmentQuery : public BasicSegmentQuery<TDecoder, segment_names>
template <
EncoderConcept TKeyEncoder,
DecoderConcept TValueDecoder,
const SegmentAndAccessorIndexNames* segment_names>
const SegmentAndAccessorIndexNames& segment_names>
struct FindByKeySegmentQuery : public BasicSegmentQuery<TValueDecoder, segment_names> {
using BasicSegmentQuery<TValueDecoder, segment_names>::BasicSegmentQuery;

Expand All @@ -87,7 +87,7 @@ struct FindByKeySegmentQuery : public BasicSegmentQuery<TValueDecoder, segment_n

template <
DecoderConcept TDecoder,
const SegmentAndAccessorIndexNames* segment_names>
const SegmentAndAccessorIndexNames& segment_names>
struct FindByHashSegmentQuery : public BasicSegmentQuery<TDecoder, segment_names> {
using BasicSegmentQuery<TDecoder, segment_names>::BasicSegmentQuery;

Expand All @@ -110,7 +110,7 @@ struct FindByHashSegmentQuery : public BasicSegmentQuery<TDecoder, segment_names

template <
DecoderConcept TDecoder,
const SegmentAndAccessorIndexNames* segment_names>
const SegmentAndAccessorIndexNames& segment_names>
struct RangeFromIdSegmentQuery : public BasicSegmentQuery<TDecoder, segment_names> {
using BasicSegmentQuery<TDecoder, segment_names>::BasicSegmentQuery;

Expand Down
4 changes: 2 additions & 2 deletions silkworm/db/datastore/snapshots/history_get_query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ namespace silkworm::snapshots {
template <
EncoderConcept TKeyEncoder,
DecoderConcept TValueDecoder,
const SegmentAndAccessorIndexNames* segment_names>
const SegmentAndAccessorIndexNames& segment_names>
struct HistoryGetQuery {
explicit HistoryGetQuery(const SnapshotRepositoryROAccess& repository)
: timestamp_query_{
repository,
[](const SnapshotBundle& bundle) { return bundle.domain(segment_names->front()).history->inverted_index; },
[](const SnapshotBundle& bundle) { return bundle.domain(segment_names.front()).history->inverted_index; },
},
value_query_{repository} {}

Expand Down
4 changes: 2 additions & 2 deletions silkworm/db/state/accounts_domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ struct AccountsDomainDeleteQuery : datastore::kvdb::DomainDeleteQuery<AddressKVD
using AccountsHistoryGetQuery = datastore::HistoryGetQuery<
AddressKVDBEncoder, AddressSnapshotsEncoder,
AccountKVDBCodec, AccountSnapshotsCodec,
&kHistorySegmentAndIdxNamesAccounts>;
kHistorySegmentAndIdxNamesAccounts>;

using AccountsDomainGetAsOfQuery = datastore::DomainGetAsOfQuery<
AddressKVDBEncoder, AddressSnapshotsEncoder,
AccountKVDBCodec, AccountSnapshotsCodec,
&kHistorySegmentAndIdxNamesAccounts>;
kHistorySegmentAndIdxNamesAccounts>;

} // namespace silkworm::db::state
4 changes: 2 additions & 2 deletions silkworm/db/state/code_domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ struct CodeDomainDeleteQuery : datastore::kvdb::DomainDeleteQuery<AddressKVDBEnc
using CodeHistoryGetQuery = datastore::HistoryGetQuery<
AddressKVDBEncoder, AddressSnapshotsEncoder,
datastore::kvdb::RawDecoder<Bytes>, snapshots::RawDecoder<Bytes>,
&kHistorySegmentAndIdxNamesCode>;
kHistorySegmentAndIdxNamesCode>;

using CodeDomainGetAsOfQuery = datastore::DomainGetAsOfQuery<
AddressKVDBEncoder, AddressSnapshotsEncoder,
datastore::kvdb::RawDecoder<Bytes>, snapshots::RawDecoder<Bytes>,
&kHistorySegmentAndIdxNamesCode>;
kHistorySegmentAndIdxNamesCode>;

} // namespace silkworm::db::state
4 changes: 2 additions & 2 deletions silkworm/db/state/commitment_domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ struct CommitmentDomainDeleteQuery : datastore::kvdb::DomainDeleteQuery<datastor
using CommitmentHistoryGetQuery = datastore::HistoryGetQuery<
datastore::kvdb::RawEncoder<ByteView>, snapshots::RawEncoder<ByteView>,
datastore::kvdb::RawDecoder<Bytes>, snapshots::RawDecoder<Bytes>,
&kHistorySegmentAndIdxNamesCommitment>;
kHistorySegmentAndIdxNamesCommitment>;

using CommitmentDomainGetAsOfQuery = datastore::DomainGetAsOfQuery<
datastore::kvdb::RawEncoder<ByteView>, snapshots::RawEncoder<ByteView>,
datastore::kvdb::RawDecoder<Bytes>, snapshots::RawDecoder<Bytes>,
&kHistorySegmentAndIdxNamesCommitment>;
kHistorySegmentAndIdxNamesCommitment>;

} // namespace silkworm::db::state
4 changes: 2 additions & 2 deletions silkworm/db/state/receipts_domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ struct ReceiptsDomainDeleteQuery : datastore::kvdb::DomainDeleteQuery<datastore:
using ReceiptsHistoryGetQuery = datastore::HistoryGetQuery<
datastore::kvdb::RawEncoder<ByteView>, snapshots::RawEncoder<ByteView>,
datastore::kvdb::RawDecoder<Bytes>, snapshots::RawDecoder<Bytes>,
&kHistorySegmentAndIdxNamesReceipts>;
kHistorySegmentAndIdxNamesReceipts>;

using ReceiptsDomainGetAsOfQuery = datastore::DomainGetAsOfQuery<
datastore::kvdb::RawEncoder<ByteView>, snapshots::RawEncoder<ByteView>,
datastore::kvdb::RawDecoder<Bytes>, snapshots::RawDecoder<Bytes>,
&kHistorySegmentAndIdxNamesReceipts>;
kHistorySegmentAndIdxNamesReceipts>;

} // namespace silkworm::db::state
4 changes: 2 additions & 2 deletions silkworm/db/state/storage_domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ struct StorageDomainDeleteQuery : datastore::kvdb::DomainDeleteQuery<StorageAddr
using StorageHistoryGetQuery = datastore::HistoryGetQuery<
StorageAddressAndLocationKVDBEncoder, StorageAddressAndLocationSnapshotsCodec,
Bytes32KVDBCodec, Bytes32SnapshotsCodec,
&kHistorySegmentAndIdxNamesStorage>;
kHistorySegmentAndIdxNamesStorage>;

using StorageDomainGetAsOfQuery = datastore::DomainGetAsOfQuery<
StorageAddressAndLocationKVDBEncoder, StorageAddressAndLocationSnapshotsCodec,
Bytes32KVDBCodec, Bytes32SnapshotsCodec,
&kHistorySegmentAndIdxNamesStorage>;
kHistorySegmentAndIdxNamesStorage>;

} // namespace silkworm::db::state

0 comments on commit 204a86e

Please sign in to comment.