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: use correct decoded len function for base32 #1081

Merged
merged 1 commit into from
Jan 28, 2023

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Jan 28, 2023

fixes a bug introduced in #1069

the rust decode_len behaves differently than the go functions DecodedLen this is based on:

https://cs.opensource.google/go/go/+/refs/tags/go1.19.5:src/encoding/base32/base32.go;l=526-531

This PR mirrors the correct DecodedLen as used here:
https://github.com/ethereum/go-ethereum/blob/df52967ff6080a27243569020ff64cd956fb8362/p2p/dnsdisc/tree.go#L396

@mattsse mattsse requested a review from Rjected as a code owner January 28, 2023 18:41
@mattsse mattsse added C-bug An unexpected or incorrect behavior A-dnsdisc Related to DNS discovery labels Jan 28, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #1081 (9c75130) into main (e8d7c05) will increase coverage by 0.08%.
The diff coverage is 94.73%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main    #1081      +/-   ##
==========================================
+ Coverage   74.74%   74.82%   +0.08%     
==========================================
  Files         317      317              
  Lines       34650    34664      +14     
==========================================
+ Hits        25898    25937      +39     
+ Misses       8752     8727      -25     
Flag Coverage Δ
unit-tests 74.82% <94.73%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
crates/net/dns/src/tree.rs 85.99% <94.73%> (+0.49%) ⬆️
crates/stages/src/stages/sender_recovery.rs 91.05% <0.00%> (-0.53%) ⬇️
crates/net/network/src/peers/manager.rs 83.57% <0.00%> (+0.18%) ⬆️
crates/net/network/src/session/active.rs 84.51% <0.00%> (+0.37%) ⬆️
crates/transaction-pool/src/pool/txpool.rs 59.32% <0.00%> (+0.50%) ⬆️
crates/transaction-pool/src/test_utils/mock.rs 58.51% <0.00%> (+6.73%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@mattsse mattsse requested a review from onbjerg January 28, 2023 19:12
@gakonst
Copy link
Member

gakonst commented Jan 28, 2023

Wow yikes. Nice find.

@gakonst gakonst merged commit e922822 into main Jan 28, 2023
@gakonst gakonst deleted the matt/fix-ensure-valid-hash branch January 28, 2023 22:11
literallymarvellous pushed a commit to literallymarvellous/reth that referenced this pull request Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dnsdisc Related to DNS discovery C-bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants