ethereumjs-monorepo
ethereumjs-monorepo copied to clipboard
Blockchain: add genesisState Option Test Case
The new genesisState option (not to be confused with the genesisState() method) introduced in #1916 for using a custom genesis state is still completely untested (apart from one direct use case in Client cli.ts). This needs some relatively urgent test case addition(s) in the Blockchain package to see if this option is a) working properly and b) can be used in a consistent way.
The format to pass in a custom genesis state has remained the same I guess than it has been in Common and a test case should be similar to the test removed in Common customChains.spec.ts I would assume.
We should minimally do this before the final releases, especially to be safe on b).
Once the test case is ready it should then be checked/tested if such a Blockchain instance - containing a modified custom genesis state - can then be used in the VM - by passing in the Blockchain instance - to run code on top of a modified genesis state.
Eventually this is also worth yet another test case, since this is an important scenario and we should be really sure that this is working and can be used in a practical way.
Will also cc in @ryanio here in case I am missing something obvious (e.g. test case is there but I overlooked it).
Update: it would then also be nice to add a respective example in the respective VM README section (to be updated along #2016 before).
@g11tech can I assume that this one is (completely) outdated? 🤔 Or has this "uphold itself" over all refactors? 😂
@g11tech can I assume that this one is (completely) outdated? thinking Or has this "uphold itself" over all refactors? joy
lol,
yea i think there are enough tests covering the usage of custom genesis state
- in blockchain ( for genesis stateroot compute: https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/test/utils.spec.ts#L34),
- in vm (https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/test/api/customChain.spec.ts#L65:L66) as well as
- in client engine tests (https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/test/rpc/engine/newPayloadV1.spec.ts) which use custom genesis using these helpers (https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/test/rpc/helpers.ts#L239:L251)
Oh, thanks, that was an extensive answer!!! 🙏 😅
Ok, will close then. 🙂