[Utility] trustless relay e2e happy case (POC PR)#869
Conversation
|
@dylanlott and @Olshansk please note this is a POC only PR and not intended to be merged. I have added the list of PRs that will be opened to make the necessary code changes. The review request here is to make sure the overall approach is reasonable. |
Olshansk
left a comment
There was a problem hiding this comment.
Did a quick initial (partial) review and will do a deeper one on Wednesday
| "public_key": "56915c1270bc8d9280a633e0be51647f62388a851318381614877ef2ed84a495", | ||
| "chains": ["0001"], | ||
| "service_url": "servicer-001-pocket:42069", | ||
| "service_url": "http://servicer-001-pocket:50832", |
There was a problem hiding this comment.
why did we update the port?
There was a problem hiding this comment.
Port 50832 is the configured RPC port, so 42069 seems incorrect (encountered this while running the E2E test introduced in this PR)
There was a problem hiding this comment.
Is the intention to do it in this PR (given the comment)?
I still think a different small "micro PR" could be simpler & faster
There was a problem hiding this comment.
I still think a different small "micro PR" could be simpler & faster
Yes, I will open a separate, small PR for this shortly.
Thank you for the review. I have updated the PR with to address the review comments marked as resolved. |
| "public_key": "56915c1270bc8d9280a633e0be51647f62388a851318381614877ef2ed84a495", | ||
| "chains": ["0001"], | ||
| "service_url": "servicer-001-pocket:42069", | ||
| "service_url": "http://servicer-001-pocket:50832", |
Thank you for the review. Will open a separate PR for this shortly. |
| "public_key": "56915c1270bc8d9280a633e0be51647f62388a851318381614877ef2ed84a495", | ||
| "chains": ["0001"], | ||
| "service_url": "servicer-001-pocket:42069", | ||
| "service_url": "http://servicer-001-pocket:50832", |
There was a problem hiding this comment.
Is the intention to do it in this PR (given the comment)?
I still think a different small "micro PR" could be simpler & faster
## Description <!-- reviewpad:summarize:start --> ### Summary generated by Reviewpad on 14 Jul 23 23:17 UTC This pull request includes a series of patches that make changes to the file `debug.go` in the `shared/k8s` directory. Patch 1/5: The patch retrieves keys for all actors from k8s secrets. It adds support for retrieving private keys for validators, servicers, fisherman, and applications. Patch 2/5: This patch fixes a linter error in the `fetchPrivateKeys` function by updating the function signature to use a single string parameter for `resourceName` and `actor`. Patch 3/5: This patch further fixes linter errors in the same function and shortens the code by removing unnecessary switch cases. Patch 4/5: This patch updates the constant for the secret resource name from `privateKeysSecretResourceNameFisherman` to `privateKeysSecretResourceNameFishermen`. Patch 5/5: This patch fixes a typo in the function name `FetchFishermanPrivateKeys` by updating the privateKeysSecretResourceName to `privateKeysSecretResourceNameFishermen`. Please review these changes and ensure they are appropriate. <!-- reviewpad:summarize:end --> ## Issue Added as a TODO in #869: <img width="1548" alt="Screenshot 2023-07-12 at 5 10 03 PM" src="https://github.com/pokt-network/pocket/assets/1892194/b1409bdd-4240-4993-b7dd-6197beae5500"> ## Type of change Please mark the relevant option(s): - [ ] New feature, functionality or library - [ ] Bug fix - [x] Code health or cleanup - [ ] Major breaking change - [ ] Documentation - [ ] Other <!-- add details here if it a different type of change --> ## List of changes - Fetch keys for all actors from k8s instead of just validators so they can be used in our debug libraries ## 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)) - [ ] I have tested my changes using the available tooling - [ ] 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) Co-authored-by: Dima Kniazev <okdas@users.noreply.github.com>
## Description Update servicers' URLs in LocalNet configuration. ## Issue Part of work on #869 ## Type of change Please mark the relevant option(s): - [ ] New feature, functionality or library - [x] Bug fix - [ ] Code health or cleanup - [ ] Major breaking change - [ ] Documentation - [ ] Other <!-- add details here if it a different type of change --> ## List of changes - Updated LocalNet's config in manifests - Updated Helm charts template ## 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 - [x] 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 ### 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 When do you think we'll pick up this work again? |
Working on it: I will address any remaining |


Description
[POC] This is a POC PR to add E2E happy case for trsutless relays, described in #754. It is not meant to be merged, but used to:
Summary generated by Reviewpad on 30 Jul 23 21:42 UTC
This pull request includes changes across multiple files.
Here is a summary of the changes:
PostV1ClientRelayfunction, a new fieldApplicationAddressis added to therelayMetastruct.buildJsonRPCRelayPayloadfunction, the fieldJsonRpcis changed toJsonrpcfor thepayloadstruct. Additionally, the fieldIdis changed to use a pointer and include thecoreTypes.JSONRPCIdstruct.Parametersin thebody.Payloadstruct is changed toParams.crypto/tls,encoding/json.validateRelayChainSupport: Added a new variableservicerAddrBzand decoded thes.config.Addressas a byte array before passing it toreadCtx.GetServicer.executeJsonRPCRelay: Changed the waypayloadis marshalled to JSON usingjson.Marshalinstead ofcodec.GetCodec().Marshal.executeHTTPRelay: Added a new import statementcrypto/tls. Added a new variabletrof typehttp.TransportwithTLSClientConfigset totls.Config{InsecureSkipVerify: true}. Modified thehttp.Clientinitialization to include the new transport configuration.shared/core/types/relay.go: In theValidatemethod of theJSONRPCPayloadstruct, thep.JsonRpcfield has been changed top.Jsonrpcin the condition and error message. Added a newMarshalJSONmethod to theJSONRPCIdstruct to customize the JSON marshalling process.servicer.gofile in theapp/client/clidirectory: Line 107 - AddedapplicationAddras an argument to thebuildRelayfunction call. Line 145 - Added a check for unmarshalling the relay payload using JSON. Line 267 - AddedApplicationAddressto therelayMetastruct.rpc/v1/openapi.yaml: Added a comment indicating the need for support for string, number, and NULL values as per the JSONRPC spec. Removed theformat: byteproperty from theidfield. Added anitemsproperty to theparamsfield, specifying that it should be an array of strings. Added theapplication_addressfield to thePayloadobject, which is of type string.test_e2e_relay, modified thetest_all_with_json_coveragetarget, and updated theTODO_KEYWORDSvariable.relay_test.gofile in theshared/core/typespackage: Added an import statement for theencoding/jsonpackage. Changed the fieldJsonRpcof theJSONRPCPayloadstruct toJsonrpcin two test functions. Added a new test function to check theMarshalJSONmethod of theJSONRPCPayloadstruct.relay.protofile: Added a new messageJSONRPCId, changed types, renamed fields, and added comments.Please review these changes carefully and let me know if you need any further assistance.
Issue
Part of work on #754
Type of change
Please mark the relevant option(s):
List of changes
Testing
make develop_test; if any code changes were mademake test_e2eon k8s LocalNet; if any code changes were madee2e-devnet-testpasses tests on DevNet; if any code was changedRequired Checklist
godocformat comments on touched members (see: tip.golang.org/doc/comment)If Applicable Checklist
shared/docs/*if I updatedshared/*README(s)