Skip to content

Commit

Permalink
🔖 Whitelist pallet_funding sudo and root calls. New Polimec Release (#…
Browse files Browse the repository at this point in the history
…324)

## What?
Upgrade Polimec

## Why?
Whitelist the auction and root calls

## How?
Add them to the `Basecall` filter

## Testing?
try-runtime output:
```
❯ try-runtime --runtime ./target/release/wbuild/polimec-runtime/polimec_runtime.compact.compressed.wasm on-runtime-upgrade live --uri wss://rpc.polimec.org:443
[2024-06-14T13:30:20Z INFO  remote-ext] replacing wss:// in uri with https://: "https://rpc.polimec.org:443" (ws is currently unstable for fetching remote storage, for more see paritytech/jsonrpsee#1086)
[2024-06-14T13:30:20Z INFO  remote-ext] since no at is provided, setting it to latest finalized head, 0xdd9f49b5e3403d646002a5329323dbb0e69ff3e29068277338bcc4322d016eca
[2024-06-14T13:30:20Z INFO  remote-ext] since no prefix is filtered, the data for all pallets will be downloaded
[2024-06-14T13:30:20Z INFO  remote-ext] scraping key-pairs from remote at block height 0xdd9f49b5e3403d646002a5329323dbb0e69ff3e29068277338bcc4322d016eca
✅ Found 9362 keys (0.39s)
[00:00:01] ✅ Downloaded key values 5,586.4844/s [===================================================================================================] 9362/9362 (0s)
✅ Inserted keys into DB (0.02s)
[2024-06-14T13:30:22Z INFO  remote-ext] adding data for hashed prefix: , took 2.19s
[2024-06-14T13:30:22Z INFO  remote-ext] adding data for hashed key: 3a636f6465
[2024-06-14T13:30:22Z INFO  remote-ext] adding data for hashed key: 26aa394eea5630e07c48ae0c9558cef7f9cce9c888469bb1a0dceaa129672ef8
[2024-06-14T13:30:22Z INFO  remote-ext] adding data for hashed key: 26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac
[2024-06-14T13:30:22Z INFO  remote-ext] 👩‍👦 no child roots found to scrape
[2024-06-14T13:30:22Z INFO  remote-ext] initialized state externalities with storage root 0x5bd4097792b70d2f8044967ff8a7cee2061de95f180124fcf6c665419efc6a17 and state_version V1
[2024-06-14T13:30:22Z INFO  try-runtime::cli] Original runtime [Name: RuntimeString::Owned("polimec-mainnet")] [Version: 7002] [Code hash: 0x4398...b5e4]
[2024-06-14T13:30:22Z INFO  try-runtime::cli] New runtime      [Name: RuntimeString::Owned("polimec-mainnet")] [Version: 7003] [Code hash: 0xf246...8455]
[2024-06-14T13:30:23Z INFO  try-runtime::cli] 🚀 Speed up your workflow by using snapshots instead of live state. See `try-runtime create-snapshot --help`.
[2024-06-14T13:30:23Z INFO  try_runtime_core::misc] ------------------------------------------------------------------
    
    
[2024-06-14T13:30:23Z INFO  try_runtime_core::misc] 🔬 Running TryRuntime_on_runtime_upgrade with checks: PreAndPost
    
    
[2024-06-14T13:30:23Z INFO  try_runtime_core::misc] ------------------------------------------------------------------
    
    
[2024-06-14T13:30:23Z INFO  runtime::executive] ✅ Entire runtime state decodes without error. 547614 bytes total.
[2024-06-14T13:30:23Z INFO  try_runtime_core::misc] ------------------------------------------------------------------------------------------------------
    
    
[2024-06-14T13:30:23Z INFO  try_runtime_core::misc] 🔬 TryRuntime_on_runtime_upgrade succeeded! Running it again without checks for weight measurements.
    
    
[2024-06-14T13:30:23Z INFO  try_runtime_core::misc] ------------------------------------------------------------------------------------------------------
    
    
[2024-06-14T13:30:23Z INFO  try_runtime_core::misc] ---------------------------------------------------------------------------------
    
    
[2024-06-14T13:30:23Z INFO  try_runtime_core::misc] 🔬 Running TryRuntime_on_runtime_upgrade again to check idempotency: PreAndPost
    
    
[2024-06-14T13:30:23Z INFO  try_runtime_core::misc] ---------------------------------------------------------------------------------
    
    
[2024-06-14T13:30:23Z INFO  runtime::executive] ✅ Entire runtime state decodes without error. 547614 bytes total.
[2024-06-14T13:30:23Z INFO  try-runtime::cli] PoV size (zstd-compressed compact proof): 7.8 KB. For parachains, it's your responsibility to verify that a PoV of this size fits within any relaychain constraints.
[2024-06-14T13:30:23Z INFO  try-runtime::cli] Consumed ref_time: 0.000925s (0.19% of max 0.5s)
[2024-06-14T13:30:23Z INFO  try-runtime::cli] ✅ No weight safety issues detected. Please note this does not guarantee a successful runtime upgrade. Always test your runtime upgrade with recent state, and ensure that the weight usage of your migrations will not drastically differ between testing and actual on-chain execution.

polimec-node on  06-14-whitelist_pallet_funding_sudo_and_root_calls [!] via 🦀 v1.76.0-nightly took 3s 

```
srtool output:
```
✨ Your Substrate WASM Runtime is ready! ✨
✨ WASM  : runtimes/polimec/target/srtool/production/wbuild/polimec-runtime/polimec_runtime.compact.wasm
✨ Z_WASM: runtimes/polimec/target/srtool/production/wbuild/polimec-runtime/polimec_runtime.compact.compressed.wasm
Summary generated with srtool v0.15.0 using the docker image paritytech/srtool:1.77.0:
 Package     : polimec-runtime v0.7.0
 GIT commit  : 5385a0f
 GIT tag     : v0.7.2
 GIT branch  : 06-14-whitelist_pallet_funding_sudo_and_root_calls
 Rustc       : rustc 1.77.0 (aedd173a2 2024-03-17)
 Time        : 2024-06-14T13:39:54Z

== Compact
 Version          : polimec-mainnet-7003 (polimec-mainnet-0.tx2.au1)
 Metadata         : V14
 Size             : 5.05 MB (5300323 bytes)
 setCode          : 0x9ef21882fcd88f36b505c254fc62d197aa0c08350ac0b8afbb9b67674c8376fb
 authorizeUpgrade : 0x086b1ef3054d630c355d5ac167895ea87322ac3cfe69bd694d30027aa26a4651
 IPFS             : Qmc4u4zXWfyP5oN75pcRo39BbmJBkEoUSwDbK7BocnkBWC
 BLAKE2_256       : 0x9b3fd1108446b57fc13918246078fc12273a83a8838653885c6c65754ef39e67
 Wasm             : runtimes/polimec/target/srtool/production/wbuild/polimec-runtime/polimec_runtime.compact.wasm

== Compressed
 Version          : polimec-mainnet-7003 (polimec-mainnet-0.tx2.au1)
 Metadata         : V14
 Size             : 1.26 MB (1317183 bytes)
 Compression      : 75.15%
 setCode          : 0xa30e79d56610ab3da235849de5c0045905ea91490832c763cd832a240f278037
 authorizeUpgrade : 0xe8d25332054a46040087608f1ff553ef1f5f03c6edbc20b3ba585d2b30a3280c
 IPFS             : QmP7f6jbrHXnroEvxyDuYoSKb7htr28teDkoKmiNok9jL6
 BLAKE2_256       : 0xbcc6fc9d1ff6d9c662d7ee392132838313315e8904c0f5bdeb55935a2e261875
 Wasm             : runtimes/polimec/target/srtool/production/wbuild/polimec-runtime/polimec_runtime.compact.compressed.wasm


```
  • Loading branch information
