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

Convert bn to bigint #1771

Merged
merged 57 commits into from
Mar 14, 2022
Merged

Convert bn to bigint #1771

merged 57 commits into from
Mar 14, 2022

Conversation

holgerd77
Copy link
Member

Replaces #1744

Rebased by commit cherry-picking on top of latest develop rebase state from #1764.

Note that this is only the "dirty work" 😋 and there will likely be 1-2 glitches which still needs to be fixed.

We'll see along the test run.

@ryanio ryanio force-pushed the util-bigint-rebased-2022-03-09 branch from 849d692 to 6aa7089 Compare March 12, 2022 01:34
@ryanio ryanio force-pushed the util-bigint-rebased-2022-03-09 branch from 4afe30c to c865a1b Compare March 12, 2022 03:57
@ryanio ryanio force-pushed the util-bigint-rebased-2022-03-09 branch from 0b25c9c to 681b2af Compare March 12, 2022 07:25
@holgerd77
Copy link
Member Author

🎉 🎉 🎉

Is this ready to be merged? 🙂

@acolytec3
Copy link
Contributor

Barring any further review comments, I'd say yes. I've been running the client on mainnet using the BigInt pr and it seems to be running quite smoothly.

Copy link
Member Author

@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.

Crazy. Crazy. Crazy.

I guess I haven't seen such a PR in my entire EthereumJS time.

Thanks @acolytec3 @paulmillr and helping hands for this amazing work.

Will do a small addition (three methods accidentally reintroduced) and then merge in. 🎉

gasLimit: new BN(100),
gasUsed: new BN(60)
gasLimit: BigInt(100),
gasUsed: BigInt(60)
Copy link
Member Author

Choose a reason for hiding this comment

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

Total side note and no need to change but just wanted to mention: I guess we can very well encourage people to use the *n* notation in their own usage and use this in our examples as well (I know that this is likely due to some search-replace pattern just auto-replaced here).

throw new Error(`No (supported) active hardfork found`)
}
}

Copy link
Member Author

Choose a reason for hiding this comment

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

These methods have been removed along the work on #1753, so this here would be an accidental re-introduction. 😋

Will eventually directly address after a review myself.

