-
Notifications
You must be signed in to change notification settings - Fork 777
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
EVM/VM: update imports/exports, async-eventemitter -> eventemitter2 Switch #2303
Conversation
Codecov Report
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. |
Just read up on the associated issue, what is the status of this here? I would assume from your latest comment ("will pick up on Monday" or similar) not yet ready for review? |
Correct. I need to figure out how to cleanly update the types for |
I ran the VM benchmarks with the new
So, on performance at least, looks good. Will rebase the PR on current master and we can verify everything is working ok. |
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.
Actually I just can't do much more on this review than sitting here before the monitor for 5 minutes and reflecting on the changes and impacts. 😀
I do think that changing on the event emitter class "on the go" has some risks and might trigger some not-thought-of consequenses for some use cases and we somewhat have to count in that some people might complain (or at least run into some issues).
On the other hand I think this is so much the right respectively an overdue and at the end good move to switch from this super outdated package to a modern, used and maintained library, that the benefits - at least mid-term - strongly outweight some short-term hickups.
So, long story short: will approve, also directly integrate into releases (will prepare right after merging in here).
@@ -150,7 +148,7 @@ export class EVM implements EVMInterface { | |||
|
|||
public readonly _transientStorage: TransientStorage | |||
|
|||
public readonly events: AsyncEventEmitter<EVMEvents> | |||
public readonly events: AsyncEventEmitter |
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.
Ugh.
@jochem-brouwer Seems we are loosing this typing here. 😬
I've tried to re-add, but seems evenemitter2 is not generic so this is not an option.
Hmm, sorry for that, I know this was some great improvement. Since we were so stuck on this import problem finally solved here and having this super-old dependency removed and updated would generally be really good I would have some stronger tendency for now to nevertheless go for it. Are you ok with this? 😬
I am currently not seeing an alternative.
Or are there eventual solutions here to get the typing back? Can't think of any right 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.
Seems this is being worked on (respectively: already done) here? 🤩
EventEmitter2/EventEmitter2#294
So maybe we can just bring this back in a follow-up bugfix release once this is ready to be published?
This is a breaking change, if EthereumJS follows semver. Ganache uses the vm.evm.events.on("step", async (event, next) => {
// ... some async things ...
next();
}); It doesn't appear that the new library you use has this option. Can you revert this change in the v6 release? Then maybe re-release with this PR as a v7? |
@davidmurdoch we'll discuss internally on how to proceed here and reach back here once we have settled. |
Fixes #2295