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

VMOpts and VM should use BlockchainInterface and not Blockchain #1182

Closed
alcuadrado opened this issue Mar 31, 2021 · 3 comments
Closed

VMOpts and VM should use BlockchainInterface and not Blockchain #1182

alcuadrado opened this issue Mar 31, 2021 · 3 comments

Comments

@alcuadrado
Copy link
Member

alcuadrado commented Mar 31, 2021

From @holgerd77: depends on #1181


Another problem I found when upgrading to v5 is that the VM and its options object use Blockchain and not BlockchainInterface.

The reason I originally proposed to have an interface for blockchain was that @ethereumjs/blockchain is a particular implementation of a blockchain, which doesn't match our usecase. Using the interface in the VM would let us use our own implementation without requiring any hack like casting to any.

I tried replacing it, but unfortunately the vm depends on Blockchain#initPromise, which I think should be removed, as explained in #1181. Once that's resolved, this issue can be fixed by just changing 3 lines of code.

@holgerd77
Copy link
Member

Ok, thanks for reporting. From what I read I guess we can put this to mid-urgent? Guess it would be hard to tackle this for this imminent release round (or let me know if I misread and this is a blocker for you).

@alcuadrado
Copy link
Member Author

This is not a blocker right now. We implemented BlockchainInterface in our blockchain, and just sparkled a few as any to make it work. It's fragile, but works for now.

@holgerd77
Copy link
Member

Blockchain dependency has been removed from the VM along v6 work, will close here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants