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
Contract Migration #137
Contract Migration #137
Conversation
* Add tests for state check after selfdestruct * Aurora runner tracks storage usage to avoid underflow when storage is released in future transactions (#85) * Implement generational storage (#87) * Base precompile code between connectors (#73) * Base precompile code between connectors * Handle errors and validate input * Use proper result * Document `aurora encode-address` usage. * Cache cargo artifacts between CI runs. (#92) * Address comments from audit. (#86) * Validate register length in `read_input_arr20()` * Only read register length in `Engine::get_code_size` * Add `read_input_borsh()` * Ensure `method.args.len() == args_decoded.len()` * Ensure register size is 8 in `read_u64` * Use constant to specify the register ID used in `read_input()` * Reduce size of `cargo cache` in CI. (#95) * Define a `Wei` newtype for balances. (#96) * Fix evm-bully builds after recent refactoring. (#100) * Refactor `Engine::get_state` to return a `Result`. (#99) * Ensure that `Cargo.lock` in the repo is valid. (#101) * Remove unneeded nightly feature. (#102) * Implement BC generational storage. * fix address input * remove note * put key on the end of the storage key * remove pub from methods * Dispatch precompiles on the full address. (#107) * Support state migration on upgrade. (#103) * Implement the ETH connector. (#59) * Move when to call `set_generation` * Fix arg Co-authored-by: Marcelo Fornet <mfornet94@gmail.com> Co-authored-by: Arto Bendiken <arto@aurora.dev> Co-authored-by: Michael Birch <michael@near.org> Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com> Co-authored-by: Evgeny Ukhanov <mrlsd@ya.ru> * Fix layout of the key * Fix all tests (don't wipe the storage all the time) * Use correct generation in writing storage * Remove unnecessary references Co-authored-by: Michael Birch <michael@near.org> Co-authored-by: Joshua J. Bouw <dev@joshuajbouw.com> Co-authored-by: Arto Bendiken <arto@aurora.dev> Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com> Co-authored-by: Evgeny Ukhanov <mrlsd@ya.ru> Co-authored-by: Michael Birch <michael.birch@aurora.dev>
Nice, thanks for working on this! |
Move I/O from business logic Co-authored-by: Kirill <septengineering@pm.me>
Co-authored-by: Kirill <septengineering@pm.me>
Haven't looked into the PR yet, but have few questions regarding the options: /// Rename key field
RenameKey,
// Rename key and update value
UpdateKeyValue, What do you mean by rename key? Borsh serialisation doesn't save the name of the fields on the storage. Or you meant something like. Moving // Remove only value for key field
RemoveValue, What does it do, replace this value with empty sequence of bytes? I don't know if I'm missing a conversation from some place. But can you provide here high level details (or even technical if necessary) about how are we planning to execute one migration using this changes, before jumping into the implementation. |
@sept-en asks me to implement a migration mechanism for changing the storage state. That logic currently covering all possible cases. Parameters set via json. |
This PR feels more like a design proposal and so I think it should be discussed separately from any actual implementation. Hopefully if we all agree on a design first then we can avoid churn on code itself which will save us all time in the long run. I have enabled GitHub discussions for the Engine repo and created a section called The discussion for this migration functionality is here: #140 As a general note I think we should be spending more time on design than we currently are. Spending some time on design up-front can hopefully prevent sudden pivots like we have seen recently (e.g. don't burn NEP-141 tokens in connector, generational storage, tracking promise creation in exit precompiles). I know that each of those examples were in response to problems that arose with the implementation, and that a design phase will not always catch all such problems, but at least it gives us a better chance of doing so. |
@mrLSD Where did you propose this idea, I can't find it anywhere, and the description of the PR doesn't help to it.
You didn't address the rest of my comments. So you are covering cases that are not described properly, and it is not straight forward to understand how they are going to be used. Let's continue this conversation in #140 (thanks @birchmd for starting this discussion). |
This PR is stale, whats the status @mrLSD ? |
216e375
to
9d09598
Compare
21bf309
to
422844a
Compare
Closing this as it is now vastly out of date with current develop branch. |
Universal migration mechanism for storage state.
Possible actions:
The migration function can be invoked only by the contract owner (for security reasons).