@@ -10,6 +10,7 @@ import (
1010 pathhttp "github.com/buildwithgrove/path/network/http"
1111 qosobservations "github.com/buildwithgrove/path/observation/qos"
1212 "github.com/buildwithgrove/path/protocol"
13+ "github.com/buildwithgrove/path/qos"
1314 "github.com/buildwithgrove/path/qos/jsonrpc"
1415)
1516
@@ -218,13 +219,20 @@ func (rc requestContext) GetObservations() qosobservations.Observations {
218219 // Convert endpoint selection validation results to proto format
219220 validationResults := rc .convertValidationResults ()
220221
222+ var requestError * qosobservations.RequestError
223+ // Set request error as protocol-level error if no endpoint responses were received.
224+ if len (rc .endpointResponses ) == 0 {
225+ requestError = qos .GetRequestErrorForProtocolError ()
226+ }
227+
221228 return qosobservations.Observations {
222229 ServiceObservations : & qosobservations.Observations_Evm {
223230 Evm : & qosobservations.EVMRequestObservations {
224231 ChainId : rc .chainID ,
225232 ServiceId : string (rc .serviceID ),
226233 RequestPayloadLength : uint32 (rc .requestPayloadLength ),
227234 RequestOrigin : rc .requestOrigin ,
235+ RequestError : requestError ,
228236 RequestObservations : requestObservations ,
229237 EndpointSelectionMetadata : & qosobservations.EndpointSelectionMetadata {
230238 RandomEndpointFallback : rc .endpointSelectionMetadata .RandomEndpointFallback ,
@@ -260,9 +268,11 @@ func (rc requestContext) createNoResponseObservations() []*qosobservations.EVMRe
260268 responseNoneObs := responseNoneObj .GetObservation ()
261269
262270 return []* qosobservations.EVMRequestObservation {
263- {EndpointObservations : []* qosobservations.EVMEndpointObservation {
264- & responseNoneObs ,
265- }},
271+ {
272+ EndpointObservations : []* qosobservations.EVMEndpointObservation {
273+ & responseNoneObs ,
274+ },
275+ },
266276 }
267277}
268278
0 commit comments