Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Session] Adding the Relay type #53

Merged
merged 10 commits into from
Oct 11, 2023
Merged

Conversation

Olshansk
Copy link
Member

@Olshansk Olshansk commented Oct 10, 2023

Summary

Scaffolding & adding the Relay type

Summary generated by Reviewpad on 11 Oct 23 18:07 UTC

This pull request includes the following changes:

  1. In the go.mod file, the dependency google.golang.org/genproto has been removed from the require section.
  2. In the go.mod file, the dependency google.golang.org/genproto has been added to the require section.
  3. A new file named relay.proto has been added in the proto/pocket/service directory. This file contains protobuf message definitions related to relaying requests and responses.
  4. The relay.proto file imports other protobuf files and defines message structures for relay requests, relay responses, and their metadata. It also includes definitions for JSON-RPC request and response payloads, REST request payloads, and REST response payloads.

Please review these changes and provide any necessary feedback.

Issue

Part of #10

Type of change

Select one or more:

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

Testing

  • Run all unit tests: make test_all_unit
  • Verify Localnet manually: See the instructions [here](TODO: add link to instructions)

Sanity Checklist

  • I have tested my changes using the available tooling
  • I have performed a self-review of my own code
  • I have commented my code, updated documentation and left TODOs throughout the codebase

@Olshansk Olshansk added the session Changes related to Session management label Oct 10, 2023
@Olshansk Olshansk self-assigned this Oct 10, 2023
@Olshansk
Copy link
Member Author

@bryanchriswhite @red-0ne This isn't ready to be merged in, but I think it's close and would really appreciate your feedback on the first iteration of its design.

Copy link
Contributor

@red-0ne red-0ne left a comment

Choose a reason for hiding this comment

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

I believe we could have a better categorization of the different properties that would allow for more extensibility too.

I propose something along the following:

RelayRequestMetadata {
  session_header
  signature
}

RelayRequest {
  RelayRequestMetadata meta
  oneof payload {
    JSONRPCRequestPayload ...
    RESTRequestPayload ...
  }
}

RelayResponseMetadata {
  session_header
  supplier_signature
}

RelayResponse {
  RelayResponseMetadata meta
  oneof payload {
    JSONRPCResponsePayload ...
    RESTResponsePayload ...
  }
}

Then each payload would be in terms of request/reply x RPCType

proto/pocket/service/relay.proto Show resolved Hide resolved
proto/pocket/service/relay.proto Outdated Show resolved Hide resolved
proto/pocket/service/relay.proto Outdated Show resolved Hide resolved
@Olshansk Olshansk requested a review from red-0ne October 11, 2023 15:54
Copy link
Contributor

@red-0ne red-0ne left a comment

Choose a reason for hiding this comment

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

This feels great! Just left a question regarding JSONRPCResponsePayload

proto/pocket/service/relay.proto Show resolved Hide resolved
Copy link
Contributor

@red-0ne red-0ne left a comment

Choose a reason for hiding this comment

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

Perfect!

@Olshansk Olshansk marked this pull request as ready for review October 11, 2023 22:55
@Olshansk Olshansk merged commit da5ab73 into main Oct 11, 2023
3 checks passed
@Olshansk Olshansk deleted the issues/10/scaffold_relay_type branch October 11, 2023 22:57
@Olshansk Olshansk changed the title [WIP][Session] Adding the Relay type [Session] Adding the Relay type Oct 11, 2023
bryanchriswhite added a commit that referenced this pull request Oct 13, 2023
* main:
  [Gateway] Scaffold the Gateway type (#57)
  [Gateway] Scaffold Gateway module and nothing else
  fix: post-merge imports
  [Session] Adding the Session type (#54)
  [WIP][Session] Adding the Relay type (#53)
bryanchriswhite added a commit that referenced this pull request Oct 13, 2023
* pokt/main:
  [Gateway] Scaffold the Gateway type (#57)
  [Gateway] Scaffold Gateway module and nothing else
  fix: post-merge imports
  [Session] Adding the Session type (#54)
  [WIP][Session] Adding the Relay type (#53)
bryanchriswhite added a commit that referenced this pull request Oct 13, 2023
* pokt/main: (25 commits)
  [Gateway] Scaffold the Gateway type (#57)
  [Gateway] Scaffold Gateway module and nothing else
  fix: post-merge imports
  [Session] Adding the Session type (#54)
  [WIP][Session] Adding the Relay type (#53)
  refactor: move `Supplier` protobuf type to `pocket.shared` package (x/shared/types/)
  Reply to final comments and make things compile
  WIP - Adding an alternative session implementation
  Updated comments
  Regenerate openapi.yml
  Updated session.proto
  Added session examples from all the places
  Ran ignite scaffold type session --module session --yes
  [Supplier] Scaffolded the UnstakeSupplier message and nothing else (#50)
  [Supplier] Scaffolded the UnstakeSupplier message and nothing else (#52)
  [Application] Scaffolded the Application type (without CRUD messages) and nothing else (#47)
  [Supplier] Scaffolded the Supplier type (without CRUD messages) and nothing else (#48)
  [Service] Just scaffold the Service module without any params (#37)
  [Supplier] Scaffolded the StakeSupplier message and nothing else (#51)
  [Supplier] Scaffolded the StakeSupplier message and nothing else (#49)
  ...
okdas pushed a commit that referenced this pull request Nov 14, 2024
Scaffolding and customizing the first version of the `Relay` type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
session Changes related to Session management
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants