Skip to content

Add migration idempotency checks - #48

Merged
liamaharon merged 16 commits into
mainfrom
liam-check-migrations-are-idempotent
Nov 10, 2023
Merged

liamaharon merged 16 commits into
mainfrom
liam-check-migrations-are-idempotent

Conversation

@liamaharon

Copy link
Copy Markdown
Contributor

Closes #42

Checks that on_runtime_upgrade succeeds when called twice, and if it does succeed after being called twice, the storage state root did not change.

@liamaharon liamaharon added the enhancement New feature or request label Oct 31, 2023

@pmikolajczyk41 pmikolajczyk41 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool!

Comment thread core/tests/execute_block.rs
Comment thread core/tests/on_runtime_upgrade.rs Outdated
Comment thread core/src/lib.rs
Comment thread core/tests/on_runtime_upgrade.rs Outdated
Comment thread core/src/commands/on_runtime_upgrade.rs

@ggwpez ggwpez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I will try it.

Comment thread core/src/commands/on_runtime_upgrade.rs
Comment thread core/src/commands/on_runtime_upgrade.rs Outdated
Comment thread core/tests/on_runtime_upgrade.rs Outdated
@ggwpez

ggwpez commented Nov 9, 2023 •

Copy link
Copy Markdown
Member

As a follow up: we can mock the host function ext_logging_log_version_1 to silence the logs on the second run, or selectively set the target/level to make it less noisy.

@liamaharon

liamaharon commented Nov 9, 2023 •

Copy link
Copy Markdown
Contributor Author

As a follow up: we can mock the host function ext_logging_log_version_1 to silence the logs on the second run, or selectively set the target/level to make it less noisy.

Oh this will be very useful also for silencing logs when measuring PoV. Thanks!

@liamaharon
liamaharon merged commit f621966 into main Nov 10, 2023
@liamaharon
liamaharon deleted the liam-check-migrations-are-idempotent branch November 10, 2023 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

on-runtime-upgrade should enforce migrations are idempotent

3 participants