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

Prepare migrations for parachain-staking #488

Merged

Conversation

maltekliemann
Copy link
Member

We have to fix the version of substrate-fixed to prevent incompatability issues. This was done in the moonbeam fork for the parachain-staking and author-mapping pallets.

The required migrations are now made available by the moonbeam fork. It was also necessary to add an implementation of Default for AccountId, as it was since removed from substrate.

It is noteworthy that the moonbeam fork's tests fail (with and without our changes) with the following error:

running 4 tests
test tests::export_genesis_state ... FAILED
test tests::builds_specs_based_on_mnemonic ... FAILED
test tests::purge_chain_purges_relay_and_para ... FAILED
test tests::export_current_state ... FAILED

failures:

---- tests::export_genesis_state stdout ----
thread 'tests::export_genesis_state' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', node/src/tests.rs:164:10
stack backtrace:
   0: rust_begin_unwind
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/panicking.rs:106:14
   2: core::result::unwrap_failed
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/result.rs:1613:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/result.rs:1295:23
   4: moonbeam::tests::export_genesis_state
             at ./src/tests.rs:159:15
   5: moonbeam::tests::export_genesis_state::{{closure}}
             at ./src/tests.rs:158:1
   6: core::ops::function::FnOnce::call_once
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/ops/function.rs:227:5
   7: core::ops::function::FnOnce::call_once
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- tests::builds_specs_based_on_mnemonic stdout ----
thread 'tests::builds_specs_based_on_mnemonic' panicked at 'Failed to start moonbeam: Os { code: 2, kind: NotFound, message: "No such file or directory" }', node/src/tests.rs:123:10
stack backtrace:
   0: rust_begin_unwind
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/panicking.rs:106:14
   2: core::result::unwrap_failed
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/result.rs:1613:5
   3: core::result::Result<T,E>::expect
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/result.rs:1255:23
   4: moonbeam::tests::builds_specs_based_on_mnemonic
             at ./src/tests.rs:115:15
   5: moonbeam::tests::builds_specs_based_on_mnemonic::{{closure}}
             at ./src/tests.rs:112:1
   6: core::ops::function::FnOnce::call_once
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/ops/function.rs:227:5
   7: core::ops::function::FnOnce::call_once
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- tests::purge_chain_purges_relay_and_para stdout ----
thread 'tests::purge_chain_purges_relay_and_para' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', node/src/tests.rs:65:14
stack backtrace:
   0: rust_begin_unwind
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/panicking.rs:106:14
   2: core::result::unwrap_failed
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/result.rs:1613:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/result.rs:1295:23
   4: moonbeam::tests::purge_chain_purges_relay_and_para::run_node_and_stop
             at ./src/tests.rs:59:17
   5: moonbeam::tests::purge_chain_purges_relay_and_para
             at ./src/tests.rs:84:19
   6: moonbeam::tests::purge_chain_purges_relay_and_para::{{closure}}
             at ./src/tests.rs:50:1
   7: core::ops::function::FnOnce::call_once
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/ops/function.rs:227:5
   8: core::ops::function::FnOnce::call_once
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- tests::export_current_state stdout ----
thread 'tests::export_current_state' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', node/src/tests.rs:193:14
stack backtrace:
   0: rust_begin_unwind
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/panicking.rs:106:14
   2: core::result::unwrap_failed
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/result.rs:1613:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/result.rs:1295:23
   4: moonbeam::tests::export_current_state::run_node_and_stop
             at ./src/tests.rs:186:17
   5: moonbeam::tests::export_current_state
             at ./src/tests.rs:212:19
   6: moonbeam::tests::export_current_state::{{closure}}
             at ./src/tests.rs:177:1
   7: core::ops::function::FnOnce::call_once
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/ops/function.rs:227:5
   8: core::ops::function::FnOnce::call_once
             at /rustc/936238a92b2f9d6e7afe7dda69b4afd903f96399/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


failures:
    tests::builds_specs_based_on_mnemonic
    tests::export_current_state
    tests::export_genesis_state
    tests::purge_chain_purges_relay_and_para

test result: FAILED. 0 passed; 4 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.05s

error: test failed, to rerun pass '-p moonbeam --bin moonbeam'

I haven't investigated further. Given that the tests fail without our changes, I have little reason to be concerned.

@maltekliemann maltekliemann added the s:review-needed The pull request requires reviews label Mar 18, 2022
@sea212 sea212 added s:in-progress The pull requests is currently being worked on s:review-needed The pull request requires reviews and removed s:review-needed The pull request requires reviews s:in-progress The pull requests is currently being worked on labels Mar 18, 2022
Copy link
Member

@sea212 sea212 left a comment

Choose a reason for hiding this comment

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

First of all thanks for adopting this issue!

I have no idea why the patch did not work properly on your end, but it was well-configured. I removed pallet-author-mapping from the patch instructions, added the original rev to the moonbeam dependencies and applied cargo update on the relevant crates. Locally and in the pipeline all tests seem to pass. Can you verify this once please? In case you still get errors, please cargo clean within the git repo once and try again.

Besides that, the testing errors seem to originate from the node crate within the moonbeam repository. I assume you accidentally executed the tests there. At least I have no other explanation for why this could have happened.

@sea212 sea212 linked an issue Mar 18, 2022 that may be closed by this pull request
3 tasks
@sea212 sea212 added this to the v0.3.0 milestone Mar 18, 2022
@maltekliemann
Copy link
Member Author

First of all thanks for adopting this issue!

I have no idea why the patch did not work properly on your end, but it was well-configured. I removed pallet-author-mapping from the patch instructions, added the original rev to the moonbeam dependencies and applied cargo update on the relevant crates. Locally and in the pipeline all tests seem to pass. Can you verify this once please? In case you still get errors, please cargo clean within the git repo once and try again.

Works for me now. No idea what happened earlier.

Besides that, the testing errors seem to originate from the node crate within the moonbeam repository. I assume you accidentally executed the tests there. At least I have no other explanation for why this could have happened.

Yes, I tested moonbeam just to make sure that changing the substrate-fixed version didn't result in any breaking changes there. I would have been concerned if that had been the case. But you're right - I didn't realize that the failed tests concerned the node crate.

@sea212 sea212 added s:accepted This pull request is ready for merge and removed s:review-needed The pull request requires reviews labels Mar 19, 2022
@maltekliemann maltekliemann merged commit 9b1e709 into zeitgeistpm:main Mar 21, 2022
@maltekliemann maltekliemann changed the title Prepage migrations for parachain-staking Prepare migrations for parachain-staking Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s:accepted This pull request is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Pallets] Execute migrations for parachain-staking
2 participants