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

Refactor getVersionInfo and getNetwork RPC to not use HTTP endpoint /info on core #198

Merged
merged 9 commits into from
Jul 18, 2024

Conversation

psheth9
Copy link
Contributor

@psheth9 psheth9 commented Jun 5, 2024

Fixes: #161

Predecessor task: Update captive_core_backend.go to expose ProtocolVersion instead of fetching from core client stellar/go#5332

This PR adds following:

  • Refactor of getVersionInfo
  • Refactor of getNetwork
  • Adds a new getProtocolVersion util method
  • Benchmark and tests

Benchmark details:

goos: darwin
goarch: arm64
pkg: github.com/stellar/soroban-rpc/cmd/soroban-rpc/internal/methods
BenchmarkGetProtocolVersion
BenchmarkGetProtocolVersion-12    	   58597	     19727 ns/op

@psheth9 psheth9 self-assigned this Jun 5, 2024
@psheth9 psheth9 requested a review from tamirms June 5, 2024 20:11
@psheth9 psheth9 marked this pull request as ready for review July 3, 2024 19:04
@psheth9 psheth9 requested review from Shaptic and 2opremio July 3, 2024 19:08
@psheth9 psheth9 requested review from 2opremio and Shaptic July 15, 2024 17:58
Copy link
Contributor

@2opremio 2opremio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved! (modulo the benchmark providing a reasonable time for the endpoint)

@psheth9 psheth9 merged commit d3f0c65 into main Jul 18, 2024
19 checks passed
@psheth9 psheth9 deleted the update-getNetwork-and-getVersionInfo branch July 18, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants