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

VM: Use EVM DefaultBlockchain for default Case #3574

Closed
holgerd77 opened this issue Aug 9, 2024 · 1 comment
Closed

VM: Use EVM DefaultBlockchain for default Case #3574

holgerd77 opened this issue Aug 9, 2024 · 1 comment

Comments

@holgerd77
Copy link
Member

For the default blockchain in VM we can likely use the same DefaultBlockchain as we do in EVM, guess we can export from EVM for this use case (other option: move to Common, but might be overblown) and extend by 1-2 more dummy functions.

This should be valid, since such an empty Blockchain can't do proper block operations anyhow.

(there are not much cases anyhow: a validateHeader() call in runBlock() which seems already be sufficiently handled, and some other in block builder for putBlock() I guess)

Note: while writing: an alternative approach might be do just do a - somewhat - full SimpleBlockchain implementation with a super-simple data structure (maybe dict with blockNumber -> Block and another one with blockHash -> blockNumber ?) and supporting get/put logic with a few blocks.

I find this eventually charming, that might be more useful for several cases (one could e.g. very easily dump a couple of blocks (from RPC or whatever) in there and then have a somewhat working usage scenario for blockhash opcode calls and the like.

Anyhow: maybe we can even decide separately.

This very first idea (use expanded EVM DefaultBlockchain) is so simple that we can just integrate. And then we can still decide if we want to realize the second idea too.

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

1 participant