if (rBN.isZero() || rBN.gt(SECP256K1_N) || sBN.isZero() || sBN.gt(SECP256K1_N)) {
if (
rBigInt === BigInt(0) ||
rBigInt >= SECP256K1_ORDER ||
Copy link
Member Author

Choose a reason for hiding this comment

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

Is this switching from gt to >= correct here?

(same below)

Copy link
Member

Choose a reason for hiding this comment

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

Valid rule: 0 < r < order, same for s.

So the previous rule was incorrect, the new rule is good.

Copy link
Member Author

@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.

LGTM.

Will admin-merge, can't approve since I re-submitted myself, but technically not my PR + rebase has been implicitly reviewed by the continued work being done.

@holgerd77 holgerd77 merged commit 7454ec5 into develop Mar 14, 2022
@acolytec3 acolytec3 mentioned this pull request Mar 23, 2022
holgerd77 added a commit that referenced this pull request Mar 24, 2022
* util: use bigints. Expose new secp constants

* common: use bigints

* tx: use bigints

* lint: fix util, tx, common

* tx: fix isSigned

* update comment block style to be picked up by vscode

* remove doc typo (extra `)

* tx: add isSigned() tests to base.spec.ts to iterate across txTypes

* block: bn to bigint changes wip

block: finish header changes

block: test updates

block: test fixes

Partial difficulty fixes

* block: fix homestead difficulty

* block: fix >= Byzantium difficulty

* BigInt conversion fixes

* block: update st.ok to st.equals

* Update readme to use bigints

* ethash: bn to bigint

* blockchain: wip bn to bigint changes

* devp2p: bn to bigint

* vm: wip remaining bn -> bigint

* vm: more test fixes

* fix runTx negative value args test, ensure balance does not go negative when using skipBalance

* vm: lint:fix

* re-add newline

* Blockchain: small rebase fix

* vm: Fix API tests

* client: bn to bigint updates in source

* client: various fixes

* client: last fixes

* client: integration test fixes

* replace st.ok usage with st.equal

* normalize st.equals to st.equal

* update toType cases

* nits, lint

* fix vm benchmarks

* client: fix fullEthereumService tests

* touch ups, fix miner integration test

* use prefix increment

* client: fix full sync test

* test fixes

* Fix reorg logic bug

* bnTo... function renaming and cleanup

* Goodbye bn.js

* reverse changelog changes

* nits

* remove more BN, more nits

* turn off restrict-plus-operands and remove disable overrides (does not work properly)

* more nits, update package-lock

* fix build errors, re-add @types/bn.js for rlp v2 export to fix build (will be removed in subsequent PR for rlp)

* replace miller-rabin (bn.js) with bigint-crypto-utils isProbablyPrime

* more nits / fixes

* Fix misplaced paren

* Fix miner test

* more nits

* fix buffer to big int

* set expectedTests back to >= comparison

* last fixes

* Removed re-introduced Common methods

Co-authored-by: Paul Miller <[email protected]>
Co-authored-by: Ryan Ghods <[email protected]>
Co-authored-by: acolytec3 <[email protected]>
Co-authored-by: Jochem Brouwer <[email protected]>
gabrocheleau pushed a commit that referenced this pull request Mar 27, 2022
author acolytec3 <[email protected]> 1648139433 -0400
committer Gabriel Rocheleau <[email protected]> 1648407705 -0400

Revert process code changes

Common: method deprecations (new) (#1698)

* common: delete deprecated hardforkBlock method

* common: adapt tests to use hardforkBlockBN

* common: delete deprecated nextHardforkBlock method

* common/tests: rename nextHardforkBlock() calls
to nextHardforkBlockBN()

* common: adapt tests to use BN.eqn(number)

* common: delete deprecated networkId() method

* common: delete tests for networkId()

* common: delete deprecated chainId() method

* common: delete tests for .chainId()

* delete deprecated forCustomChain meethod

* common: delete forCustomChain() test

* blockchain: switch forCustomChain to Common.custom

* client: switch fromCustomChain to Common.custom

* tx: switch forCustomChain to Common.custom

* VM: switch forCustomChain to Common.custom

* common: internalize _getInitializedChains() method

* common: delete deprecaed chains/index.ts file

* client: switch to Common._getInitializedChains

* common: remove genesisStates/index.ts

* common: remove test for genesisStates

Common: Rename *BN methods to non-BN names (#1709)

* common: rename nextHardforkBlockBN()
to nextHardforkBlock()

* common/tests: rename nextHardforkBlockBN()
to nextHardforkBlock()

* client: rename common.nextHardforkBlockBN()
to common.nextHardforkBlock()

* devp2p: rename common.nextHardforkBlockBN()
to common.nextHardforkBlock()

* common: rename hardforkBlockBN()
to hardforkBlock()

* common/tests: rename common.hardforkBlockBN()
to common.hardforkBlock()

* block: rename common.hardforkBlockBN()
to common.hardforkBlock()

* client: rename common.hardforkBlockBN()
to common.hardforkBlock()

* blockchain: rename common.hardforkBlockBN()
to common.hardforkBlock()

* devp2p: rename common.hardforkBlockBN()
to common.hardforkBlock()

* vm: rename common.hardforkBlockBN()
to common.hardforkBlock()

* common: rename chainIdBN()
to chainId()

* common/tests: rename common.chainIdBN()
to common.chainId()

* client: rename common.chainIdBN()
to common.chainId()

* blockchain: rename common.chainIdBN()
to common.chainId()

* devp2p: rename common.chainIdBN()
to common.chainId()

* tx: rename common.chainIdBN()
to common.chainId()

* vm: rename common.chainIdBN()
to common.chainId()

* common: rename networkIdBN() to networkId()

* common/test: rename common.networkIdBN()
to common.networkId()

* client: rename common.networkIdBN()
to common.networkId()

* block: rename common.networkIdBN()
to common.networkId()

VM: Replace BN.js with bigints, Util helpers (#1671)

* Replace BN.js with bigints in VM

* Fix byteLength computation in EXP handler

* Fix toTwos helper

* Compute TWO_POWE256 using math instead of hex

* Update packages/util/src/constants.ts

Co-authored-by: Ryan Ghods <[email protected]>

* Remove unused variable

* Fix exponent byte length calc

* Fix exp overflow

* Fix precompile bigint conversions

* Fix more bigint conversions

* Fix EXP opcode handler

* Fix logic bug in signextend

* vm/gas: fix EXTCODECOPY gas

* vm/gas: fix sha256 gas

* vm/gas: sha256 const -> let

* vm: lint

* vm/logic: fix sdiv/smod and fromTwos/toTwos

* vm/logic: fix SIGNEXTEND

* vm/logic: fix CALLDATALOAD padding

* vm/logic: remove weird comment

* Fix SAR opcode handler

* Use bufferToBigInt in Push opcode handler

* use bufferToBigInt everywhere

* Fix missing bufferToBigInt import

* Check for edge case in expmod

* Ignore prettier

* Update browser tsconfig to es2020 lib

* Remove dup ES2020 targets

* attempt to dedupe "target" and "lib" tsconfig values

* Update karma config to target es2020 in parser

* Various test fixes

* Lint and BN fixes

* Add bigint helpers to util

* lint fixes

* various bigint helper additions

* Lint fixes

* Fix bnToBigInt

* Lint/test fixes

* Switch Xn to BigInt(X)

* lint

* lint

* More Xn to BigInt(X) moves

Co-authored-by: Ryan Ghods <[email protected]>
Co-authored-by: Jochem Brouwer <[email protected]>
Co-authored-by: Jochem Brouwer <[email protected]>

monorepo: develop rebase 2022-02-23 fixes

Develop Rebase Fixes (2022-03-05)

Convert bn to bigint (#1771)

* util: use bigints. Expose new secp constants

* common: use bigints

* tx: use bigints

* lint: fix util, tx, common

* tx: fix isSigned

* update comment block style to be picked up by vscode

* remove doc typo (extra `)

* tx: add isSigned() tests to base.spec.ts to iterate across txTypes

* block: bn to bigint changes wip

block: finish header changes

block: test updates

block: test fixes

Partial difficulty fixes

* block: fix homestead difficulty

* block: fix >= Byzantium difficulty

* BigInt conversion fixes

* block: update st.ok to st.equals

* Update readme to use bigints

* ethash: bn to bigint

* blockchain: wip bn to bigint changes

* devp2p: bn to bigint

* vm: wip remaining bn -> bigint

* vm: more test fixes

* fix runTx negative value args test, ensure balance does not go negative when using skipBalance

* vm: lint:fix

* re-add newline

* Blockchain: small rebase fix

* vm: Fix API tests

* client: bn to bigint updates in source

* client: various fixes

* client: last fixes

* client: integration test fixes

* replace st.ok usage with st.equal

* normalize st.equals to st.equal

* update toType cases

* nits, lint

* fix vm benchmarks

* client: fix fullEthereumService tests

* touch ups, fix miner integration test

* use prefix increment

* client: fix full sync test

* test fixes

* Fix reorg logic bug

* bnTo... function renaming and cleanup

* Goodbye bn.js

* reverse changelog changes

* nits

* remove more BN, more nits

* turn off restrict-plus-operands and remove disable overrides (does not work properly)

* more nits, update package-lock

* fix build errors, re-add @types/bn.js for rlp v2 export to fix build (will be removed in subsequent PR for rlp)

* replace miller-rabin (bn.js) with bigint-crypto-utils isProbablyPrime

* more nits / fixes

* Fix misplaced paren

* Fix miner test

* more nits

* fix buffer to big int

* set expectedTests back to >= comparison

* last fixes

* Removed re-introduced Common methods

Co-authored-by: Paul Miller <[email protected]>
Co-authored-by: Ryan Ghods <[email protected]>
Co-authored-by: acolytec3 <[email protected]>
Co-authored-by: Jochem Brouwer <[email protected]>
holgerd77 added a commit that referenced this pull request Apr 5, 2022
* util: use bigints. Expose new secp constants

* common: use bigints

* tx: use bigints

* lint: fix util, tx, common

* tx: fix isSigned

* update comment block style to be picked up by vscode

* remove doc typo (extra `)

* tx: add isSigned() tests to base.spec.ts to iterate across txTypes

* block: bn to bigint changes wip

block: finish header changes

block: test updates

block: test fixes

Partial difficulty fixes

* block: fix homestead difficulty

* block: fix >= Byzantium difficulty

* BigInt conversion fixes

* block: update st.ok to st.equals

* Update readme to use bigints

* ethash: bn to bigint

* blockchain: wip bn to bigint changes

* devp2p: bn to bigint

* vm: wip remaining bn -> bigint

* vm: more test fixes

* fix runTx negative value args test, ensure balance does not go negative when using skipBalance

* vm: lint:fix

* re-add newline

* Blockchain: small rebase fix

* vm: Fix API tests

* client: bn to bigint updates in source

* client: various fixes

* client: last fixes

* client: integration test fixes

* replace st.ok usage with st.equal

* normalize st.equals to st.equal

* update toType cases

* nits, lint

* fix vm benchmarks

* client: fix fullEthereumService tests

* touch ups, fix miner integration test

* use prefix increment

* client: fix full sync test

* test fixes

* Fix reorg logic bug

* bnTo... function renaming and cleanup

* Goodbye bn.js

* reverse changelog changes

* nits

* remove more BN, more nits

* turn off restrict-plus-operands and remove disable overrides (does not work properly)

* more nits, update package-lock

* fix build errors, re-add @types/bn.js for rlp v2 export to fix build (will be removed in subsequent PR for rlp)

* replace miller-rabin (bn.js) with bigint-crypto-utils isProbablyPrime

* more nits / fixes

* Fix misplaced paren

* Fix miner test

* more nits

* fix buffer to big int

* set expectedTests back to >= comparison

* last fixes

* Removed re-introduced Common methods

Co-authored-by: Paul Miller <[email protected]>
Co-authored-by: Ryan Ghods <[email protected]>
Co-authored-by: acolytec3 <[email protected]>
Co-authored-by: Jochem Brouwer <[email protected]>
holgerd77 added a commit that referenced this pull request Apr 7, 2022
* util: use bigints. Expose new secp constants

* common: use bigints

* tx: use bigints

* lint: fix util, tx, common

* tx: fix isSigned

* update comment block style to be picked up by vscode

* remove doc typo (extra `)

* tx: add isSigned() tests to base.spec.ts to iterate across txTypes

* block: bn to bigint changes wip

block: finish header changes

block: test updates

block: test fixes

Partial difficulty fixes

* block: fix homestead difficulty

* block: fix >= Byzantium difficulty

* BigInt conversion fixes

* block: update st.ok to st.equals

* Update readme to use bigints

* ethash: bn to bigint

* blockchain: wip bn to bigint changes

* devp2p: bn to bigint

* vm: wip remaining bn -> bigint

* vm: more test fixes

* fix runTx negative value args test, ensure balance does not go negative when using skipBalance

* vm: lint:fix

* re-add newline

* Blockchain: small rebase fix

* vm: Fix API tests

* client: bn to bigint updates in source

* client: various fixes

* client: last fixes

* client: integration test fixes

* replace st.ok usage with st.equal

* normalize st.equals to st.equal

* update toType cases

* nits, lint

* fix vm benchmarks

* client: fix fullEthereumService tests

* touch ups, fix miner integration test

* use prefix increment

* client: fix full sync test

* test fixes

* Fix reorg logic bug

* bnTo... function renaming and cleanup

* Goodbye bn.js

* reverse changelog changes

* nits

* remove more BN, more nits

* turn off restrict-plus-operands and remove disable overrides (does not work properly)

* more nits, update package-lock

* fix build errors, re-add @types/bn.js for rlp v2 export to fix build (will be removed in subsequent PR for rlp)

* replace miller-rabin (bn.js) with bigint-crypto-utils isProbablyPrime

* more nits / fixes

* Fix misplaced paren

* Fix miner test

* more nits

* fix buffer to big int

* set expectedTests back to >= comparison

* last fixes

* Removed re-introduced Common methods

Co-authored-by: Paul Miller <[email protected]>
Co-authored-by: Ryan Ghods <[email protected]>
Co-authored-by: acolytec3 <[email protected]>
Co-authored-by: Jochem Brouwer <[email protected]>
gabrocheleau pushed a commit that referenced this pull request Apr 21, 2022
* util: use bigints. Expose new secp constants

* common: use bigints

* tx: use bigints

* lint: fix util, tx, common

* tx: fix isSigned

* update comment block style to be picked up by vscode

* remove doc typo (extra `)

* tx: add isSigned() tests to base.spec.ts to iterate across txTypes

* block: bn to bigint changes wip

block: finish header changes

block: test updates

block: test fixes

Partial difficulty fixes

* block: fix homestead difficulty

* block: fix >= Byzantium difficulty

* BigInt conversion fixes

* block: update st.ok to st.equals

* Update readme to use bigints

* ethash: bn to bigint

* blockchain: wip bn to bigint changes

* devp2p: bn to bigint

* vm: wip remaining bn -> bigint

* vm: more test fixes

* fix runTx negative value args test, ensure balance does not go negative when using skipBalance

* vm: lint:fix

* re-add newline

* Blockchain: small rebase fix

* vm: Fix API tests

* client: bn to bigint updates in source

* client: various fixes

* client: last fixes

* client: integration test fixes

* replace st.ok usage with st.equal

* normalize st.equals to st.equal

* update toType cases

* nits, lint

* fix vm benchmarks

* client: fix fullEthereumService tests

* touch ups, fix miner integration test

* use prefix increment

* client: fix full sync test

* test fixes

* Fix reorg logic bug

* bnTo... function renaming and cleanup

* Goodbye bn.js

* reverse changelog changes

* nits

* remove more BN, more nits

* turn off restrict-plus-operands and remove disable overrides (does not work properly)

* more nits, update package-lock

* fix build errors, re-add @types/bn.js for rlp v2 export to fix build (will be removed in subsequent PR for rlp)

* replace miller-rabin (bn.js) with bigint-crypto-utils isProbablyPrime

* more nits / fixes

* Fix misplaced paren

* Fix miner test

* more nits

* fix buffer to big int

* set expectedTests back to >= comparison

* last fixes

* Removed re-introduced Common methods

Co-authored-by: Paul Miller <[email protected]>
Co-authored-by: Ryan Ghods <[email protected]>
Co-authored-by: acolytec3 <[email protected]>
Co-authored-by: Jochem Brouwer <[email protected]>
g11tech pushed a commit that referenced this pull request Apr 29, 2022
* util: use bigints. Expose new secp constants

* common: use bigints

* tx: use bigints

* lint: fix util, tx, common

* tx: fix isSigned

* update comment block style to be picked up by vscode

* remove doc typo (extra `)

* tx: add isSigned() tests to base.spec.ts to iterate across txTypes

* block: bn to bigint changes wip

block: finish header changes

block: test updates

block: test fixes

Partial difficulty fixes

* block: fix homestead difficulty

* block: fix >= Byzantium difficulty

* BigInt conversion fixes

* block: update st.ok to st.equals

* Update readme to use bigints

* ethash: bn to bigint

* blockchain: wip bn to bigint changes

* devp2p: bn to bigint

* vm: wip remaining bn -> bigint

* vm: more test fixes

* fix runTx negative value args test, ensure balance does not go negative when using skipBalance

* vm: lint:fix

* re-add newline

* Blockchain: small rebase fix

* vm: Fix API tests

* client: bn to bigint updates in source

* client: various fixes

* client: last fixes

* client: integration test fixes

* replace st.ok usage with st.equal

* normalize st.equals to st.equal

* update toType cases

* nits, lint

* fix vm benchmarks

* client: fix fullEthereumService tests

* touch ups, fix miner integration test

* use prefix increment

* client: fix full sync test

* test fixes

* Fix reorg logic bug

* bnTo... function renaming and cleanup

* Goodbye bn.js

* reverse changelog changes

* nits

* remove more BN, more nits

* turn off restrict-plus-operands and remove disable overrides (does not work properly)

* more nits, update package-lock

* fix build errors, re-add @types/bn.js for rlp v2 export to fix build (will be removed in subsequent PR for rlp)

* replace miller-rabin (bn.js) with bigint-crypto-utils isProbablyPrime

* more nits / fixes

* Fix misplaced paren

* Fix miner test

* more nits

* fix buffer to big int

* set expectedTests back to >= comparison

* last fixes

* Removed re-introduced Common methods

Co-authored-by: Paul Miller <[email protected]>
Co-authored-by: Ryan Ghods <[email protected]>
Co-authored-by: acolytec3 <[email protected]>
Co-authored-by: Jochem Brouwer <[email protected]>
holgerd77 added a commit that referenced this pull request May 4, 2022
* util: use bigints. Expose new secp constants

* common: use bigints

* tx: use bigints

* lint: fix util, tx, common

* tx: fix isSigned

* update comment block style to be picked up by vscode

* remove doc typo (extra `)

* tx: add isSigned() tests to base.spec.ts to iterate across txTypes

* block: bn to bigint changes wip

block: finish header changes

block: test updates

block: test fixes

Partial difficulty fixes

* block: fix homestead difficulty

* block: fix >= Byzantium difficulty

* BigInt conversion fixes

* block: update st.ok to st.equals

* Update readme to use bigints

* ethash: bn to bigint

* blockchain: wip bn to bigint changes

* devp2p: bn to bigint

* vm: wip remaining bn -> bigint

* vm: more test fixes

* fix runTx negative value args test, ensure balance does not go negative when using skipBalance

* vm: lint:fix

* re-add newline

* Blockchain: small rebase fix

* vm: Fix API tests

* client: bn to bigint updates in source

* client: various fixes

* client: last fixes

* client: integration test fixes

* replace st.ok usage with st.equal

* normalize st.equals to st.equal

* update toType cases

* nits, lint

* fix vm benchmarks

* client: fix fullEthereumService tests

* touch ups, fix miner integration test

* use prefix increment

* client: fix full sync test

* test fixes

* Fix reorg logic bug

* bnTo... function renaming and cleanup

* Goodbye bn.js

* reverse changelog changes

* nits

* remove more BN, more nits

* turn off restrict-plus-operands and remove disable overrides (does not work properly)

* more nits, update package-lock

* fix build errors, re-add @types/bn.js for rlp v2 export to fix build (will be removed in subsequent PR for rlp)

* replace miller-rabin (bn.js) with bigint-crypto-utils isProbablyPrime

* more nits / fixes

* Fix misplaced paren

* Fix miner test

* more nits

* fix buffer to big int

* set expectedTests back to >= comparison

* last fixes

* Removed re-introduced Common methods

Co-authored-by: Paul Miller <[email protected]>
Co-authored-by: Ryan Ghods <[email protected]>
Co-authored-by: acolytec3 <[email protected]>
Co-authored-by: Jochem Brouwer <[email protected]>
g11tech pushed a commit that referenced this pull request Jun 2, 2022
* util: use bigints. Expose new secp constants

* common: use bigints

* tx: use bigints

* lint: fix util, tx, common

* tx: fix isSigned

* update comment block style to be picked up by vscode

* remove doc typo (extra `)

* tx: add isSigned() tests to base.spec.ts to iterate across txTypes

* block: bn to bigint changes wip

block: finish header changes

block: test updates

block: test fixes

Partial difficulty fixes

* block: fix homestead difficulty

* block: fix >= Byzantium difficulty

* BigInt conversion fixes

* block: update st.ok to st.equals

* Update readme to use bigints

* ethash: bn to bigint

* blockchain: wip bn to bigint changes

* devp2p: bn to bigint

* vm: wip remaining bn -> bigint

* vm: more test fixes

* fix runTx negative value args test, ensure balance does not go negative when using skipBalance

* vm: lint:fix

* re-add newline

* Blockchain: small rebase fix

* vm: Fix API tests

* client: bn to bigint updates in source

* client: various fixes

* client: last fixes

* client: integration test fixes

* replace st.ok usage with st.equal

* normalize st.equals to st.equal

* update toType cases

* nits, lint

* fix vm benchmarks

* client: fix fullEthereumService tests

* touch ups, fix miner integration test

* use prefix increment

* client: fix full sync test

* test fixes

* Fix reorg logic bug

* bnTo... function renaming and cleanup

* Goodbye bn.js

* reverse changelog changes

* nits

* remove more BN, more nits

* turn off restrict-plus-operands and remove disable overrides (does not work properly)

* more nits, update package-lock

* fix build errors, re-add @types/bn.js for rlp v2 export to fix build (will be removed in subsequent PR for rlp)

* replace miller-rabin (bn.js) with bigint-crypto-utils isProbablyPrime

* more nits / fixes

* Fix misplaced paren

* Fix miner test

* more nits

* fix buffer to big int

* set expectedTests back to >= comparison

* last fixes

* Removed re-introduced Common methods

Co-authored-by: Paul Miller <[email protected]>
Co-authored-by: Ryan Ghods <[email protected]>
Co-authored-by: acolytec3 <[email protected]>
Co-authored-by: Jochem Brouwer <[email protected]>
g11tech pushed a commit that referenced this pull request Jun 2, 2022
* util: use bigints. Expose new secp constants

* common: use bigints

* tx: use bigints

* lint: fix util, tx, common

* tx: fix isSigned

* update comment block style to be picked up by vscode

* remove doc typo (extra `)

* tx: add isSigned() tests to base.spec.ts to iterate across txTypes

* block: bn to bigint changes wip

block: finish header changes

block: test updates

block: test fixes

Partial difficulty fixes

* block: fix homestead difficulty

* block: fix >= Byzantium difficulty

* BigInt conversion fixes

* block: update st.ok to st.equals

* Update readme to use bigints

* ethash: bn to bigint

* blockchain: wip bn to bigint changes

* devp2p: bn to bigint

* vm: wip remaining bn -> bigint

* vm: more test fixes

* fix runTx negative value args test, ensure balance does not go negative when using skipBalance

* vm: lint:fix

* re-add newline

* Blockchain: small rebase fix

* vm: Fix API tests

* client: bn to bigint updates in source

* client: various fixes

* client: last fixes

* client: integration test fixes

* replace st.ok usage with st.equal

* normalize st.equals to st.equal

* update toType cases

* nits, lint

* fix vm benchmarks

* client: fix fullEthereumService tests

* touch ups, fix miner integration test

* use prefix increment

* client: fix full sync test

* test fixes

* Fix reorg logic bug

* bnTo... function renaming and cleanup

* Goodbye bn.js

* reverse changelog changes

* nits

* remove more BN, more nits

* turn off restrict-plus-operands and remove disable overrides (does not work properly)

* more nits, update package-lock

* fix build errors, re-add @types/bn.js for rlp v2 export to fix build (will be removed in subsequent PR for rlp)

* replace miller-rabin (bn.js) with bigint-crypto-utils isProbablyPrime

* more nits / fixes

* Fix misplaced paren

* Fix miner test

* more nits

* fix buffer to big int

* set expectedTests back to >= comparison

* last fixes

* Removed re-introduced Common methods

Co-authored-by: Paul Miller <[email protected]>
Co-authored-by: Ryan Ghods <[email protected]>
Co-authored-by: acolytec3 <[email protected]>
Co-authored-by: Jochem Brouwer <[email protected]>
g11tech pushed a commit that referenced this pull request Jun 2, 2022
* util: use bigints. Expose new secp constants

* common: use bigints

* tx: use bigints

* lint: fix util, tx, common

* tx: fix isSigned

* update comment block style to be picked up by vscode

* remove doc typo (extra `)

* tx: add isSigned() tests to base.spec.ts to iterate across txTypes

* block: bn to bigint changes wip

block: finish header changes

block: test updates

block: test fixes

Partial difficulty fixes

* block: fix homestead difficulty

* block: fix >= Byzantium difficulty

* BigInt conversion fixes

* block: update st.ok to st.equals

* Update readme to use bigints

* ethash: bn to bigint

* blockchain: wip bn to bigint changes

* devp2p: bn to bigint

* vm: wip remaining bn -> bigint

* vm: more test fixes

* fix runTx negative value args test, ensure balance does not go negative when using skipBalance

* vm: lint:fix

* re-add newline

* Blockchain: small rebase fix

* vm: Fix API tests

* client: bn to bigint updates in source

* client: various fixes

* client: last fixes

* client: integration test fixes

* replace st.ok usage with st.equal

* normalize st.equals to st.equal

* update toType cases

* nits, lint

* fix vm benchmarks

* client: fix fullEthereumService tests

* touch ups, fix miner integration test

* use prefix increment

* client: fix full sync test

* test fixes

* Fix reorg logic bug

* bnTo... function renaming and cleanup

* Goodbye bn.js

* reverse changelog changes

* nits

* remove more BN, more nits

* turn off restrict-plus-operands and remove disable overrides (does not work properly)

* more nits, update package-lock

* fix build errors, re-add @types/bn.js for rlp v2 export to fix build (will be removed in subsequent PR for rlp)

* replace miller-rabin (bn.js) with bigint-crypto-utils isProbablyPrime

* more nits / fixes

* Fix misplaced paren

* Fix miner test

* more nits

* fix buffer to big int

* set expectedTests back to >= comparison

* last fixes

* Removed re-introduced Common methods

Co-authored-by: Paul Miller <[email protected]>
Co-authored-by: Ryan Ghods <[email protected]>
Co-authored-by: acolytec3 <[email protected]>
Co-authored-by: Jochem Brouwer <[email protected]>
g11tech pushed a commit that referenced this pull request Jun 3, 2022
* util: use bigints. Expose new secp constants

* common: use bigints

* tx: use bigints

* lint: fix util, tx, common

* tx: fix isSigned

* update comment block style to be picked up by vscode

* remove doc typo (extra `)

* tx: add isSigned() tests to base.spec.ts to iterate across txTypes

* block: bn to bigint changes wip

block: finish header changes

block: test updates

block: test fixes

Partial difficulty fixes

* block: fix homestead difficulty

* block: fix >= Byzantium difficulty

* BigInt conversion fixes

* block: update st.ok to st.equals

* Update readme to use bigints

* ethash: bn to bigint

* blockchain: wip bn to bigint changes

* devp2p: bn to bigint

* vm: wip remaining bn -> bigint

* vm: more test fixes

* fix runTx negative value args test, ensure balance does not go negative when using skipBalance

* vm: lint:fix

* re-add newline

* Blockchain: small rebase fix

* vm: Fix API tests

* client: bn to bigint updates in source

* client: various fixes

* client: last fixes

* client: integration test fixes

* replace st.ok usage with st.equal

* normalize st.equals to st.equal

* update toType cases

* nits, lint

* fix vm benchmarks

* client: fix fullEthereumService tests

* touch ups, fix miner integration test

* use prefix increment

* client: fix full sync test

* test fixes

* Fix reorg logic bug

* bnTo... function renaming and cleanup

* Goodbye bn.js

* reverse changelog changes

* nits

* remove more BN, more nits

* turn off restrict-plus-operands and remove disable overrides (does not work properly)

* more nits, update package-lock

* fix build errors, re-add @types/bn.js for rlp v2 export to fix build (will be removed in subsequent PR for rlp)

* replace miller-rabin (bn.js) with bigint-crypto-utils isProbablyPrime

* more nits / fixes

* Fix misplaced paren

* Fix miner test

* more nits

* fix buffer to big int

* set expectedTests back to >= comparison

* last fixes

* Removed re-introduced Common methods

Co-authored-by: Paul Miller <[email protected]>
Co-authored-by: Ryan Ghods <[email protected]>
Co-authored-by: acolytec3 <[email protected]>
Co-authored-by: Jochem Brouwer <[email protected]>
holgerd77 added a commit that referenced this pull request Jun 8, 2022
* util: use bigints. Expose new secp constants

* common: use bigints

* tx: use bigints

* lint: fix util, tx, common

* tx: fix isSigned

* update comment block style to be picked up by vscode

* remove doc typo (extra `)

* tx: add isSigned() tests to base.spec.ts to iterate across txTypes

* block: bn to bigint changes wip

block: finish header changes

block: test updates

block: test fixes

Partial difficulty fixes

* block: fix homestead difficulty

* block: fix >= Byzantium difficulty

* BigInt conversion fixes

* block: update st.ok to st.equals

* Update readme to use bigints

* ethash: bn to bigint

* blockchain: wip bn to bigint changes

* devp2p: bn to bigint

* vm: wip remaining bn -> bigint

* vm: more test fixes

* fix runTx negative value args test, ensure balance does not go negative when using skipBalance

* vm: lint:fix

* re-add newline

* Blockchain: small rebase fix

* vm: Fix API tests

* client: bn to bigint updates in source

* client: various fixes

* client: last fixes

* client: integration test fixes

* replace st.ok usage with st.equal

* normalize st.equals to st.equal

* update toType cases

* nits, lint

* fix vm benchmarks

* client: fix fullEthereumService tests

* touch ups, fix miner integration test

* use prefix increment

* client: fix full sync test

* test fixes

* Fix reorg logic bug

* bnTo... function renaming and cleanup

* Goodbye bn.js

* reverse changelog changes

* nits

* remove more BN, more nits

* turn off restrict-plus-operands and remove disable overrides (does not work properly)

* more nits, update package-lock

* fix build errors, re-add @types/bn.js for rlp v2 export to fix build (will be removed in subsequent PR for rlp)

* replace miller-rabin (bn.js) with bigint-crypto-utils isProbablyPrime

* more nits / fixes

* Fix misplaced paren

* Fix miner test

* more nits

* fix buffer to big int

* set expectedTests back to >= comparison

* last fixes

* Removed re-introduced Common methods

Co-authored-by: Paul Miller <[email protected]>
Co-authored-by: Ryan Ghods <[email protected]>
Co-authored-by: acolytec3 <[email protected]>
Co-authored-by: Jochem Brouwer <[email protected]>
@holgerd77 holgerd77 deleted the util-bigint-rebased-2022-03-09 branch June 30, 2022 12:35
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.

5 participants