-
Notifications
You must be signed in to change notification settings - Fork 756
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
Update ethereumjs-util
to v7
#748
Conversation
Codecov Report
@@ Coverage Diff @@
## vm/release-v5 #748 +/- ##
=================================================
- Coverage 90.31% 90.29% -0.02%
=================================================
Files 46 44 -2
Lines 3004 2999 -5
Branches 470 470
=================================================
- Hits 2713 2708 -5
Misses 194 194
Partials 97 97
Continue to review full report at Codecov.
|
packages/block/src/header.ts
Outdated
import { Blockchain, BlockHeaderData, BufferLike, ChainOptions, PrefixedHexString } from './types' | ||
import { Buffer } from 'buffer' | ||
import { Block } from './block' | ||
|
||
const { BN } = require('ethereumjs-util') | ||
import IBN = require('bn.js') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the back story on BN
vs. IBN
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not too sure what was going on, I was just trying to resolve some typescript build errors. The error was "Type originates at this import" regarding bn.js in ethereumjs-util
externals.d.ts
- might be some confusion because the bn.js types are defined in a @types
package. I did check and they are in deps and not devDeps for ethereumjs-util
though so I would have hoped for them to be included in a clean way, but it did not let me simply do import { BN } from 'ethereumjs-util'
.
The changes look good! I just wanted to understand the context of I will also learn more about the 6.x to 7.0.0 changes and discussion around 7.0.1, so my review can be more solid. :) |
Thanks! Check out the ethereumjs-util/CHANGELOG.md bn.js issues regarding 7.0.1 still being explored here: ethereumjs/ethereumjs-wallet#121 (comment) (edit: concluded with patch fix releases in bn.js v4 and v5) |
Please take ethereumjs/ethereumjs-util#253 into account respectively upgrade on a new release before merging |
4142143
to
4108730
Compare
4108730
to
e9f6396
Compare
Let me know if you need a review here. |
sounds good thanks, I think the PR is ready for review other than the weird BN type interface issue I outlined above, I will give it another look to see if it is something I can fix here or perhaps some additional configuration we need in ethereumjs-util in passing the |
@ryanio @evertonfraga Ah, sorry, didn't re-read the thread so closely, yeah, you're right, the Not sure if this helps, just posting here for the marginal chance that it could: 😋 On a clean $ ts-node
> import { BN } from 'ethereumjs-util'
{}
> BN
[Function: BN] {
BN: [Circular],
wordSize: 26,
isBN: [Function: isBN],
max: [Function: max],
min: [Function: min],
red: [Function: red],
_prime: [Function: prime],
mont: [Function: mont]
}
> |
@holgerd77 ah thanks for that. OK I found some more information here: https://stackoverflow.com/a/49256285 Basically, block has
Removing edit: pushed a commit (ffc943b) to try this out (cc @evertonfraga) |
…e compiler option `esModuleInterop`
@@ -41,7 +41,7 @@ | |||
"ethashjs": "~0.0.7", | |||
"ethereumjs-block": "~3.0.0", | |||
"ethereumjs-common": "^1.5.0", | |||
"ethereumjs-util": "~6.1.0", | |||
"ethereumjs-util": "^7.0.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reverted it back to a caret range, to comply with the other monorepo packages.
Looking at old versions of this line led to this PR ethereumjs/ethereumjs-blockchain#33, proving this was a protection mechanism for a hardfork changes.
Any opinions here, @holgerd77?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is from some really old ages 😄 , no reason for special rules here any more.
Think its very beneficial if we end up using caret ranges at least for our own internal dependencies all over the place and just follow semver without exception. This was quite different some time (2-3 years) ago but we have gotten quite some way here and I think we are now with most (all?) of the (actively worked on) libraries in a semver-compliant release process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless there's any specific reason to keep ethereumjs-util
under a tilde version, we're good to go!
I will test the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, also had another short look, I will merge this in now since this is so relatively heavy and I would like to do some rebases on top.
This PR updates
ethereumjs-util
to v7 for various improvements and benefits (see changelog) including keccak prebuilds.This PR also:
ethereumjs-util
wildcard imports for explicit imports