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

[Utility] A1: E2E Relay - Trustless Relay #754

Open
2 of 20 tasks
Olshansk opened this issue May 16, 2023 · 0 comments
Open
2 of 20 tasks

[Utility] A1: E2E Relay - Trustless Relay #754

Olshansk opened this issue May 16, 2023 · 0 comments
Assignees
Labels
utility Utility specific changes

Comments

@Olshansk
Copy link
Member

Olshansk commented May 16, 2023

Objective

Implement MVP E2E Feature Path A1: E2E Relay- Trustless Relay

Origin Document

Purpose: A staked Application can make a direct relay and receive a response from a staked Servicer, selected by the Session, based on the GeoZone and ChainID.

Actors: Check all of the protocol actors involved in the feature

  • Validator
  • Application
  • Servicer
  • Fisherman
  • Portal

Data Structures

  • shared/core/types/proto/relay.proto - will need to be updated to reflect the V1 design. For example:
    • AATs are no longer needed since the signature will define the validation
  • utility/service/service.go will need to be updated to reflect V1-specific logic in servicing a request per the README

Interfaces

  • app/client/cli/ will need to be updated to reflect the changes made to relay.proto
  • shared/modules/utility_module.go may need to be updated with Servicer specific logic for handling a relay

Diagram

sequenceDiagram
    actor A as Application
    actor FN as Full/Dispatch Node
    actor S as Servicer
    actor D as Data Node

		title E2E Trustless Relay

    loop Repeats During Session
				A ->> +FN: GetSessionData
				FN ->> -A: SessionData
        A ->> +S: Relay Request
				S ->> S: Validate Relay
				S ->> +D: RPC Request
				D ->> -S: RPC Response
				S ->> S: Store signed RPC (Request, Response) 
				S ->>-A: Relay Response
    end
Loading

User Stories as Tests

  • Happy test cases
    • An Application requests the account balance of a specific address at a specific height from a Servicer staked for the Ethereum RelayChain in the same GeoZone, and receives a successful response.
  • Sad test cases
    • An Application requests the account balance of a specific address at a specific height from a Servicer staked for the Ethereum RelayChain in the same GeoZone, and the request times out without a response.

Blockers

  • E2E feature path dependencies:
    • E.1: Actor Staking
  • Infrastructure dependencies
    • Running an Ethereum data node

Goals

  • Complete the MVP implementation of the E2E Feature Path outlined in the objective
  • Identify future tasks and test requirements to transition the feature to production

Deliverable

  • POC:
    • A POC SPIKE to be closed out and split out into multiple PRs
  • MVP:
    • A PR that adds or modifies relevant structures and interfaces; such as shared/core/types/proto, shared/modules, etc
    • A PR that materializes an MVP of the feature along with unit tests
    • A PR that introduces a new E2E tests with one happy and one sad path scenarios as described in the origin document (refer to e2e/README.md); this may require additions to the cli
    • A PR that updates all pertinent documentation
  • PROD:
    • One or more subsequent GitHub issues that track future work including, but not limited to:
      • Enhancing test coverage
      • Adding subsequent features
      • Patching hacks or workarounds
      • Enabling your imagination!

General issue deliverables

  • Update the appropriate CHANGELOG(s)
  • Update any relevant local/global README(s)
  • Update relevant source code tree explanations
  • Add or update any relevant or supporting mermaid diagrams

Testing Methodology

  • Task specific tests or benchmarks: make ...
  • New tests or benchmarks: make ...
  • All tests: make test_all
  • LocalNet: verify a LocalNet is still functioning correctly by following the instructions at docs/development/README.md
  • k8s LocalNet: verify a k8s LocalNet is still functioning correctly by following the instructions here

Creator: @Olshansk

@Olshansk Olshansk added the utility Utility specific changes label May 16, 2023
@Olshansk Olshansk changed the title [Utility] A1: E2E Relay- Trustless Relay [Utility] A1: E2E Relay - Trustless Relay May 17, 2023
adshmh added a commit that referenced this issue May 24, 2023
This pull request adds two applications and two servicers to the
genesis.json in LocalNet configuration. The new addresses can be used
for testing the CLI.

