feat: storage slot setting + memory db#3216
Conversation
|
|
This PR changes implementation code, but doesn't include a changeset. Did you forget to add one? |
|
@mslipper Will follow up with an additional PR that adds the thorough testing + final required functionality |
Move types into solc package that are associated with solc. Add `CompilerInput` and `CompilerOutput` types.
Use some solc types
Implement some of smock's utils in go
1ceda88 to
20fa803
Compare
|
The go code that I've read seems fine. I just don't have a great idea of the solidity ABI / slot setting / packing. If there's a good reference for that I could do a cross check & I'd be happy with that portion. The in memory DB looks good to me. |
Not super in depth but there is this: https://docs.soliditylang.org/en/v0.8.13/internals/layout_in_storage.html fwiw there is test coverage that setting the storage slots of a deployed contract works |
|
This PR has been added to the merge queue, and will be merged soon. |
|
This PR is next in line to be merged, and will be merged as soon as checks pass. |
* state-surgery: add solc package Move types into solc package that are associated with solc. Add `CompilerInput` and `CompilerOutput` types. * state-surgery: clean up hardhat package Use some solc types * state-surgery: add state package Implement some of smock's utils in go * state-surgery: cleanup * state-surgery: refactor + add better test coverage * state-surgery: cleanup * state-surgery: add tests for merging storage slots * state-surgery: godoc * state-surgery: more tests * state-surgery: more cleanup
* state-surgery: add solc package Move types into solc package that are associated with solc. Add `CompilerInput` and `CompilerOutput` types. * state-surgery: clean up hardhat package Use some solc types * state-surgery: add state package Implement some of smock's utils in go * state-surgery: cleanup * state-surgery: refactor + add better test coverage * state-surgery: cleanup * state-surgery: add tests for merging storage slots * state-surgery: godoc * state-surgery: more tests * state-surgery: more cleanup
* state-surgery: add solc package Move types into solc package that are associated with solc. Add `CompilerInput` and `CompilerOutput` types. * state-surgery: clean up hardhat package Use some solc types * state-surgery: add state package Implement some of smock's utils in go * state-surgery: cleanup * state-surgery: refactor + add better test coverage * state-surgery: cleanup * state-surgery: add tests for merging storage slots * state-surgery: godoc * state-surgery: more tests * state-surgery: more cleanup
Description
Implements basic storage slot setting. The storage slot setting still needs to support mappings and slot offsets and more thorough testing, then it will be ready to be used for the new state surgery pipeline.
Also implements a
MemoryStateDBthat acts on acore.Genesisso that we can build a fresh genesis from scratch to replace the hardhat task. This will allow us to use the same code used to generate the L2genesis.jsonon an actual LevelDB backedStateDBinstance.Closes ENG-2586