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

Client: small BN fixes #1156

Merged
merged 3 commits into from
Mar 18, 2021
Merged

Client: small BN fixes #1156

merged 3 commits into from
Mar 18, 2021

Conversation

ryanio
Copy link
Contributor

@ryanio ryanio commented Mar 18, 2021

This PR is a follow-up to #1150 that fixes some BN cases where toNumber should not be used in case of large number network ids like yolov3.

@codecov
Copy link

codecov bot commented Mar 18, 2021

Codecov Report

Merging #1156 (a404276) into master (f97d9eb) will increase coverage by 0.00%.
The diff coverage is 66.66%.

Impacted file tree graph

Flag Coverage Δ
block 81.78% <ø> (-0.18%) ⬇️
blockchain 84.13% <ø> (ø)
client 83.80% <66.66%> (-0.20%) ⬇️
common 87.39% <ø> (+0.52%) ⬆️
devp2p 84.08% <ø> (+0.14%) ⬆️
ethash 82.08% <ø> (ø)
tx 84.25% <ø> (?)
vm 81.67% <ø> (ø)

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

headTd: this.chain.headers.td.toArrayLike(Buffer),
headHash: this.chain.headers.latest?.hash(),
headNum: this.chain.headers.latest?.number,
headNum: this.chain.headers.latest?.number.toArrayLike(Buffer),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe encoding this BN as a Buffer is more correct, according to the les protocol messages spec.

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

Nice, LGTM! 😄

@holgerd77 holgerd77 merged commit b2d171c into master Mar 18, 2021
@holgerd77 holgerd77 deleted the small-bn-fixes branch March 18, 2021 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants