-
Notifications
You must be signed in to change notification settings - Fork 789
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
Develop rebased on 3e4e7be #1928
Conversation
Oh, that's so so great, thanks a lot Gajinder!!! ❤️ 🙏 🚀 To prepare for the subsequent process: so there is this last I guess (hope 😬) this will be easily integratable here (basically by an additional rebase towards this last commit, should not be to "conflicty" since only/mostly doc files and package.json files are touched?). So: I will basically merge "right now" (or in the next 30 minutes or so). Side note: I guess we might be early here then - depending on how the rebase is going, will likely be a tricky last one - and eventually directly switch onto the newly rebased |
Update: merged in the release PR (so: #1927) |
Another update: if you re-rebase 😋: wait a minute, I guess I would have needed to submit an updated |
I've got a bug in the client which blocks me from doing the release round: #1930 If you have some capacity right now (or relatively soon) and could re-prioritize and have a look that would be appreciated! 🙂 |
f781f06
to
a81f099
Compare
(can be fixed just by a normal PR towards master) |
a81f099
to
0cf5815
Compare
cherry picking sounds good @holgerd77 👍 |
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. |
I've now also merged in #1867, would also need to be cherry-picked ( This is the last PR I would merge, so we are now on both the final (for the rebase) Will now do the last round of v5 releases and also branch off the |
* vm: add codeHash db prefix to stateManager * vm: tests: make tests use StateManager instead of trie at utilization vm: tests: remove now passing test from skipTests * vm: fix tests / fix runBlock/runBlockchain tests * vm: tests: fix cleaning up untouched accounts in tests * vm -> StateManager: added comment on CODEHASH_PREFIX Co-authored-by: holgerd77 <Holger.Drewes@gmail.com>
Co-authored-by: steveluscher <github@steveluscher.com>
…orks to VM (#1649) * common: remove onlySupported and onlyActive hf options * vm: move supportedHardforks option from common * common: remove supportedHardforks option * common: update README for supportedHardforks removal * vm: update README for supportedHardforks addition * common: cleanup in src/index.ts * vm: refactor supportedHardforks per PR feedback * common: remove _chooseHardfork method per PR feedback * vm: updated README per PR feedback * vm: supportedHardforks local variable, switch to enum
* 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 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()
* 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>
* Tx: Remove baseTransaction.transactionType * tx: remove get senderR() * tx: remove test for senderR() * tx: remove senderS() * tx: remove test for senderS() * tx: remove yParity / replace with v * tx: remove test for yParity() * Tx: remove fromRlpSerializedTx() * Tx: remove test for fromRlpSerializedTx() * Tx: remove _unsignedTxImplementsEIP155 * Tx: Remove _signedTxImplementsEIP155() * Tx: Remove TransactionFactory.getTransactionClass * Tx: Remove test for .getTransactionClass()
* common: set default hardfork to london * vm: set default hardfork to london * vm: update tests after default hardfork change * vm: update default hardfork in tester config * block: update default hardfork and fix tests * blockchain: fix tests for london as default hardfork * tx: set default hardfork to london * block: fix for uncles at hardfork transition test * blockchain: fix for hardfork in reorg test * ethash: fix ethash tests for default hardfork change * tx: remove README section about hardforks * client: fix client tests for default hardfork change * block: rename testdata files for pre-london * blockchain: rename testdata files for pre-london * vm: fix examples for London hardfork change Co-authored-by: Emerson Macro <emersonmacro@gmail.com>
* common: rename hardforkIsActiveOnChain to isIncludedHardfork * common: remove activeHardfork and activeHardforks * common: adapt _getHardfork, remove isIncludedHardfork * common: type fixes in forkHash
* add modifyAccountFields method and tests * use new method in eei * update usage in various tests
* Common: Return BigInt for param() functionality Fixes #1846 * Change param getters to throw on non-existent value * Fixes * switch return to bigint or undefined * Switch param getters to return undefined and fix common tests * tx: changes to accomodate param getters * More changes * More adjustments * Fix NaN bug in opcode fee builder * Hack to fix EIP-2537 edge case * client: fix test syntax * lint * Return 0 when param doesn't exist * Spelling, dedup param usage * Update `paramByEip` to allow undefined * Hardcode EIP-2537 gas discount array * uncomment test
* block: update to rlp v3 * blockchain: update to rlp v3 * client: update to rlp v3 * devp2p: update to rlp v3 * ethash: fix test to pass buffer * trie: update to rlp v3 * tx: update to rlp v3 * util: update to rlp v3 * vm: update to rlp v3 * lint, etc. fixes and update package-lock * address review comments
* blockchain: remove 'void' from iterator() return * vm: remove void from vm.runBlockchain() return types * client: adapt VMExecution to stricter blockchain.iterator() call * vm: reintroduce deleted tests for blockchain.getIteratorHead() * vm: correct method name in test
* VM -> EVM/VM Refactor: new EVMOpts EVM options dict, move common and supported HFs to EVM * VM -> EVM/VM Refactor: standalone DEBUG property in EVM and Interpreter * VM -> EVM/VM Refactor: standalone EVM stateManager option and property * VM -> EVM/VM Refactor: moved runCall()/runCode() to EVM, deleted dedicated files, top-level EVM instantiation in VM * VM -> EVM/VM Refactor: made EVM AsyncEventEmitter, moved beforeMessage, afterMessage, newContract, step events to EVM * VM -> EVM/VM Refactor: moved allowUnlimitedContractSize option to EVM * VM -> EVM/VM Refactor: moved opcode and gas handler functionality and options to EVM, removed EVM/Precompiles VM dependency * Client: fix cliqueActiveSigners method assignments * VM: refactor TxContext to an interface * VM: improve Message class types and defaults handling * VM: refactor runCall and executeMessage into unified runCall * VM: fix gas refund reset to 0 after tx finishes and fix parenthesis in runBlock receipt ternary * VM: reimplement transient storage clear method * VM: use VM async create method instead of constructor * VM: unify interpreter and evm DEBUG property Co-authored-by: Holger Drewes <Holger.Drewes@gmail.com>
* Add typing to hardforkforForkhash * Type initializedChains * Union type for consensus algorithm * Add check for invalid chain ID * Add cliqueOpts type * block: cast to cliqueOpts * client: cast to cliqueOpts in miner * Fix tests * Add back chainsType import * Add back missing types * Address comments * lint * Address feedback
* common: create new common.ts * common: finish reorganize/rename in common * Address comments
* tx: edit legacyTransaction to throw when hash() called on unsigned tx * tx: adapt legacy.spec test to throw on unsigned tx.hash() * tx: edit tests which call hash() on unsigned tx
208f232
to
dc69483
Compare
* simplify setting blockchan genesis parameters for future extensibility, make timestamp optional instead of `| null` * move EOF one folder up, export default rather than wildcard import * remove `assert` usage from vm/precompiles, devp2p * eof: reinstate individual imports * make genesisBlock a property and add a separate createGenesisBlock method * fix mock, remove commented out code (double checked, geth does not return the eth protocol versions in admin_nodeInfo, so this is safely removable) * remove old chain/hardfork check * simplify errors, use increment operator, use for..of rather than forEach
* vm: update eip 3074 * vm: eip3074 test fixes start * vm: fix eip3074 tests * vm: expand eip3074 tests * vm: add eip 3074 tests * vm: address 128n -> BigInt(128)
dc69483
to
e328bd5
Compare
Oh, that already looks pretty good! 🙂 |
} | ||
} | ||
|
||
let chainIdBN |
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 has been fixed in the "wrong direction", so the removed code is actually the correct one, see #1905 for context and discussion.
So fix should be just to replace v.ltn(37) && !v.eqn(27) && !v.eqn(28)
with the normal BigInt-operator comparisons and literally nothing else.
(let me know if I overlook something)
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.
Update: ah, just seeing that Andrew addressed this in a follow-up commit, so not an issue.
head: new BN(raw[0]), | ||
tail: new BN(raw[1]), | ||
head: bufferToBigInt(raw[0]), | ||
tail: bufferToBigInt(raw[1]), |
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.
Ah, a lot of BigInt-related BeaconSync and Skeleton changes, makes sense! 🙂
default: | ||
throw new Error(`tx of type ${tx.type} unknown`) | ||
} | ||
} |
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.
Out of scope of this PR definitely but just for some thought: I wonder if such kind of a helper function would rather be some addition for the tx library itself? 🤔
} | ||
} | ||
|
||
let chainIdBN |
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.
Update: ah, just seeing that Andrew addressed this in a follow-up commit, so not an issue.
packages/blockchain/src/index.ts
Outdated
default: | ||
throw new Error(`consensus algorithm ${this._common.consensusAlgorithm()} not supported`) | ||
} | ||
} |
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.
Whew, that's a hard one: a whole new API method introduced in a rebase-fix-PR. 😋 😬
Are we confident enough that we want to expose? Or would we rather want to keep this private (or rather: protected) for now?
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.
yea it was tricky one to find! well will move to protected
👍
617db09
to
2df3ff4
Compare
* fix legacyTransaction rebase * state manager build fx * rebase fixes * pick the packages/blockchain/src/index.js from develop * some more bn related fixes * update the fix corresponding to #1931 * client fixes * Remove bn ops * fix vm test util * fix memory write extend * fix lint * update blockchain runner from develop * Add v check back for legacy Txs * Fix miner tests * resolve skeleton.getBlock errors because of mismatching config w.r.t. the one with which blocks were created * proper undefined comparision for bigint * provide genesis hash to skelteons block 1 * switch consensus algo on hardfork consensus change * base fee proper fix * fix txpool specs * fix eth protocol spec * pending block spec fix * fix miner/miner spec * fix send raw transaction spec * reset the miner spec changes
2df3ff4
to
5d5a841
Compare
@holgerd77 @acolytec3 i think all set for promoting as master, though some fixes might followup as I try it out on testnets. but hopefully nothing major. |
Branch has been applied to master via #1943, will close. |
rebased on