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

fix(tm2): make HTTPClient support https #1158

Merged
merged 4 commits into from
Oct 5, 2023

Conversation

thehowl
Copy link
Member

@thehowl thehowl commented Sep 21, 2023

Gnochess hotfix (already on the gnochess branch, so no need to prioritize this).

There's two users of parseRemoteAddr: makeHTTPDialer and toClientAddrAndParse. The former creates a net.Dialer, and needs to convert the protocol to tcp when it's http/https, while the latter doesn't, and its value is subsequently used to make the HTTP request itself.

This fixes a bug when doing any query/tx with gnokey when using https:

$ gnokey maketx addpkg --gas-wanted 20000000 --gas-fee 1ugnot \
   --pkgpath gno.land/r/demo/chess1 --pkgdir . --broadcast --remote https://my.remote.server:443 testkey
--= Error =--
Data: server at 'http://my.remote.server:443' returned 404 Not Found
Msg Traces:
    0  /home/howl/oc/gno/tm2/pkg/bft/rpc/client/httpclient.go:162 - ABCIQuery
    1  /home/howl/oc/gno/tm2/pkg/crypto/keys/client/query.go:108 - querying
    2  /home/howl/oc/gno/tm2/pkg/crypto/keys/client/addpkg.go:168 - query account
--= /Error =--
Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

@thehowl thehowl self-assigned this Sep 21, 2023
@thehowl thehowl requested a review from moul as a code owner September 21, 2023 09:30
@github-actions github-actions bot added the 📦 🌐 tendermint v2 Issues or PRs tm2 related label Sep 21, 2023
@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (ce258b1) 47.31% compared to head (f15cb76) 47.38%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1158      +/-   ##
==========================================
+ Coverage   47.31%   47.38%   +0.06%     
==========================================
  Files         367      367              
  Lines       62118    62118              
==========================================
+ Hits        29394    29434      +40     
+ Misses      30325    30296      -29     
+ Partials     2399     2388      -11     
Files Coverage Δ
tm2/pkg/bft/rpc/lib/client/http_client.go 14.23% <100.00%> (+1.49%) ⬆️

... and 9 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@thehowl thehowl marked this pull request as draft September 21, 2023 16:09
@thehowl
Copy link
Member Author

thehowl commented Sep 21, 2023

putting back as draft; want to add a regression test

Copy link
Contributor

@piux2 piux2 left a comment

Choose a reason for hiding this comment

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

LGTM

@moul moul added this to the 🌟 main.gno.land (wanted) milestone Sep 22, 2023
@thehowl thehowl marked this pull request as ready for review October 5, 2023 02:58
Copy link
Member

@zivkovicmilos zivkovicmilos left a 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 fix 🙏

@gfanton gfanton merged commit 740e7f7 into master Oct 5, 2023
176 checks passed
@gfanton gfanton deleted the dev/morgan/fix-httpclient-https branch October 5, 2023 16:44
gfanton pushed a commit to gfanton/gno that referenced this pull request Nov 9, 2023
Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🌐 tendermint v2 Issues or PRs tm2 related
Projects
Status: Done
Status: 🌟 Wanted for Launch
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants