You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 inrunBlock()
which seems already be sufficiently handled, and some other in block builder forputBlock()
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 withblockNumber
->Block
and another one withblockHash
->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.
The text was updated successfully, but these errors were encountered: