Skip to content
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

[Request] run-block should support storage import #225

Closed
crystalin opened this issue Mar 7, 2023 · 6 comments · Fixed by #240
Closed

[Request] run-block should support storage import #225

crystalin opened this issue Mar 7, 2023 · 6 comments · Fixed by #240

Comments

@crystalin
Copy link
Contributor

Currently it seems that using the import storage is not compatible with run-block.
I briefly looked at it and it seems to be because the import storage is actually applying the change on top of a block which might be incompatible with run-block.

Not sure if you have an idea on how to support it before I dig into it

@ermalkaleci
Copy link
Collaborator

It's supposed to "replay" a block. Why do you need to override storage?

@crystalin
Copy link
Contributor Author

I agree it is not very intuitive, but for the same as to why you want to override a wasm runtime, it is sometime important to see what would have happened to a block if your runtime or storage was different.

In my specific case, I want to verify if a given smart contract (stored in the chain storage) could have worked properly if a given instruction was changed in its code.

@ermalkaleci
Copy link
Collaborator

I see, yeah it's easy to implement it

@ermalkaleci
Copy link
Collaborator

ermalkaleci commented Mar 9, 2023

Btw we also have dry-run command which support wasm-override and can be run at any block

@crystalin
Copy link
Contributor Author

Yes, that is convenient for single extrinsic, but sometime it is a combination of multiple factors included in a full block.
I was able to test what I wanted by modifying the import storage to include the blockhash, but it was hardcoded. I'll check if I can propose something more generic

@ermalkaleci ermalkaleci linked a pull request Mar 9, 2023 that will close this issue
@crystalin
Copy link
Contributor Author

Awesome, thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants