Remove gRPC code previously used for the xpring SDK & enable gRPC on localhost by default#4272
Remove gRPC code previously used for the xpring SDK & enable gRPC on localhost by default#4272cjcobb23 wants to merge 3 commits intoXRPLF:developfrom
Conversation
|
HALLELUJAH! |
natenichols
left a comment
There was a problem hiding this comment.
After a first pass I have a couple of questions
| #port = 50051 | ||
| #ip = 0.0.0.0 | ||
| #secure_gateway = 127.0.0.1 | ||
| [port_grpc] |
There was a problem hiding this comment.
Why are we uncommenting this in the rippled-example.cfg. Do we want gRPC to be enabled by default?
There was a problem hiding this comment.
We talked about this in the huddle. I asked if we could uncomment this by default, and the agreement was yes if the xpring sdk code was removed.
| } | ||
|
|
||
| // Next field: 3 | ||
| message LedgerRange |
There was a problem hiding this comment.
Do we use this in Clio or reporting mode, or only get the LedgerRange from the ledger subscription stream?
There was a problem hiding this comment.
We don't use this in clio or reporting mode
|
|
||
| // Get a specific ledger, optionally including transactions and any modified, | ||
| // added or deleted ledger objects | ||
| rpc GetLedger(GetLedgerRequest) returns (GetLedgerResponse); |
There was a problem hiding this comment.
Can we also remove GetLedgerDiff() and GetLedgerEntry? AFAIK, Clio only uses GetLedgerRequest and GetLedgerDataRequest
There was a problem hiding this comment.
Those RPCs are not part of the xpring sdk, and I actually think they could be useful. If we want to remove them, we should discuss and do it as part of a separate PR.
| } | ||
|
|
||
| Json::Value | ||
| populateJsonResponse( |
There was a problem hiding this comment.
I don't actually know what this looked like before we added these gRPC methods, so take what I say next with a grain of salt.
Should we leave doTxHelp and populateJsonResponse as their own functions, or move it into doTx(). It occurs to me that we may have split this out to enable code reuse between the gRPC and JSON-RPC endpoints.
Is it worth leaving doTxHelp as a helper function?
There was a problem hiding this comment.
I thought about this. We could move it, but I think since we already went through the work of breaking up this function, we should keep the helper function as is. What if we want to add a different response interface in the future? The helper function would be useful. I don't see it causing a problem as is.
| { | ||
| testcase("NeedCurrentOrClosed"); | ||
| { | ||
| org::xrpl::rpc::v1::GetAccountInfoRequest request; |
There was a problem hiding this comment.
Why are we removing this test? Flagging this because it's in ReportingETL_test.cpp
There was a problem hiding this comment.
GetAccountInfoRequest is removed. This won't compile if we leave it.
scottschurr
left a comment
There was a problem hiding this comment.
Thanks so much for taking care to this @cjcobb23! It's great to see so much of this code gone. I left a couple of comments that may be relevant. But other than those this looks to me like it is good to go. 👍
| [port_grpc] | ||
| port = 50051 | ||
| ip = 0.0.0.0 | ||
| secure_gateway = 127.0.0.1 |
There was a problem hiding this comment.
Surprised to see this stanza un-commented as part of this pull request. There should be very few circumstances where this is useful, no? I could imagine it left commented out or even removed?
There was a problem hiding this comment.
This is just to make it easier for people to run clio, since clio uses this port to talk to rippled. Though now that I'm thinking about it, it might be best to change the IP to 127.0.0.1, so that way the port will only listen locally by default. If someone is running clio remotely, they'll need to modify their config anyways.
| #include <ripple/protocol/LedgerFormats.h> | ||
| #include <ripple/protocol/TxFormats.h> | ||
|
|
||
| #include "org/xrpl/rpc/v1/ledger_objects.pb.h" |
There was a problem hiding this comment.
Seems like this entire file should be removed? Hallelujah!
scottschurr
left a comment
There was a problem hiding this comment.
Thanks for the update @cjcobb23. I think there are a couple more things that need to be tuned.
- The RippledCore.cmake file needs to have the KnownFormatToGRPC_test.cpp file removed.
- The ordering.txt file needs to be tweaked so the levelization CI test passes.
If it's helpful, here's a commit that makes those changes: scottschurr@f5d9f05
Once those changes are made I think this pull request is good to go.
scottschurr
left a comment
There was a problem hiding this comment.
👍 Looks great! Thanks.
There was a lot of gRPC code in rippled that has long been deprecated. It was used for the xpring sdk, which has been abandoned. Some of the gRPC code is used for reporting mode and clio however. This PR removes the code that is no longer needed, and only retains the gRPC code needed for clio and reporting mode.