Skip to content
Snippets Groups Projects
  • Benjamin Gallois's avatar
    31a25023
    Upgrade to Polkadot v0.9.42 (!172) · 31a25023
    Benjamin Gallois authored and Hugo Trentesaux's avatar Hugo Trentesaux committed
    * allow clippy needless_pass_by_ref_mut
    
    * fix clippy
    
    °_°
    
    * fix provider behavior
    
    * fix build errors
    
    * change behavior of going below ED
    
    * fix provider initialization
    
    * add mock epoch change
    
    * add session number test
    
    * add session number test
    
    * WIP fix tests
    
    * fix time-based ud test
    
    * update metadata
    
    * FIX apply all fix from flash branch
    
    * partial fix clippy
    
    other suggestions are not legit
    
    * fix metadata and end2end test
    
    * fix build tests
    
    * fix build and clippy
    
    * remove benchmark of upgrade_accounts
    
    this happens in substrate dependency
    I also updated other packages because why not :D
    and I removed a useless implementation in mock
    but the test do not compile with feature runtime benchmarks anyway
    
    * test_total_issuance_vs_monetary_mass
    
    * proofreading comment
    
    * fix total issuance differently
    
    this actually fixes total issuance at genesis
    instead of creating duplicate account data
    
    * fix test scenario
    
    the thing tested here was not the ability to call the function,
    but the impossibility of deleting the account
    
    * add comment to explain test
    
    * fix providers and sufficients counts
    
    * fix initial balance
    
    * fix initial TotalIssuance
    
    * fix clippy warnings and optimization
    
    * fix xtask
    
    * update docs
    
    * add DustHandle
    
    * fix pallets config
    
    * fix tests
    
    * fix pallet_balance genesis config
    
    * wip: fix end2end-test
    
    * fix manual and instant sealing
    
    * fix live-tests
    
    * fix offences after rebase
    
    * generate all weights
    
    * add rust toolchain file
    
    * fix benchmarks
    
    Pallet balances benchmarks need https://github.com/duniter/substrate/commit/c36ab4f32454318a47777b24b6533c44121fc10b because pallet duniter-account add another provider.
    
    * fix babe-worker
    
    * fix subxt dependency
    
    * fix ImplicitCallIndex and Weight::from_ref_time deprecation
    
    * fix consensus_babe dependency
    
    * regenerate weights
    
    Regenerate all weights except for pallet-balance failing on one extrinsic
    
    * workaround pallet_duniter_account
    
    Workaround to be able to pass https://github.com/paritytech/substrate/blob/6ef184e33f6ce0f56999ae84b212ea6148c0624d/frame/balances/src/benchmarking.rs#L271 in the benchmark.
    ExtraFlags is private and Default is always new_logic not suitable for the benchmark.
    
    * wip fix node errors
    
    * wip fix runtime errors
    
    * fix pallet-duniter-account errors
    
    * fix pallet-balance errors
    
    * fix pallet-identity errors
    
    * fix pallet-duniter-account errors
    
    * upgrade Cargo files
    
    * update docs
    31a25023
    History
    Upgrade to Polkadot v0.9.42 (!172)
    Benjamin Gallois authored and Hugo Trentesaux's avatar Hugo Trentesaux committed
    * allow clippy needless_pass_by_ref_mut
    
    * fix clippy
    
    °_°
    
    * fix provider behavior
    
    * fix build errors
    
    * change behavior of going below ED
    
    * fix provider initialization
    
    * add mock epoch change
    
    * add session number test
    
    * add session number test
    
    * WIP fix tests
    
    * fix time-based ud test
    
    * update metadata
    
    * FIX apply all fix from flash branch
    
    * partial fix clippy
    
    other suggestions are not legit
    
    * fix metadata and end2end test
    
    * fix build tests
    
    * fix build and clippy
    
    * remove benchmark of upgrade_accounts
    
    this happens in substrate dependency
    I also updated other packages because why not :D
    and I removed a useless implementation in mock
    but the test do not compile with feature runtime benchmarks anyway
    
    * test_total_issuance_vs_monetary_mass
    
    * proofreading comment
    
    * fix total issuance differently
    
    this actually fixes total issuance at genesis
    instead of creating duplicate account data
    
    * fix test scenario
    
    the thing tested here was not the ability to call the function,
    but the impossibility of deleting the account
    
    * add comment to explain test
    
    * fix providers and sufficients counts
    
    * fix initial balance
    
    * fix initial TotalIssuance
    
    * fix clippy warnings and optimization
    
    * fix xtask
    
    * update docs
    
    * add DustHandle
    
    * fix pallets config
    
    * fix tests
    
    * fix pallet_balance genesis config
    
    * wip: fix end2end-test
    
    * fix manual and instant sealing
    
    * fix live-tests
    
    * fix offences after rebase
    
    * generate all weights
    
    * add rust toolchain file
    
    * fix benchmarks
    
    Pallet balances benchmarks need https://github.com/duniter/substrate/commit/c36ab4f32454318a47777b24b6533c44121fc10b because pallet duniter-account add another provider.
    
    * fix babe-worker
    
    * fix subxt dependency
    
    * fix ImplicitCallIndex and Weight::from_ref_time deprecation
    
    * fix consensus_babe dependency
    
    * regenerate weights
    
    Regenerate all weights except for pallet-balance failing on one extrinsic
    
    * workaround pallet_duniter_account
    
    Workaround to be able to pass https://github.com/paritytech/substrate/blob/6ef184e33f6ce0f56999ae84b212ea6148c0624d/frame/balances/src/benchmarking.rs#L271 in the benchmark.
    ExtraFlags is private and Default is always new_logic not suitable for the benchmark.
    
    * wip fix node errors
    
    * wip fix runtime errors
    
    * fix pallet-duniter-account errors
    
    * fix pallet-balance errors
    
    * fix pallet-identity errors
    
    * fix pallet-duniter-account errors
    
    * upgrade Cargo files
    
    * update docs

