Skip to content

Conversation

@adshmh
Copy link
Contributor

@adshmh adshmh commented Sep 11, 2025

Summary

Report Solana batch requests to data pipeline

Primary Changes:

  • Modified setLegacyFieldsFromQoSSolanaObservations to return multiple legacyRecord entries for batch JSON-RPC requests
  • Added endpoint observation tracking for each request in Solana batch JSON-RPC requests
  • Updated function signature to handle batch requests by creating separate records per request index

Secondary Changes:

  • Added comprehensive TODO comments throughout codebase documenting technical debt and future improvements
  • Added newline to end of evm.proto file
  • Included TODO comment in Tiltfile about adding data pipeline to local development mode

Issue

Each request of a batch JSONRPC request should be reported to the data pipeline.

  • Issue or PR: #{ISSUE_OR_PR_NUMBER}

Type of change

Select one or more from the following:

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Documentation
  • Other (specify)

QoS Checklist

E2E Validation & Tests

  • make path_up
  • make test_e2e_evm_shannon

Observability

  • 1. make path_up
  • 2. Run the following E2E test: make test_request__shannon_relay_util_100
  • 3. View results in LocalNet's PATH Relay Grafana Dashboard

Sanity Checklist

  • I have updated the GitHub Issue assignees, reviewers, labels, project, iteration and milestone
  • For docs, I have run make docusaurus_start
  • For code, I have run make test_all
  • For configurations, I have updated the documentation
  • I added TODOs where applicable

@adshmh adshmh added this to the Quality of Service milestone Sep 11, 2025
@adshmh adshmh self-assigned this Sep 11, 2025
@adshmh adshmh added solana Intended to improve solana support observability Observability catch-all labels Sep 11, 2025
return []*legacyRecord{record}
}

// TODO_UPNEXT(@adshmh): Track and report the `method` field of each JSONRPC request in a batch.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great TODOs.

// TODO_TECHDEBT(@adshmh): Track each request of a batch JSONRPC request separately in proto messages.
// TODO_TECHDEBT(@adshmh): Include a num_requests fields for batch JSONRPC requests once data pipeline is refactored.
endpointObservations := observations.GetEndpointObservations()
// 0 or 1 endpoint observations: not a batch JSONRPC request.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a TODO to ensure different code paths for batch and non batch requests up the stack?

// Create a separate legacy record for each method
var legacyRecords []*legacyRecord
for index := range endpointObservations {
// Create a copy of the base record
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#PUC why

legacyRecord.ErrorMessage = errType
// TODO_UPNEXT(@adshmh): Track and report errors on each request of a JSONRPC batch request.
//
// Create a separate legacy record for each method
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a TODO on when we migrate off of legacy records?

// Create a copy of the base record
recordCopy := *record

// Track the index of the request to ensure correctness of records.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels wrong. We shouldn't be overriding the ChainMethod.

Do one or more of the following:

  1. Add a new field
  2. Log it
  3. Append it to the existing ChainMethod name

import "path/qos/request_origin.proto";
import "path/qos/request_error.proto";

// TODO_TECHDEBT(@adshmh): Reorganize the messages to be consistent with both single and batch JSONRPC requests:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't fully understand this TODO.

IMO it should say something similar to "Create an independent Request Observation for each request in a batch"

optional string error_details = 3;
}

// TODO_TECHDEBT(@adshmh): Enhance the endpoint observation to include the corresponding request's details (e.g. method field of JSONRPC)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this confusing.

We have EVMRequestObservation which has this data.

EVMRequestObservation contains an EVMEndpointObervation.

This feels like it would be duplicating the smae metadata.

// This requires mapping each endpoint response to its corresponding request in the batch.
//
endpointObs := &qosobservations.SolanaEndpointObservation{
// TODO_DOCUMENT(@adshmh): Add a reference for the choice of HTTP status code on batch requests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't fully understand why we're calling everything 200 right now.

Please explain.

I feel like we already have a mapper somewhere we can use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

observability Observability catch-all solana Intended to improve solana support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants