Skip to content

Update to polkadot-v1.6.0 - #22

Merged
fgamundi merged 18 commits into
mainfrom
fg-polkadot-1.6.0
Feb 20, 2024
Merged

Update to polkadot-v1.6.0#22
fgamundi merged 18 commits into
mainfrom
fg-polkadot-1.6.0

Conversation

@fgamundi

@fgamundi fgamundi commented Jan 26, 2024

Copy link
Copy Markdown
Contributor

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
Comment thread template/node/src/chain_spec.rs Outdated
Comment thread template/node/src/chain_spec.rs Outdated
@fgamundi

Copy link
Copy Markdown
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

tmpolaczyk commented Jan 29, 2024

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Comment thread template/node/src/chain_spec.rs
@tmpolaczyk

Copy link
Copy Markdown
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.

Francisco Gamundi and others added 3 commits February 6, 2024 16:36
@tmpolaczyk

Copy link
Copy Markdown
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
Copy Markdown
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

fgamundi commented Feb 8, 2024

Copy link
Copy Markdown
Contributor Author

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

Comment thread template/runtime/src/lib.rs Outdated

@girazoki girazoki 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.

LGTM

@RomarQ RomarQ 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.

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

@fgamundi
fgamundi merged commit c6ed5d1 into main Feb 20, 2024
@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