ten-nex / archway

Archway Network
https://archway.io
Other
0 stars 0 forks source link

feat(x/callback): Add pagination to grpc query to get all callbacks #5

Open ten-nex opened 2 days ago

ten-nex commented 2 days ago

We should incorporate pagination in x/callback/keeper/grpc_query.go :

    }
    ctx := sdk.UnwrapSDKContext(c)

    callbacks, err := qs.keeper.GetCallbacksByHeight(ctx, request.GetBlockHeight())
ten-nex commented 2 days ago

I've created a pull request to address this issue. Here's a summary of the changes:

Summary of Code Changes:

1. File: x/callback/keeper/grpc_query.go

2. File: x/callback/types/query.proto

3. File: x/callback/types/query.pb.gw.go

Overall

The changes provide an implementation for a gRPC query service which supports callback querying and fee estimation, with fully defined .proto files and corresponding generated gateway code for HTTP handling.

You can view the pull request here: https://github.com/ten-nex/archway/pull/10

ten-nex commented 1 day ago

An error occurred while processing this issue: Error suggesting changes: error, status code: 429, message: Rate limit reached for gpt-4o in organization org-DJhklhUmYyg2JTyyr8Tro4Xo on tokens per min (TPM): Limit 30000, Used 8100, Requested 22253. Please try again in 706ms. Visit https://platform.openai.com/account/rate-limits to learn more.

If this issue persists, please report it to our issues repository: https://github.com/ten-nex/pilot-issues/issues

ten-nex commented 1 day ago

An error occurred while processing this issue: Error cloning repo: repository already exists

If this issue persists, please report it to our issues repository: https://github.com/ten-nex/pilot-issues/issues

ten-nex commented 1 day ago

An error occurred while processing this issue: Error suggesting changes: error, status code: 429, message: Rate limit reached for gpt-4o in organization org-DJhklhUmYyg2JTyyr8Tro4Xo on tokens per min (TPM): Limit 30000, Used 8123, Requested 22253. Please try again in 752ms. Visit https://platform.openai.com/account/rate-limits to learn more.

If this issue persists, please report it to our issues repository: https://github.com/ten-nex/pilot-issues/issues

ten-nex commented 1 day ago

An error occurred while processing this issue: Error suggesting changes: error, status code: 429, message: Rate limit reached for gpt-4o in organization org-DJhklhUmYyg2JTyyr8Tro4Xo on tokens per min (TPM): Limit 30000, Used 25201, Requested 7708. Please try again in 5.818s. Visit https://platform.openai.com/account/rate-limits to learn more.

If this issue persists, please report it to our issues repository: https://github.com/ten-nex/pilot-issues/issues

ten-nex commented 1 day ago

An error occurred while processing this issue: Error committing and pushing changes: repository does not exist

If this issue persists, please report it to our issues repository: https://github.com/ten-nex/pilot-issues/issues

ten-nex commented 1 day ago

An error occurred while processing this issue: Error suggesting changes: error in final OpenAI request: max retries reached

If this issue persists, please report it to our issues repository: https://github.com/ten-nex/pilot-issues/issues

ten-nex commented 1 day ago

An error occurred while processing this issue: Error cloning repo: repository already exists

If this issue persists, please report it to our issues repository: https://github.com/ten-nex/pilot-issues/issues

ten-nex commented 1 day ago

I've created a pull request to address this issue. Here's a summary of the changes:

The code changes introduce a new gRPC query service for the "callback" module, consisting of the following updates:

  1. QueryServer Implementation (x/callback/keeper/grpc_query.go):

    • Added a QueryServer struct to implement the gRPC query service for the "callback" module.
    • Provided methods for querying callbacks (Callbacks), estimating callback fees (EstimateCallbackFees), and fetching module parameters (Params).
    • Integrated pagination support in the Callbacks method.
    • Added error handling for invalid or empty requests.
  2. Protobuf Definitions (x/callback/types/query.proto):

    • Defined QueryCallbacksRequest and QueryCallbacksResponse messages for querying callbacks, incorporating pagination.
    • Added a Callback message to represent individual callback entries.
    • Defined a Query service with an RPC method Callbacks that returns queried callbacks.

