Skip to content

Conversation

@areller
Copy link

@areller areller commented Apr 23, 2022

This is a small fix to strip password from the URL that gets logged when there's an RPC error
I encountered it when I was using https://github.com/ava-labs/avalanchego/blob/master/indexer/client.go to query the index API.

The code to strip the password is copied from https://go-review.googlesource.com/c/go/+/175018/

Example log before fix

problem while making JSON RPC POST request to https://username:actualpassword@myapiaddress/ext/index/P/block: Post "https://username:***@myapiaddress/ext/index/P/block": read tcp someipaddress:65509->someipaddress:443: read: connection reset by peer

Example log after fix

problem while making JSON RPC POST request to https://username:xxxx@myapiaddress/ext/index/P/block: Post "https://username:***@myapiaddress/ext/index/P/block": read tcp someipaddress:65509->someipaddress:443: read: connection reset by peer

Update: changed to use url.Redacted

harodggg pushed a commit to harodggg/avalanchego that referenced this pull request Apr 24, 2022
@StephenButtolph
Copy link
Contributor

I think this PR was made no longer relevant by 6231194 - so I'm going to close this.

StephenButtolph added a commit that referenced this pull request Nov 25, 2025
* use generic math

* update avalanchego version

* nit

* take 2

* take 3

* take 4

* fix blst cgo

* whoopse

Co-authored-by: Stephen <stephen@avalabs.org>
StephenButtolph added a commit that referenced this pull request Nov 25, 2025
Co-authored-by: Ceyhun Onur <ceyhun.onur@avalabs.org>
maru-ava pushed a commit that referenced this pull request Dec 3, 2025
Branch nodes were already handling the overflow correctly, but leaf
nodes were not. A failing test case was added to ensure this fix works.

Previously:

```text
---- node::test::test_serialize_deserialize::leaf_node_obnoxiously_long_partial_path stdout ----

thread 'node::test::test_serialize_deserialize::leaf_node_obnoxiously_long_partial_path' panicked at storage/src/node/mod.rs:553:9:
assertion `left == right` failed
  left: Leaf([Leaf 7 4 6 8 6 9 7 3 2 0 6 9 7 3 2 0 6 1 2 0 7 2 6 5 6 1 6 c 6 c 7 9 2 0 6 c 6 f 6 e 6 7 2 0 7 0 6 1 7 2 7 4 6 9 6 1 6 c 2 0 7 0 6 1 7 4 6 8 2 c 2 0 6 c 6 9 6 b 6 5 2 0 7 3 6 f 2 0 6 c 6 f 6 e 6 7 2 0 6 9 7 4 2 7 7 3 2 0 6 d 6 f 7 2 6 5 2 0 7 4 6 8 6 1 6 e 2 0 3 6 3 3 2 0 6 e 6 9 6 2 6 2 6 c 6 5 7 3 2 0 6 c 6 f 6 e 6 7 2 0 7 7 6 8 6 9 6 3 6 8 2 0 7 4 7 2 6 9 6 7 6 7 6 5 7 2 7 3 2 0 2 3 3 1 3 0 3 5 3 6 2 e  04050607])
 right: Leaf([Leaf [invalid ca] 1 7 4 6 8 6 9 7 3 2 0 6 9 7 3 2 0 6 1 2 0 7 2 6 5 6 1 6 c 6 c 7 9 2 0 6 c 6 f 6 e 6 7 2 0 7 0 6 1 7 2 7 4 6 9 6 1 6 c 2 0 7 0 6 1 7 4 6 8 2 c 2 0  0c0609060b06])
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

fixes #1056

---------

Signed-off-by: Joachim Brandon LeBlanc <brandon.leblanc@avalabs.org>
JonathanOppenheimer pushed a commit that referenced this pull request Dec 3, 2025
JonathanOppenheimer added a commit that referenced this pull request Dec 3, 2025
… package (#1675)

Co-authored-by: Stephen Buttolph <stephen@avalabs.org>
Co-authored-by: Ceyhun Onur <ceyhun.onur@avalabs.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants