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

Common method deprecations (new) #1698

Merged
merged 20 commits into from
Feb 8, 2022
Merged

Conversation

ScottyPoi
Copy link
Contributor

@ScottyPoi ScottyPoi commented Feb 7, 2022

#1633

  • common: delete deprecated hardforkBlock method
  • common: rename hardforkBlock() calls in tests to hardforkBlockBN()
  • common: adapt tests to use BN.eqn(number)

  • common: delete deprecated nextHardforkBlock method
  • common: rename nextHardforkBlock() calls in tests to nextHardforkBlockBN()
  • common: adapt tests to use BN.eqn(number)

  • common: delete deprecated chainId() method
  • common: delete chainId() tests

  • common: delete deprecated networkId() method
  • common: delete networkId() tests

  • common: delete deprecated forCustomChain() method
  • common: switch forCustomChain usage to Common.custom
  • blockchain: switch forCustomChain usage to Common.custom
  • client: switch forCustomChain usage to Common.custom
  • tx: switch forCustomChain usage to Common.custom
  • vm: switch forCustomChain usage to Common.custom

  • common: remove chains/index.ts
  • common: internalize _getInitializedChains ()
  • common: remove genesisStates/index.ts
  • common: remove test/genesisStates
  • client: remove import for _getInitializedChain() & change call to Common._getInitializedChains()

@codecov
Copy link

codecov bot commented Feb 7, 2022

Codecov Report

Merging #1698 (87b1935) into develop (6b031c0) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

Flag Coverage Δ
block 85.01% <ø> (ø)
blockchain 83.28% <ø> (ø)
client 71.22% <ø> (ø)
common 93.12% <100.00%> (-0.31%) ⬇️
devp2p 82.63% <ø> (ø)
ethash 90.76% <ø> (ø)
trie 86.18% <ø> (ø)
tx 89.94% <100.00%> (ø)
util 89.86% <ø> (ø)
vm 81.32% <ø> (ø)

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

@ScottyPoi ScottyPoi force-pushed the common-method-deprecations-new branch from 4e4615a to 0767936 Compare February 8, 2022 01:48
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.

Hi Scotty,
thanks a lot, this looks fantastic 👍, super clean and great to review.

We still need the final renaming here, so e.g. nextHardforkBlockBN -> nextHardforkBlock, but I guess this can be addressed in a follow-up PR.

Will approve and merge.

@holgerd77 holgerd77 merged commit 0ba70fb into develop Feb 8, 2022
@holgerd77 holgerd77 deleted the common-method-deprecations-new branch February 8, 2022 14:05
acolytec3 pushed a commit that referenced this pull request Feb 22, 2022
* 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
holgerd77 pushed a commit that referenced this pull request Feb 23, 2022
* 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
holgerd77 pushed a commit that referenced this pull request Feb 23, 2022
* 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
holgerd77 pushed a commit that referenced this pull request Mar 5, 2022
* 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
holgerd77 pushed a commit that referenced this pull request Mar 24, 2022
* 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
gabrocheleau pushed a commit that referenced this pull request Mar 27, 2022
author acolytec3 <17355484+acolytec3@users.noreply.github.com> 1648139433 -0400
committer Gabriel Rocheleau <contact@rockwaterweb.com> 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 <ryan@ryanio.com>

* 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 <ryan@ryanio.com>
Co-authored-by: Jochem Brouwer <jochem.brouwer@nslogin.nl>
Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com>

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 <paul@paulmillr.com>
Co-authored-by: Ryan Ghods <ryan@ryanio.com>
Co-authored-by: acolytec3 <17355484+acolytec3@users.noreply.github.com>
Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com>
holgerd77 pushed a commit that referenced this pull request Apr 5, 2022
* 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
holgerd77 pushed a commit that referenced this pull request Apr 7, 2022
* 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
g11tech pushed a commit that referenced this pull request Apr 29, 2022
* 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
holgerd77 pushed a commit that referenced this pull request May 4, 2022
* 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
g11tech pushed a commit that referenced this pull request Jun 2, 2022
* 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
g11tech pushed a commit that referenced this pull request Jun 2, 2022
* 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
g11tech pushed a commit that referenced this pull request Jun 2, 2022
* 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
g11tech pushed a commit that referenced this pull request Jun 3, 2022
* 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
holgerd77 pushed a commit that referenced this pull request Jun 8, 2022
* 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
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.

None yet

2 participants