This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Update contract multi-block migration #14313
Update contract multi-block migration #14313
Changes from 36 commits
5c14529
e8c493c
0e62930
14a7175
2601d79
e88854a
a8caaf2
1400ab0
cc7609c
92360cd
137ecc8
cfaf7e8
27e5cf8
2935e99
a4bb302
f3e81ce
f10f5bd
dc556df
a7ef997
6a89133
86e6696
6417dde
e6bb63d
1841f23
0236ca0
4686c03
5e029e1
c7846be
d4349fb
7511bac
e4e5ba1
3545f04
08f84fb
85f334f
103d50c
dbb20d3
3b3c179
fc977cb
d45d570
9d5b6b8
fe412a7
921dc43
8643fcd
7a2c272
030554d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that the same as just
break
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well this case means that there might be a migration in progress, but we did not have enough gas to make any kind of progress, so you want to exit early here, are doing any work in this function is unsafe is there an actual migration going on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if no migration is needed and also none is provided? In this case it would return
false
andpre_upgrade
will fail even though migrations will be fine.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then you should probably not include it at all in the runtime executive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as we can catch the case when somebody forgets to put it back in again this is fine. I suppose
try-runtime
will catch this missing migration.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we want to be lean and embed as little code as possible, we probably want to enforce it, I would be for leaving it like that and adding an explicit message in the pre_upgrade if storage_version == target_version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does indeed, last time I tried, will test it again here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is also only invoked in try_runtime, you will get away with just a warning if you were to run such a migration
substrate/frame/contracts/src/migration.rs
Lines 264 to 271 in 921dc43