Part of work on #754

Please mark the relevant option(s):

- [ ] New feature, functionality or library
- [ ] Bug fix
- [ ] Code health or cleanup
- [ ] Major breaking change
- [X] Documentation
- [x] Other Added 2 applications and 2 servicers to genesis.json for
  LocalNet

- Added 2 applications to genesis.json for LocalNet
- Added 2 servicers to genesis.json for LocalNet

- [ ] `make develop_test`; if any code changes were made
- [ ] `make test_e2e` on [k8s
  LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md);
if any code changes were made
- [ ] `e2e-devnet-test` passes tests on
  [DevNet](https://pocketnetwork.notion.site/How-to-DevNet-ff1598f27efe44c09f34e2aa0051f0dd);
if any code was changed
- [ ] [Docker Compose
  LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md);
if any major functionality was changed or introduced
- [X] [k8s
  LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md);
if any infrastructure or configuration changes were made

- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added, or updated, [`godoc` format
  comments](https://go.dev/blog/godoc) on touched members (see:
[tip.golang.org/doc/comment](https://tip.golang.org/doc/comment))
- [x] I have tested my changes using the available tooling
- [ ] I have updated the corresponding CHANGELOG

- [x] I have updated the corresponding README(s); local and/or global
- [ ] I have added tests that prove my fix is effective or that my
  feature works
- [ ] I have added, or updated,
  [mermaid.js](https://mermaid-js.github.io) diagrams in the
corresponding README(s)
- [ ] I have added, or updated, documentation and
  [mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*`
if I updated `shared/*`README(s)

Signed-off-by: Arash Deshmeh <[email protected]>
adshmh added a commit that referenced this issue May 24, 2023
This pull request adds two applications and two servicers to the
genesis.json in LocalNet configuration. The new addresses can be used
for testing the CLI.

Part of work on #754

Please mark the relevant option(s):

- [ ] New feature, functionality or library
- [ ] Bug fix
- [ ] Code health or cleanup
- [ ] Major breaking change
- [X] Documentation
- [x] Other Added 2 applications and 2 servicers to genesis.json for
  LocalNet

- Added 2 applications to genesis.json for LocalNet
- Added 2 servicers to genesis.json for LocalNet

- [ ] `make develop_test`; if any code changes were made
- [ ] `make test_e2e` on [k8s
  LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md);
if any code changes were made
- [ ] `e2e-devnet-test` passes tests on
  [DevNet](https://pocketnetwork.notion.site/How-to-DevNet-ff1598f27efe44c09f34e2aa0051f0dd);
if any code was changed
- [ ] [Docker Compose
  LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md);
if any major functionality was changed or introduced
- [X] [k8s
  LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md);
if any infrastructure or configuration changes were made

- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added, or updated, [`godoc` format
  comments](https://go.dev/blog/godoc) on touched members (see:
[tip.golang.org/doc/comment](https://tip.golang.org/doc/comment))
- [x] I have tested my changes using the available tooling
- [ ] I have updated the corresponding CHANGELOG

- [x] I have updated the corresponding README(s); local and/or global
- [ ] I have added tests that prove my fix is effective or that my
  feature works
- [ ] I have added, or updated,
  [mermaid.js](https://mermaid-js.github.io) diagrams in the
corresponding README(s)
- [ ] I have added, or updated, documentation and
  [mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*`
if I updated `shared/*`README(s)

Signed-off-by: Arash Deshmeh <[email protected]>
Olshansk added a commit that referenced this issue May 30, 2023
## Description

This PR introduces one new document related to end-to-end (E2E) features: `E2E_FEATURE_PATH_TEMPLATE.md`.

`E2E_FEATURE_PATH_TEMPLATE` outlines a well-defined process for adopting an end-to-end feature path approach, intending to make each feature/task easier to scope, reason about, design, and implement. It includes two main stages:
1. Feature Specification
2. Feature Implementation (moving from Proof of Concept to Minimum Viable Product and finally to Production)

It also provides tips and templates for creating GitHub issues and Origin Documents for scoping and tracking E2E features. The goal is to enable internal and external team members individuals to help with the implementation of the utility module.

## Issue

Fixes #733

## Type of change

Please mark the relevant option(s):

- [ ] New feature, functionality or library
- [ ] Bug fix
- [ ] Code health or cleanup
- [ ] Major breaking change
- [X] Documentation
- [ ] Other <!-- add details here if it a different type of change -->

## List of changes

- Added a list of all needed E2E features (to the best of our current knowledge)
- Linked to #754 and #755 

---

Co-authored-by: Bryan White <[email protected]>
Olshansk added a commit that referenced this issue Jun 1, 2023
This PR introduces one new document related to end-to-end (E2E) features: `E2E_FEATURE_PATH_TEMPLATE.md`.

`E2E_FEATURE_PATH_TEMPLATE` outlines a well-defined process for adopting an end-to-end feature path approach, intending to make each feature/task easier to scope, reason about, design, and implement. It includes two main stages:
1. Feature Specification
2. Feature Implementation (moving from Proof of Concept to Minimum Viable Product and finally to Production)

It also provides tips and templates for creating GitHub issues and Origin Documents for scoping and tracking E2E features. The goal is to enable internal and external team members individuals to help with the implementation of the utility module.

Fixes #733

Please mark the relevant option(s):

- [ ] New feature, functionality or library
- [ ] Bug fix
- [ ] Code health or cleanup
- [ ] Major breaking change
- [X] Documentation
- [ ] Other <!-- add details here if it a different type of change -->

- Added a list of all needed E2E features (to the best of our current knowledge)
- Linked to #754 and #755

---

Co-authored-by: Bryan White <[email protected]>
adshmh added a commit that referenced this issue Jun 1, 2023
<!-- REMOVE this comment block after following the instructions
1. Make the title of the PR is descriptive and follows this format:
`[<Module>] <DESCRIPTION>`
2. Update the _Assigness_, _Labels_, _Projects_, _Milestone_ before
submitting the PR for review.
3. Add label(s) for the purpose (e.g. `persistence`) and, if applicable,
priority (e.g. `low`) labels as well.
4. See our custom action driven labels if you need to trigger a build or
interact with an LLM -
https://github.com/pokt-network/pocket/blob/main/docs/development/README.md#github-labels
-->

## Description

<!-- REMOVE this comment block after following the instructions
1. Add a summary of the change including: motivation, reasons, context,
dependencies, etc...
 2. If applicable, specify the key files that should be looked at.
3. If you leave the `reviewpad:summary` block below, it'll autopopulate
an AI generated summary. Alternatively, you can leave a `/reviewpad
summarize` comment to trigger it manually.
-->
<!-- reviewpad:summarize:start -->
### Summary generated by Reviewpad on 01 Jun 23 18:05 UTC
This pull request adds 2 applications and 2 servicers to the
genesis.json file for LocalNet configuration, which can be used for
testing the CLI. It is part of work on issue #754. The patch includes
changes to the CHANGELOG.md and README.md files to reflect the added
addresses. The relevant options for this pull request are
"Documentation" and "Other," specifically "added 2 applications and 2
servicers to genesis.json for LocalNet."
<!-- reviewpad:summarize:end -->

## Issue

Part of work on #754 

## Type of change

Please mark the relevant option(s):

- [ ] New feature, functionality or library
- [ ] Bug fix
- [ ] Code health or cleanup
- [ ] Major breaking change
- [X] Documentation
- [x] Other Added 2 applications and 2 servicers to genesis.json for
LocalNet

## List of changes
- Added 2 applications to genesis.json for LocalNet
- Added 2 servicers to genesis.json for LocalNet

## Testing

- [ ] `make develop_test`; if any code changes were made
- [ ] `make test_e2e` on [k8s
LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md);
if any code changes were made
- [ ] `e2e-devnet-test` passes tests on
[DevNet](https://pocketnetwork.notion.site/How-to-DevNet-ff1598f27efe44c09f34e2aa0051f0dd);
if any code was changed
- [ ] [Docker Compose
LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md);
if any major functionality was changed or introduced
- [X] [k8s
LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md);
if any infrastructure or configuration changes were made

## Required Checklist

- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added, or updated, [`godoc` format
comments](https://go.dev/blog/godoc) on touched members (see:
[tip.golang.org/doc/comment](https://tip.golang.org/doc/comment))
- [x] I have tested my changes using the available tooling
- [ ] I have updated the corresponding CHANGELOG

### If Applicable Checklist

- [x] I have updated the corresponding README(s); local and/or global
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have added, or updated,
[mermaid.js](https://mermaid-js.github.io) diagrams in the corresponding
README(s)
- [ ] I have added, or updated, documentation and
[mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*`
if I updated `shared/*`README(s)
adshmh added a commit that referenced this issue Jun 1, 2023
## Description

- Partial implementation of server-side validations for trustless
relays, along with placeholders for next validations to implement.
- Update Relay structure with the required fields.

## Issue

Part of work on #754 


## Type of change

Please mark the relevant option(s):

- [x] New feature, functionality or library
- [ ] Bug fix
- [ ] Code health or cleanup
- [ ] Major breaking change
- [] Documentation
- [ ] Other <!-- add details here if it a different type of change -->

## List of changes

- Add implementation for Servicer's validations, with placeholders for
the logic not implemented yet.
- Changed the Relay struct to include required fields, e.g.
`ApplicationAddress` in `RelayMeta`
- Remove AAT from Relay type and remove the referencing code that was
breaking the tests (AAT not fully removed yet, will be on the next PR)


## Testing

- [x] `make develop_test`; if any code changes were made
- [ ] `make test_e2e` on [k8s
LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md);
if any code changes were made
- [ ] `e2e-devnet-test` passes tests on
[DevNet](https://pocketnetwork.notion.site/How-to-DevNet-ff1598f27efe44c09f34e2aa0051f0dd);
if any code was changed
- [ ] [Docker Compose
LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md);
if any major functionality was changed or introduced
- [ ] [k8s
LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md);
if any infrastructure or configuration changes were made

## Required Checklist

- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added, or updated, [`godoc` format
comments](https://go.dev/blog/godoc) on touched members (see:
[tip.golang.org/doc/comment](https://tip.golang.org/doc/comment))
- [x] I have tested my changes using the available tooling
- [x] I have updated the corresponding CHANGELOG

### If Applicable Checklist

- [ ] I have updated the corresponding README(s); local and/or global
- [x] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have added, or updated,
[mermaid.js](https://mermaid-js.github.io) diagrams in the corresponding
README(s)
- [ ] I have added, or updated, documentation and
[mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*`
if I updated `shared/*`README(s)

---------

Signed-off-by: Arash Deshmeh <[email protected]>
Olshansk pushed a commit that referenced this issue Jun 20, 2023
## Description
<!-- reviewpad:summarize:start -->
### Summary generated by Reviewpad on 19 Jun 23 16:17 UTC
This pull request contains various changes including updates to shared types, implementation of new validation functions, modifications to RPC documentation and API endpoint schema, implementation of a new servicer command in the CLI package, and changes to the JSON payload types. There is also a suggestion for improving the `Session` message and added `TECHDEBT` for signature field.
<!-- reviewpad:summarize:end -->

## Issue

Part of work on #754 

## Type of change

Please mark the relevant option(s):

- [x] New feature, functionality or library
- [ ] Bug fix
- [ ] Code health or cleanup
- [ ] Major breaking change
- [ ] Documentation
- [ ] Other <!-- add details here if it a different type of change -->

## List of changes

- Added a "Relay" sub-command to CLI's "Servicer" command.

## Testing

- [x] `make develop_test`; if any code changes were made
- [x] `make test_e2e` on [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any code changes were made
- [ ] `e2e-devnet-test` passes tests on [DevNet](https://pocketnetwork.notion.site/How-to-DevNet-ff1598f27efe44c09f34e2aa0051f0dd); if any code was changed
- [ ] [Docker Compose LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md); if any major functionality was changed or introduced
- [ ] [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any infrastructure or configuration changes were made

## Required Checklist

- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added, or updated, [`godoc` format comments](https://go.dev/blog/godoc) on touched members (see: [tip.golang.org/doc/comment](https://tip.golang.org/doc/comment))
- [x] I have tested my changes using the available tooling
- [x] I have updated the corresponding CHANGELOG

### If Applicable Checklist

- [ ] I have updated the corresponding README(s); local and/or global
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added, or updated, [mermaid.js](https://mermaid-js.github.io) diagrams in the corresponding README(s)
- [ ] I have added, or updated, documentation and [mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*` if I updated `shared/*`README(s)
dylanlott pushed a commit that referenced this issue Jun 21, 2023
## Description
<!-- reviewpad:summarize:start -->
### Summary generated by Reviewpad on 19 Jun 23 16:17 UTC
This pull request contains various changes including updates to shared types, implementation of new validation functions, modifications to RPC documentation and API endpoint schema, implementation of a new servicer command in the CLI package, and changes to the JSON payload types. There is also a suggestion for improving the `Session` message and added `TECHDEBT` for signature field.
<!-- reviewpad:summarize:end -->

## Issue

Part of work on #754 

## Type of change

Please mark the relevant option(s):

- [x] New feature, functionality or library
- [ ] Bug fix
- [ ] Code health or cleanup
- [ ] Major breaking change
- [ ] Documentation
- [ ] Other <!-- add details here if it a different type of change -->

## List of changes

- Added a "Relay" sub-command to CLI's "Servicer" command.

## Testing

- [x] `make develop_test`; if any code changes were made
- [x] `make test_e2e` on [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any code changes were made
- [ ] `e2e-devnet-test` passes tests on [DevNet](https://pocketnetwork.notion.site/How-to-DevNet-ff1598f27efe44c09f34e2aa0051f0dd); if any code was changed
- [ ] [Docker Compose LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md); if any major functionality was changed or introduced
- [ ] [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any infrastructure or configuration changes were made

## Required Checklist

- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added, or updated, [`godoc` format comments](https://go.dev/blog/godoc) on touched members (see: [tip.golang.org/doc/comment](https://tip.golang.org/doc/comment))
- [x] I have tested my changes using the available tooling
- [x] I have updated the corresponding CHANGELOG

### If Applicable Checklist

- [ ] I have updated the corresponding README(s); local and/or global
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added, or updated, [mermaid.js](https://mermaid-js.github.io) diagrams in the corresponding README(s)
- [ ] I have added, or updated, documentation and [mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*` if I updated `shared/*`README(s)
adshmh added a commit that referenced this issue Jun 29, 2023
## Description

Add validation of application's session tokens to the servicer.

## Issue

Part of work on #754 

## Type of change

Please mark the relevant option(s):

- [x] New feature, functionality or library
- [ ] Bug fix
- [ ] Code health or cleanup
- [ ] Major breaking change
- [ ] Documentation
- [ ] Other <!-- add details here if it a different type of change -->

## List of changes

- Servicer now validates the availability of tokens in the current
session before executing relays.

## Testing

- [x] `make develop_test`; if any code changes were made
- [ ] `make test_e2e` on [k8s
LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md);
if any code changes were made
- [ ] `e2e-devnet-test` passes tests on
[DevNet](https://pocketnetwork.notion.site/How-to-DevNet-ff1598f27efe44c09f34e2aa0051f0dd);
if any code was changed
- [ ] [Docker Compose
LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md);
if any major functionality was changed or introduced
- [ ] [k8s
LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md);
if any infrastructure or configuration changes were made

## Required Checklist

- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [] I have added, or updated, [`godoc` format
comments](https://go.dev/blog/godoc) on touched members (see:
[tip.golang.org/doc/comment](https://tip.golang.org/doc/comment))
- [x] I have tested my changes using the available tooling
- [x] I have updated the corresponding CHANGELOG

### If Applicable Checklist

- [ ] I have updated the corresponding README(s); local and/or global
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have added, or updated,
[mermaid.js](https://mermaid-js.github.io) diagrams in the corresponding
README(s)
- [ ] I have added, or updated, documentation and
[mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*`
if I updated `shared/*`README(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
utility Utility specific changes
Projects
Status: In Progress
Development

No branches or pull requests

2 participants