JuaniRios authored Jun 17, 2024
1 parent 0842df3 commit b9595a8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions runtimes/polimec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,9 @@ pub type Migrations = migrations::Unreleased;
/// The runtime migrations per release.
#[allow(missing_docs)]
pub mod migrations {
use crate::Runtime;

/// Unreleased migrations. Add new ones here:
#[allow(unused_parens)]
pub type Unreleased = (pallet_funding::storage_migrations::v3::MigrationToV3<Runtime>);
pub type Unreleased = ();
}

/// Executive: handles dispatch to the various modules.
Expand Down Expand Up @@ -207,7 +205,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("polimec-mainnet"),
impl_name: create_runtime_str!("polimec-mainnet"),
authoring_version: 1,
spec_version: 0_007_002,
spec_version: 0_007_003,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand All @@ -233,10 +231,15 @@ impl Contains<RuntimeCall> for BaseCallFilter {
matches!(
call,
pallet_funding::Call::create_project { .. } |
pallet_funding::Call::edit_project { .. } |
pallet_funding::Call::remove_project { .. } |
pallet_funding::Call::edit_project { .. } |
pallet_funding::Call::start_evaluation { .. } |
pallet_funding::Call::evaluate { .. }
pallet_funding::Call::root_do_evaluation_end { .. } |
pallet_funding::Call::evaluate { .. } |
pallet_funding::Call::start_auction { .. } |
pallet_funding::Call::root_do_auction_opening { .. } |
pallet_funding::Call::root_do_start_auction_closing { .. } |
pallet_funding::Call::bid { .. }
)
},
_ => true,
Expand Down

0 comments on commit b9595a8

Please sign in to comment.