-
Notifications
You must be signed in to change notification settings - Fork 771
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
vm, client: continuing v6 breaking changes #1815
Conversation
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. |
50a8612
to
4cc3a7f
Compare
Force-pushed on this with the cherry-picked relevant commits. |
Not sure why CI is stuck here, otherwise I would give this a go! |
thanks, looks good 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.
LGTM
ok, noticed some last few things going over the diff again, this should be ready to merge now, thanks @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.
Looks great, and probably a long slog. I left one comment about an export that isn't directly related to the overall project of breaking changes but one we should consider.
@@ -6,7 +6,8 @@ import { | |||
BlockBodyBuffer, | |||
} from '@ethereumjs/block' | |||
import { TransactionFactory, TypedTransaction } from '@ethereumjs/tx' | |||
import { bigIntToBuffer, bufferToBigInt, bufferToInt, intToBuffer, rlp } from 'ethereumjs-util' | |||
import { encodeReceipt } from '@ethereumjs/vm/dist/runBlock' |
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.
Is there an easy way to move encodeReceipt
to a package level export since we're using this outside of the vm
package and this import looks kinda hideous, maybe in a new util.ts
since this looks like a pure function? This could be a follow-up as part of a more general overhaul of the vm package getting away from default exports and definitely shouldn't hold up merging this.
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.
yeah, good eye, this isn't as scary as it looks (we access vm/dist in a few other places) but definitely a good point to ease access a bit, i think this is likely what holger was aiming with this breaking releases task:
- Restructure/sort VM exports (directly expose Bloom, other?, unified type location, type/interface exposure, index.ts -> vm.ts+ index.ts only for exports
let's target as a follow-up PR, since this one is already kind of involved, we can hone in on it separately
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.
702dc22
to
045cfb4
Compare
Rebased this and fixed some small conflicts along. |
@@ -288,7 +283,7 @@ export default class VM extends AsyncEventEmitter { | |||
if (opts.stateManager) { | |||
this.stateManager = opts.stateManager | |||
} else { | |||
const trie = opts.state ?? new Trie() | |||
const trie = new Trie() |
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.
Side note, not directly related: I guess it would rather make sense, to make trie
optional for the StateManager
options and then do this trie instantiation there if not provided.
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.
that makes sense, i should have checked, we already do that :) so i can just remove this, i will make a note for myself to do in a follow up develop PR
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.
Looks great, again, thanks a lot for all the code clean-ups! 😄
* vm: v6 breaking changes * update benchmark util to use gasUsed as bigint * VM: fixed gasUsed rebase related bug Co-authored-by: Holger Drewes <Holger.Drewes@gmail.com>
* vm: v6 breaking changes * update benchmark util to use gasUsed as bigint * VM: fixed gasUsed rebase related bug Co-authored-by: Holger Drewes <Holger.Drewes@gmail.com>
* vm: v6 breaking changes * update benchmark util to use gasUsed as bigint * VM: fixed gasUsed rebase related bug Co-authored-by: Holger Drewes <Holger.Drewes@gmail.com>
* vm: v6 breaking changes * update benchmark util to use gasUsed as bigint * VM: fixed gasUsed rebase related bug Co-authored-by: Holger Drewes <Holger.Drewes@gmail.com>
* vm: v6 breaking changes * update benchmark util to use gasUsed as bigint * VM: fixed gasUsed rebase related bug Co-authored-by: Holger Drewes <Holger.Drewes@gmail.com>
* vm: v6 breaking changes * update benchmark util to use gasUsed as bigint * VM: fixed gasUsed rebase related bug Co-authored-by: Holger Drewes <Holger.Drewes@gmail.com>
* vm: v6 breaking changes * update benchmark util to use gasUsed as bigint * VM: fixed gasUsed rebase related bug Co-authored-by: Holger Drewes <Holger.Drewes@gmail.com>
* vm: v6 breaking changes * update benchmark util to use gasUsed as bigint * VM: fixed gasUsed rebase related bug Co-authored-by: Holger Drewes <Holger.Drewes@gmail.com>
* vm: v6 breaking changes * update benchmark util to use gasUsed as bigint * VM: fixed gasUsed rebase related bug Co-authored-by: Holger Drewes <Holger.Drewes@gmail.com>
This PR accomplishes VM breaking change tasks listed in #1717:
state
(Trie) constructor optiongenerateTxReceipt
function inrunBlock
(preferring newer version located inrunTx
), removeReceipt
re-exportsStateManager.getStateRoot()
force=true
parameter (also in interface)EIP2930Receipt
andEIP1559Receipt
typesgasUsed
deduplication Difference between gasUsed and execResult.gasUsed #1446 (comment)runCode
throws ifgasLimit
isundefined
: thegasLimit
parameter is mandatorygasRefund
to a tx-level result object instead ofExecResult
todo link