Open adshmh opened 1 year ago
PRs to be opened to cover all the changes here:
@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.
Did a quick initial (partial) review and will do a deeper one on Wednesday
Thank you for the review. I have updated the PR with to address the review comments marked as resolved.
I think we should update all the RPC ports then to avoid a discrepancy:
Thank you for the review. Will open a separate PR for this shortly.
@adshmh When do you think we'll pick up this work again?
@adshmh When do you think we'll pick up this work again?
Working on it: I will address any remaining ADD_IN_THIS_PR
items in a couple of days.
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)