-
Notifications
You must be signed in to change notification settings - Fork 33
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] trustless relay e2e happy case (POC PR) #869
base: main
Are you sure you want to change the base?
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a quick initial (partial) review and will do a deeper one on Wednesday
@@ -1699,7 +1699,7 @@ data: | |||
"address": "001022b138896c4c5466ac86b24a9bbe249905c2", | |||
"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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did we update the port?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
@@ -1699,7 +1699,7 @@ data: | |||
"address": "001022b138896c4c5466ac86b24a9bbe249905c2", | |||
"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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the review. Will open a separate PR for this shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1699,7 +1699,7 @@ data: | |||
"address": "001022b138896c4c5466ac86b24a9bbe249905c2", | |||
"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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adshmh Seems like there are some broken tests in shared/core/types/relay_test.go
that need to be updated as well
## 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:
PostV1ClientRelay
function, a new fieldApplicationAddress
is added to therelayMeta
struct.buildJsonRPCRelayPayload
function, the fieldJsonRpc
is changed toJsonrpc
for thepayload
struct. Additionally, the fieldId
is changed to use a pointer and include thecoreTypes.JSONRPCId
struct.Parameters
in thebody.Payload
struct is changed toParams
.crypto/tls
,encoding/json
.validateRelayChainSupport
: Added a new variableservicerAddrBz
and decoded thes.config.Address
as a byte array before passing it toreadCtx.GetServicer
.executeJsonRPCRelay
: Changed the waypayload
is marshalled to JSON usingjson.Marshal
instead ofcodec.GetCodec().Marshal
.executeHTTPRelay
: Added a new import statementcrypto/tls
. Added a new variabletr
of typehttp.Transport
withTLSClientConfig
set totls.Config{InsecureSkipVerify: true}
. Modified thehttp.Client
initialization to include the new transport configuration.shared/core/types/relay.go
: In theValidate
method of theJSONRPCPayload
struct, thep.JsonRpc
field has been changed top.Jsonrpc
in the condition and error message. Added a newMarshalJSON
method to theJSONRPCId
struct to customize the JSON marshalling process.servicer.go
file in theapp/client/cli
directory: Line 107 - AddedapplicationAddr
as an argument to thebuildRelay
function call. Line 145 - Added a check for unmarshalling the relay payload using JSON. Line 267 - AddedApplicationAddress
to therelayMeta
struct.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: byte
property from theid
field. Added anitems
property to theparams
field, specifying that it should be an array of strings. Added theapplication_address
field to thePayload
object, which is of type string.test_e2e_relay
, modified thetest_all_with_json_coverage
target, and updated theTODO_KEYWORDS
variable.relay_test.go
file in theshared/core/types
package: Added an import statement for theencoding/json
package. Changed the fieldJsonRpc
of theJSONRPCPayload
struct toJsonrpc
in two test functions. Added a new test function to check theMarshalJSON
method of theJSONRPCPayload
struct.relay.proto
file: 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_e2e
on k8s LocalNet; if any code changes were madee2e-devnet-test
passes tests on DevNet; if any code was changedRequired Checklist
godoc
format comments on touched members (see: tip.golang.org/doc/comment)If Applicable Checklist
shared/docs/*
if I updatedshared/*
README(s)