feat(store): allow eligibilityProofHex in store query JSON

Parse optional proof bytes from the query object and skip the outbound
provider hook when proof is already attached (E2E and integrators).
This commit is contained in:
Sergei Tikhomirov 2026-06-18 19:35:47 +02:00
parent df24c8e81c
commit 1f507d5875
No known key found for this signature in database
GPG Key ID: 6A1F8ED9D6538027
2 changed files with 10 additions and 1 deletions

View File

@ -133,7 +133,7 @@ proc logosdelivery_store_query(
let peer = peers.parsePeerInfo(($providerAddr).split(",")).valueOr:
return err("StoreRequest failed to parse peer addr: " & $error)
if not providerCb.isNil:
if storeQueryRequest.eligibilityProof.isNone and not providerCb.isNil:
let canonicalHex = storeEligibilityCanonicalHex(storeQueryRequest)
var outProof = newString(EligibilityOutProofHexMinLen)
outProof.setLen(EligibilityOutProofHexMinLen)

View File

@ -46,6 +46,14 @@ func storeQueryRequestFromJson*(
else:
none(uint64)
var eligibilityProof = none(seq[byte])
if jsonContent.contains("eligibilityProofHex"):
let proofHex = jsonContent["eligibilityProofHex"].getStr()
eligibilityProof = try:
some(proofHex.hexToSeqByte())
except ValueError:
return err("Failed converting eligibilityProofHex to bytes")
let startTime = ?jsonContent.getProtoInt64("timeStart")
let endTime = ?jsonContent.getProtoInt64("timeEnd")
@ -61,5 +69,6 @@ func storeQueryRequestFromJson*(
paginationCursor: paginationCursor,
paginationForward: paginationForward,
paginationLimit: paginationLimit,
eligibilityProof: eligibilityProof,
)
)