mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-12 13:24:21 +00:00
Cache offers in json rpc APIs.
This commit is contained in:
parent
64045655a8
commit
a76d7122e4
@ -116,7 +116,7 @@ proc installPortalBeaconApiHandlers*(rpcServer: RpcServer, p: PortalProtocol) =
|
||||
contentId = p.toContentId(key).valueOr:
|
||||
raise invalidKeyErr()
|
||||
|
||||
p.storeContent(key, contentId, contentValueBytes)
|
||||
p.storeContent(key, contentId, contentValueBytes, cacheOffer = true)
|
||||
|
||||
rpcServer.rpc("portal_beaconLocalContent") do(contentKey: string) -> string:
|
||||
let
|
||||
|
@ -116,7 +116,7 @@ proc installPortalHistoryApiHandlers*(rpcServer: RpcServer, p: PortalProtocol) =
|
||||
contentId = p.toContentId(key).valueOr:
|
||||
raise invalidKeyErr()
|
||||
|
||||
p.storeContent(key, contentId, contentValueBytes)
|
||||
p.storeContent(key, contentId, contentValueBytes, cacheOffer = true)
|
||||
|
||||
rpcServer.rpc("portal_historyLocalContent") do(contentKey: string) -> string:
|
||||
let
|
||||
|
@ -137,7 +137,7 @@ proc installPortalStateApiHandlers*(rpcServer: RpcServer, p: PortalProtocol) =
|
||||
contentValue = validateOfferGetValue(Opt.none(Hash32), key, contentBytes).valueOr:
|
||||
raise invalidValueErr()
|
||||
|
||||
p.storeContent(keyBytes, contentId, contentValue)
|
||||
p.storeContent(keyBytes, contentId, contentValue, cacheOffer = true)
|
||||
|
||||
rpcServer.rpc("portal_stateLocalContent") do(contentKey: string) -> string:
|
||||
let
|
||||
@ -159,7 +159,7 @@ proc installPortalStateApiHandlers*(rpcServer: RpcServer, p: PortalProtocol) =
|
||||
contentValue = validateOfferGetValue(Opt.none(Hash32), key, contentBytes).valueOr:
|
||||
raise invalidValueErr()
|
||||
|
||||
p.storeContent(keyBytes, contentId, contentValue)
|
||||
p.storeContent(keyBytes, contentId, contentValue, cacheOffer = true)
|
||||
|
||||
await p.neighborhoodGossip(
|
||||
Opt.none(NodeId), ContentKeysList(@[keyBytes]), @[contentBytes]
|
||||
|
Loading…
x
Reference in New Issue
Block a user