These changes together provide structured and efficient querying capabilities for callback data within the "callback" module using gRPC.

You can view the pull request here: https://github.com/ten-nex/archway/pull/15


If you want me to try again, just reassign the issue to me. If I wasn't helpful, please update the issue description with more context.


If you're experiencing any problems with Pilot, please open an issue here: https://github.com/ten-nex/pilot-issues/issues

ten-nex commented 1 day ago

I've created a pull request to address this issue. Here's a summary of the changes:

Summary of Code Changes

  1. x/callback/keeper/grpc_query.go

    • Introduced a new gRPC query service for the callback module.
    • Implemented QueryServer struct and associated methods:
      • Callbacks to query callbacks at a specific block height with pagination.
      • EstimateCallbackFees to estimate fees associated with callbacks.
      • Params to retrieve module parameters.
  2. x/callback/keeper/keeper.go

    • Added Keeper struct to manage callbacks within the module.
    • Implemented GetCallbacksByHeightPaginated to fetch callbacks by height with pagination using Cosmos SDK's KVStore.
  3. x/callback/types/codec.go

    • Registered necessary interfaces and concrete types using Cosmos SDK codec.
    • Set up legacy Amino codec for JSON serialization and protobuf Any for implementations.
  4. x/callback/types/query.proto

    • Defined protobuf messages and service for querying callbacks.
    • Included message structures for query requests and responses, integrating Cosmos SDK's pagination.

You can view the pull request here: https://github.com/ten-nex/archway/pull/16


If you want me to try again, just reassign the issue to me. If I wasn't helpful, please update the issue description with more context.


If you're experiencing any problems with Pilot, please open an issue here: https://github.com/ten-nex/pilot-issues/issues

ten-nex commented 1 day ago

I've created a pull request to address this issue. Here's a summary of the changes:

The code changes introduce a gRPC query service for the callback module, comprising the following updates:

  1. x/callback/keeper/grpc_query.go:

    • Added a QueryServer struct implementing the types.QueryServer interface.
    • Introduced factory method NewQueryServer for creating instances of QueryServer.
    • Implemented methods for querying callbacks (Callbacks), estimating callback fees (EstimateCallbackFees), and retrieving module parameters (Params) with corresponding request validation and error handling.
  2. x/callback/keeper/keeper.go:

    • Defined the Keeper struct and a factory method NewKeeper.
    • Added a method GetCallbacksByHeightPaginated to retrieve callbacks filtered by block height with pagination support. This method processes data from the key-value store using pagination logic.
  3. x/callback/types/query.proto:

    • Defined Protobuf messages QueryCallbacksRequest and QueryCallbacksResponse for querying callbacks, including fields for block height and pagination.
    • Updated the Query service to include the Callbacks RPC method for handling gRPC queries.

These changes collectively enable efficient querying of callback-related data via gRPC, enhancing the modular architecture and improving data retrieval capabilities within the callback module.

You can view the pull request here: https://github.com/ten-nex/archway/pull/18


If you want me to try again, just reassign the issue to me. If I wasn't helpful, please update the issue description with more context.


If you're experiencing any problems with Pilot, please open an issue here: https://github.com/ten-nex/pilot-issues/issues

ten-nex commented 1 day ago

I've created a pull request to address this issue. Here's a summary of the changes:

Summary of Code Changes:

File: x/callback/keeper/grpc_query.go

File: x/callback/keeper/callback.go

File: x/callback/types/callback.pb.go

Overall, these changes improve the gRPC interface for querying callbacks and enhance the callback management system with robust validation and authorization mechanisms.

You can view the pull request here: https://github.com/ten-nex/archway/pull/20


If you want me to try again, just reassign the issue to me. If I wasn't helpful, please update the issue description with more context.


If you're experiencing any problems with Pilot, please open an issue here: https://github.com/ten-nex/pilot-issues/issues