diff --git a/packages/validator/src/slashingProtection/attestation/attestationByTargetRepository.ts b/packages/validator/src/slashingProtection/attestation/attestationByTargetRepository.ts index b825e153e568..b69d4ff992df 100644 --- a/packages/validator/src/slashingProtection/attestation/attestationByTargetRepository.ts +++ b/packages/validator/src/slashingProtection/attestation/attestationByTargetRepository.ts @@ -45,10 +45,10 @@ export class AttestationByTargetRepository { async getAll(pubkey: BLSPubkey, limit?: number): Promise { const attestations = await this.db.values({ - ...this.dbReqOpts, limit, gte: this.encodeKey(pubkey, 0), lt: this.encodeKey(pubkey, Number.MAX_SAFE_INTEGER), + bucketId: this.bucketId, }); return attestations.map((attestation) => this.type.deserialize(attestation)); } @@ -69,7 +69,7 @@ export class AttestationByTargetRepository { } async listPubkeys(): Promise { - const keys = await this.db.keys({...this.dbReqOpts, gte: this.minKey, lt: this.maxKey}); + const keys = await this.db.keys({gte: this.minKey, lt: this.maxKey, bucketId: this.bucketId}); return uniqueVectorArr(keys.map((key) => this.decodeKey(key).pubkey)); } diff --git a/packages/validator/src/slashingProtection/block/blockBySlotRepository.ts b/packages/validator/src/slashingProtection/block/blockBySlotRepository.ts index 366ef0088c63..f51ee0cf5990 100644 --- a/packages/validator/src/slashingProtection/block/blockBySlotRepository.ts +++ b/packages/validator/src/slashingProtection/block/blockBySlotRepository.ts @@ -44,10 +44,10 @@ export class BlockBySlotRepository { async getAll(pubkey: BLSPubkey, limit?: number): Promise { const blocks = await this.db.values({ - ...this.dbReqOpts, limit, gte: this.encodeKey(pubkey, 0), lt: this.encodeKey(pubkey, Number.MAX_SAFE_INTEGER), + bucketId: this.bucketId, }); return blocks.map((block) => this.type.deserialize(block)); } @@ -73,7 +73,7 @@ export class BlockBySlotRepository { } async listPubkeys(): Promise { - const keys = await this.db.keys({...this.dbReqOpts, gte: this.minKey, lt: this.maxKey}); + const keys = await this.db.keys({gte: this.minKey, lt: this.maxKey, bucketId: this.bucketId}); return uniqueVectorArr(keys.map((key) => this.decodeKey(key).pubkey)); }