Skip to content

add storage migration teerex V1->V2#226

Merged
brenzi merged 4 commits intomasterfrom
ab/state-migration-for-dcap-sgx-status
Sep 15, 2023
Merged

add storage migration teerex V1->V2#226
brenzi merged 4 commits intomasterfrom
ab/state-migration-for-dcap-sgx-status

Conversation

@brenzi
Copy link
Contributor

@brenzi brenzi commented Sep 15, 2023

tested against rococo and kusama:

./target/release/integritee-collator try-runtime   --chain integritee-rococo   --runtime ./target/release/wbuild/integritee-runtime/integritee_runtime.wasm   on-runtime-upgrade --checks=all   live --uri wss://rococo.api.integritee.network:443
2023-09-15 13:54:01 replacing wss:// in uri with https://: "https://rococo.api.integritee.network:443" (ws is currently unstable for fetching remote storage, for more see https://github.com/paritytech/jsonrpsee/issues/1086)    
2023-09-15 13:54:01 since no at is provided, setting it to latest finalized head, 0xb495449e0d711cc5f03524f956b6c81c3fdb57936894899715f81c5584d156fd    
2023-09-15 13:54:01 since no prefix is filtered, the data for all pallets will be downloaded    
2023-09-15 13:54:01 scraping key-pairs from remote at block height 0xb495449e0d711cc5f03524f956b6c81c3fdb57936894899715f81c5584d156fd    
2023-09-15 13:54:02 Querying a total of 2347 keys from prefix , splitting among 4 threads, 587 keys per thread    
2023-09-15 13:54:02 inserting keys progress = 25% [586 / 2347]    
2023-09-15 13:54:03 inserting keys progress = 50% [1173 / 2347]    
2023-09-15 13:54:03 inserting keys progress = 75% [1760 / 2347]    
2023-09-15 13:54:03 inserting keys progress = 100% [2347 / 2347]    
2023-09-15 13:54:03 adding data for hashed prefix: , took 1s    
2023-09-15 13:54:03 adding data for hashed key: 3a636f6465    
2023-09-15 13:54:03 adding data for hashed key: 26aa394eea5630e07c48ae0c9558cef7f9cce9c888469bb1a0dceaa129672ef8    
2023-09-15 13:54:03 adding data for hashed key: 26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac    
2023-09-15 13:54:03 initialized state externalities with storage root 0xd50b2839677f9363192c4079ea5b57e87bc33cfbd4c9bcfca45a8028273dba57 and state_version V0    
2023-09-15 13:54:03 original spec: RuntimeString::Owned("integritee-parachain")-37, code hash: 91b3dad54a4ddb857dfd7932d1ceeac5ed8d90b965368843017f14f60e9bf278    
2023-09-15 13:54:03 new spec: RuntimeString::Owned("integritee-parachain")-38, code hash: 692fcb49b812a1b0019dfd7a023fa777de6b7365a52b886215380f5bb153eae5    
2023-09-15 13:54:04 teerexV1: 0 v0 enclaves are present before eventual upgrade    
2023-09-15 13:54:04 teerexV1: SGX debug mode was allowed pre_upgrade: false    
2023-09-15 13:54:04 teerexV1: Running migration with current storage version StorageVersion(1) / onchain StorageVersion(1)    
2023-09-15 13:54:04 teerexV1: skipping on_runtime_upgrade: executed on same or newer storage version.    
2023-09-15 13:54:04 teerexV1: migration was skipped because onchain version was greater or equal to the target version of this migration step    
2023-09-15 13:54:04 teerexV2: TCB info for 3 fmspc entries will be purged    
2023-09-15 13:54:04 teerexV2: Running migration with current storage version StorageVersion(2) / onchain StorageVersion(1)    
2023-09-15 13:54:04 ⚠️ ParachainSystem declares internal migrations (which *might* execute). On-chain `StorageVersion(2)` vs current storage version `StorageVersion(2)`    
2023-09-15 13:54:04 ⚠️ XcmpQueue declares internal migrations (which *might* execute). On-chain `StorageVersion(3)` vs current storage version `StorageVersion(2)`    
2023-09-15 13:54:04 ⚠️ PolkadotXcm declares internal migrations (which *might* execute). On-chain `StorageVersion(0)` vs current storage version `StorageVersion(1)`    
2023-09-15 13:54:04 ⚠️ DmpQueue declares internal migrations (which *might* execute). On-chain `StorageVersion(2)` vs current storage version `StorageVersion(1)`    
2023-09-15 13:54:04 TryRuntime_on_runtime_upgrade executed without errors. Consumed weight = (925000000 ps, 0 byte), total weight = (500000000000 ps, 5242880 byte) (0.18 %, 0.00 %).  

Comment on lines +57 to +58
log::info!(
"teerexV1: {} v0 enclaves are present before eventual upgrade",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the log target gets swallowed by try-runtime. therefore using prefix in log msg

Copy link
Contributor

Choose a reason for hiding this comment

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

How do they do it in substrate? Like this, it will probably be displayed in try-runtime, but actually not be logged in production.

Copy link
Contributor

@clangenb clangenb left a comment

Choose a reason for hiding this comment

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

One question about the logging. LGTM otherwise.

Comment on lines +57 to +58
log::info!(
"teerexV1: {} v0 enclaves are present before eventual upgrade",
Copy link
Contributor

Choose a reason for hiding this comment

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

How do they do it in substrate? Like this, it will probably be displayed in try-runtime, but actually not be logged in production.

@brenzi
Copy link
Contributor Author

brenzi commented Sep 15, 2023

good point. it will be logged for sure, but our log filtering might miss it. I'll re-add the target so we double-mention teerex

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.

2 participants