Upgrade Substrate

We need to keep up to date with Substrate. Here is an empirical guide.

Let's say for the example that we want to upgrade from v0.9.26 to v0.9.32.

Upgrade Substrate fork

  1. Checkout the latest Substrate Polkadot branch polkadot-v0.9.xy in our Substrate
  2. Create a new branch duniter-substrate-v0.9.xy
  3. Cherry-pick 3ad5e1a1fdac5398d4911272a34e1f16c1bdd8f0, 87ef489034ca2b15c4f30da387e06b1f6716d9a2 and c36ab4f32454318a47777b24b6533c44121fc10b
  4. Run cargo check to check the cherry-picking

Upgrade Subxt fork

  1. Checkout the currently used branch in our Subxt fork, e.g. duniter-substrate-v0.9.26
  2. Create a new branch duniter-substrate-v0.9.32
  3. Fetch the upstream repository
  4. Rebase on an upstream stable branch matching the wanted version

Upgrade Duniter

  1. Replace duniter-substrate-v0.9.26 with duniter-substrate-v0.9.32 in Cargo.toml
  2. Update the rust-toolchain file according to Polkadot release notes
    • Tip: To save storage space on your machine, do rm target -r after changing the rust toolchain version and before re-building the project with the new version.
  3. While needed, iterate cargo check, cargo update and upgrading dependencies to match substrate's dependencies
  4. Fix errors in Duniter code
    • You may need to check how Polkadot is doing by searching in their repo. Luckily, the project structure and Substrate patterns are close enough to ours.
    • Some errors may happen due to two semver-incompatible versions of a same crate being used. To check this, use cargo tree -i <crate>. Update the dependency accordingly, then do cargo update.
  5. As always, don't forget to clippy once you're done with the errors.
  6. Test benchmarking:
    cargo run --features runtime-benchmarks -- benchmark overhead --chain=dev --execution=wasm --wasm-execution=interpreted-i-know-what-i-do --weight-path=. --warmup=10 --repeat=100