[ETCM-846] make ETS stBadOpcode tests pass#992
Conversation
d4d5e5a to
d91d37b
Compare
a5d804a to
239f5e7
Compare
6d9e0b3 to
868b21d
Compare
|
please also use the ticket tag in commit messages ([ECTM-846]) this enables integration with jira |
75f5ae4 to
56e61b6
Compare
jvdp
left a comment
There was a problem hiding this comment.
So it looks a lot simpler than the previous implementation and less dependent on InMemoryWorldStateProxy which sounds scary. (What's the impact of not using this anymore btw? Is it only for tests & test mode or also part of production code?)
Can you explain the main change a bit more? It's now more directly committing the genesis account to the blockchain instead of keeping it in the in-memory state?
ada8944 to
a7bcf3a
Compare
a7bcf3a to
f88e4f4
Compare
|
The change is only for testmode so it should not affect normal production. We should probably at some point refactor the code so that the test specific parts are in a dedicated module though (there is a ticket for that) The main problem here was that the rootHash for account storage was not set properly in Regarding the ditching of From what I see But when we load the genesis state we do not have an initial state to start with so we have a kind of a chicken and egg problem (no initial to set the storage, and the initial state needs a storage). My first working solution was to create the genesis state with empty contract storage, call the function with I found it weird to have this logic (there was no reason to initialize the state in two passes), and with some guidance from Konrad I found how to directly store arbitrary MPTs. Calling directly the storage layer allows to create the desired state in the database directly without the double genesis initialization trick. |
f88e4f4 to
93a7084
Compare
93a7084 to
6a24a53
Compare
Description
This PR is part of the ogoing effort to make ETS pass all tests. The
stBadOpcodesuite did not pass because the accounts were not imported with the root hash for their storage.Proposed Solution
The
getGenesisStateRootnow create an in memory trie in order to compte the resulting hash.As this change is not specific to
stBadOpcode, it also makes most the previously failing tests pass (9 failing test forGeneralStateTestswhile we had around 400 before).