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

Fix node syncing #137

Merged
merged 12 commits into from
Jul 22, 2024
Merged

Fix node syncing #137

merged 12 commits into from
Jul 22, 2024

Conversation

ales-tsurko
Copy link
Member

@ales-tsurko ales-tsurko commented Jul 12, 2024

Currently our nodes panic (1 2) when we try to sync them from scratch. The issue is happened because of multiple issues:

  • we introduced a runtime upgrade without incrementing the chain spec version (Update testnet #99);
  • we patched pallet_democracy and because our nodes couldn't produce blocks without the patch, we used codeSubstitutes in the chainspec.

All those upgrades happened at the same spec version and without spec version update. And it turned out, it's only possible to have a single substitute per spec version, thus using another substitute for the first upgrade provides random substitute usage (either the first or the second one), but not both.

This PR provides:

  • switching to WasmExecutor as suggested in 2 as NativeElseWasm may lead to similar issues;
  • switching to our fork of polkadot-sdk, where WasmSubstitutes can hold multiple substitutes per the same spec version;
  • switching to our fork of frontier, because it depends on polkadot-sdk repo, but we need it to use our fork (it's easier to update Cargo.toml in the fork, than find out which dependencies we need to patch);
  • adding bad blocks and fork blocks chainspec extensions;
  • updating the chainspec file for testnet with code substitutes;
  • removing pallet-democracy-patched as the fix is now in the forked substrate.

Intention behind the fork is caused by the lack of related substrate API, which is neither parametrized nor public. Particularly WasmSubstitute and parts of WasmSubstitutes which holds a map with the spec version as a key and the substitute as a value.

@ales-tsurko ales-tsurko self-assigned this Jul 12, 2024
@ales-tsurko ales-tsurko added the bug Something isn't working label Jul 12, 2024
@ales-tsurko ales-tsurko marked this pull request as ready for review July 18, 2024 15:18
node/src/service.rs Show resolved Hide resolved
@ales-tsurko ales-tsurko merged commit 236f5cc into devnet Jul 22, 2024
1 check passed
@ales-tsurko ales-tsurko deleted the fix/node-wont-sync branch July 22, 2024 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants