Skip to content

Commit

Permalink
feat: PRT - adding stateful api header for hanging relays (#1712)
Browse files Browse the repository at this point in the history
  • Loading branch information
ranlavanet authored Sep 25, 2024
1 parent db8248c commit ab51b73
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions protocol/common/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const (
NODE_ERRORS_PROVIDERS_HEADER_NAME = "Lava-Node-Errors-providers"
REPORTED_PROVIDERS_HEADER_NAME = "Lava-Reported-Providers"
USER_REQUEST_TYPE = "lava-user-request-type"
STATEFUL_API_HEADER = "lava-stateful-api"
LAVA_IDENTIFIED_NODE_ERROR_HEADER = "lava-identified-node-error"
LAVAP_VERSION_HEADER_NAME = "Lavap-Version"
LAVA_CONSUMER_PROCESS_GUID = "lava-consumer-process-guid"
Expand Down
9 changes: 9 additions & 0 deletions protocol/rpcconsumer/rpcconsumer_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,15 @@ func (rpccs *RPCConsumerServer) appendHeadersToRelayResult(ctx context.Context,
})
}

// add stateful API (hanging, transactions)
if protocolMessage.GetApi().Category.Stateful == common.CONSISTENCY_SELECT_ALL_PROVIDERS {
metadataReply = append(metadataReply,
pairingtypes.Metadata{
Name: common.STATEFUL_API_HEADER,
Value: "true",
})
}

// add user requested API
metadataReply = append(metadataReply,
pairingtypes.Metadata{
Expand Down

0 comments on commit ab51b73

Please sign in to comment.