-
Notifications
You must be signed in to change notification settings - Fork 823
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
Ensure saved offchain solution matches creation snapshop #462
Comments
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
Quite important. The OCW miners could repeatedly come to an wrong solution because of this. |
This will actually not solve anything for the unsigned phase, because as long as you are in the same thread, you will surely read the same hash since you are in the same OCW thread. note that if there is a long enough signed phase, this is not a big deal for the unsigned phase. note that a good easy solution to all of this is to put a gap between snapshot and any submission. lastly, we should have a safeguard in place, to make sure if for any reason OCW submission of any validator fails, then they do not retry in the same session. |
This is still a nice addition, but very low quality, as doing a feasibility check before submitting offchain is not a big deal. |
I checked this again. Indeed, we need to remember that within an OCW thread, the snapshot hash will always match, because even if we progress 10 blocks, the thread is blind to the progress. But:
This is a good, medium difficulty, low priority task. @Ank4n @gpestana either of you can pick it up as a side task. |
I would like to attempt this and potentially pair with @gpestana if you are up for it? |
Co-authored-by: Philip Stanislaus <[email protected]> Co-authored-by: Aidan Musnitzky <[email protected]>
Related to paritytech/substrate#8641 and paritytech/substrate#8290.
We will support offchain worker resubmission soon. The problem is that the solution is created once and then sent blindly again. This can lead to bad solutions because the snapshot might have changed due to a revert.
Initially, we thought we can use fork-aware offchain storage, but that is not implemented.
Alternatively, in paritytech/substrate#8290 we fall back to just calling
feasibility_check
one last time before resubmission of cached solution to makes sure it is not faffy.This is rather suboptimal. A nicer approach is to have a hash of the snapshot saved somewhere alongside the cached solution, so we can check it against the hash that is stored onchain.
The text was updated successfully, but these errors were encountered: