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

Update to polkadot-v1.6.0 #22

Merged
merged 18 commits into from
Feb 20, 2024
Merged

Update to polkadot-v1.6.0 #22

merged 18 commits into from
Feb 20, 2024

Conversation

fgamundi
Copy link
Contributor

@fgamundi fgamundi commented Jan 26, 2024

Some relevant PRs:
paritytech/polkadot-sdk#1246 for DmpQueue change to MessageQueue
paritytech/polkadot-sdk#2834 for consensus proposer optional block
paritytech/polkadot-sdk#1343 for RuntimeTask
paritytech/polkadot-sdk#2767 for PartialComponents
paritytech/polkadot-sdk#1256 for chain spec changes

@fgamundi fgamundi marked this pull request as ready for review January 26, 2024 13:07
@fgamundi
Copy link
Contributor Author

Not sure why the compiler is throwing this:

error: unused import: `pub`
  --> template/runtime/src/pallet_account_set.rs:17:1
   |
17 | pub mod pallet {
   | ^^^
   |
   = note: `-D unused-imports` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(unused_imports)]`

@tmpolaczyk
Copy link
Collaborator

tmpolaczyk commented Jan 29, 2024

Not sure why the compiler is throwing this:

Because pallet_account_set does not to be public. You can remove the pub from there.

Edit: just tried to remove it, it tells you this:

warning: unused import: `mod`
  --> template/runtime/src/pallet_account_set.rs:17:1
   |
17 | mod pallet {
   | ^^^
   |
   = note: `#[warn(unused_imports)]` on by default

So ignore this comment, I was wrong.

If you are wondering why this wasn't an error before, it's most likely because this PR also updates the rust version. New versions come with new warnings, which shouldn't be a compile error but we use -D warnings to keep CI clean. As a fun fact, this makes Rust maintainers scared of adding new warnings because doing so can break the CI of thousands of projects.

@librelois
Copy link
Collaborator

@fgamundi can you add an explicit #[allow(unused_imports)]somewhere to skip this specific warning? I don't want to allow all warnings in CI just for that

@fgamundi
Copy link
Contributor Author

I've allowed the warning. I'll also create an issue in polkadot-sdk, but I'm trying to debug a bit a to see if I can offer some more info in the issue of what's happening

@fgamundi
Copy link
Contributor Author

I'm no closer to finding why this is happening, but figured out that if the pallet is imported as public (chaging https://github.com/Moonsong-Labs/moonkit/blob/main/template/runtime/src/lib.rs#L69 to pub mod pallet_account_set;) the warning goes away

@tmpolaczyk
Copy link
Collaborator

if the pallet is imported as public (chaging https://github.com/Moonsong-Labs/moonkit/blob/main/template/runtime/src/lib.rs#L69 to pub mod pallet_account_set;) the warning goes away

Nice find, that means it is related to some pub use in the pallet code. That's an import that was already unused, now I remember than a recent Rust version implemented checking for unused re-exports. But that's related to code autogenerated by the #[pallet] macro, so nothing we can do on our side.

@tmpolaczyk
Copy link
Collaborator

There is an error when trying to export a raw chain spec:

cargo build --release -p moonkit-template
./target/release/moonkit-template build-spec --raw
2024-02-07 18:29:58 Building chain spec    
Error: Service(Other("wasm call error Other: Exported method GenesisBuilder_build_config is not found"))


./target/release/moonkit-template export-genesis-wasm
Error: Input("wasm call error Other: Exported method GenesisBuilder_build_config is not found")

./target/release/moonkit-template export-genesis-state
Error: Service(Client(Storage("wasm call error Other: Exported method GenesisBuilder_build_config is not found")))

Building a non-raw genesis works fine. I also checked all these commands in the 1.3.0 branch and the work fine.

@tmpolaczyk
Copy link
Collaborator

Error: Service(Other("wasm call error Other: Exported method GenesisBuilder_build_config is not found"))

This is because of a missing runtime api sp_genesis_builder::GenesisBuilder, see here how to implement it:
https://github.com/paritytech/polkadot-sdk/pull/1256/files#diff-a3b656e8095fe815cf8611c8319aff7b2f32482cdbe7c24ac37a2ce45235f32d

@fgamundi
Copy link
Contributor Author

fgamundi commented Feb 8, 2024

Thanks for catching that @tmpolaczyk ! Implementation added to the runtime as well as a test for chain spec's local_testnet_config

template/runtime/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@girazoki girazoki left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@RomarQ RomarQ left a comment

Choose a reason for hiding this comment

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

Apart from the pipeline failing, the changes look good to me 👍

@fgamundi fgamundi merged commit c6ed5d1 into main Feb 20, 2024
8 of 10 checks passed
@fgamundi fgamundi deleted the fg-polkadot-1.6.0 branch February 20, 2024 10:59
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 this pull request may close these issues.

6 participants