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

chore: upgrade to 1.13.0 #194

Merged
merged 101 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
464519b
chore: upgrade to v1.9.0
chungquantin Aug 12, 2024
26af9de
chore: upgrade to 1.10.0
chungquantin Aug 13, 2024
52ed359
refactor: remove native executor, add unified host functions
chungquantin Aug 13, 2024
e0ff905
feat: pov claim feature
chungquantin Aug 13, 2024
7998178
feat: pov claim feature
chungquantin Aug 13, 2024
551218b
chore: upgrade to 1.10.0
chungquantin Aug 13, 2024
787d39a
chore: rebase upstream 1.8.0
chungquantin Aug 14, 2024
939ba7a
chore: update cargo.lock
chungquantin Aug 14, 2024
db16f2b
Merge branch 'chungquantin/chore-polkadot-v1.9.0' into chungquantin/c…
chungquantin Aug 14, 2024
2b7428c
fix: undo benchmarking host functions removal
chungquantin Aug 14, 2024
17fcfd1
chore: upgrade to v1.11.0
chungquantin Aug 14, 2024
a5630f0
fix: add missing signed extra
chungquantin Aug 14, 2024
4bdae59
chore: upgrade to 1.10.0
chungquantin Aug 13, 2024
f4813dd
refactor: remove native executor, add unified host functions
chungquantin Aug 13, 2024
63dd2d8
feat: pov claim feature
chungquantin Aug 13, 2024
efac88e
chore: upgrade to 1.10.0
chungquantin Aug 13, 2024
c2ec0e0
chore: rebase upstream 1.8.0
chungquantin Aug 14, 2024
c2fe9b3
chore: update cargo.lock
chungquantin Aug 14, 2024
1bdc5b8
fix: undo benchmarking host functions removal
chungquantin Aug 14, 2024
ba35239
Merge remote-tracking branch 'refs/remotes/origin/chungquantin/chore-…
chungquantin Aug 14, 2024
f7b5b53
fix: remove pov reclaim from testnet
chungquantin Aug 14, 2024
06fbb92
fix: remove signed extra
chungquantin Aug 14, 2024
76b0712
feat: update the authoring duration
chungquantin Aug 14, 2024
fcbecff
fix: comment identation
chungquantin Aug 14, 2024
676023d
chore: upgrade to v1.11.0
chungquantin Aug 14, 2024
36440f9
fix: comment identation
chungquantin Aug 14, 2024
dbfaa40
Merge remote-tracking branch 'refs/remotes/origin/chungquantin/chore-…
chungquantin Aug 14, 2024
36f7bf1
fix: remove signed extra from testnet
chungquantin Aug 14, 2024
6a21b84
fix: mismatch dependency version
chungquantin Aug 14, 2024
8b085e2
chore(upgrade): add feature gate to the unified host functions
chungquantin Aug 14, 2024
a127f44
chore: rebase v1.10.0
chungquantin Aug 14, 2024
6950395
fix: comment identation
chungquantin Aug 14, 2024
6a1f0ca
fix: remove signed extra from testnet
chungquantin Aug 14, 2024
5503e5f
fix: mismatch dependency version
chungquantin Aug 14, 2024
45b59e2
Merge remote-tracking branch 'refs/remotes/origin/chungquantin/chore-…
chungquantin Aug 14, 2024
a2025a1
chore: upgrade to v1.12.0
chungquantin Aug 14, 2024
2352a50
chore: revert pov reclaim feature
chungquantin Aug 15, 2024
c0ec099
chore: upgrade to 1.13.0
chungquantin Aug 15, 2024
f554468
Merge branch 'chungquantin/chore-polkadot-v1.9.0' into chungquantin/c…
chungquantin Aug 15, 2024
4eb9d97
fix: add missing signed extra for metadata hash
chungquantin Aug 15, 2024
cfbd5d4
Merge branch 'developer' into chungquantin/chore-polkadot-v1.10.0
chungquantin Aug 15, 2024
0d8e50a
chore: update lock file
chungquantin Aug 15, 2024
9cd01dd
chore: upgrade to v1.9.0
chungquantin Aug 12, 2024
e68615e
feat: pov claim feature
chungquantin Aug 13, 2024
f22d339
fix: add missing signed extra
chungquantin Aug 14, 2024
a3e6de2
chore: upgrade to 1.10.0
chungquantin Aug 13, 2024
7943f0a
refactor: remove native executor, add unified host functions
chungquantin Aug 13, 2024
8e91a8d
feat: pov claim feature
chungquantin Aug 13, 2024
833e4ba
chore: upgrade to 1.10.0
chungquantin Aug 13, 2024
ea2adee
chore: rebase upstream 1.8.0
chungquantin Aug 14, 2024
e923e9e
chore: update cargo.lock
chungquantin Aug 14, 2024
be53317
fix: undo benchmarking host functions removal
chungquantin Aug 14, 2024
48803bd
chore: upgrade to 1.10.0
chungquantin Aug 13, 2024
2b91db6
refactor: remove native executor, add unified host functions
chungquantin Aug 13, 2024
10ebaa6
feat: pov claim feature
chungquantin Aug 13, 2024
c9abfa2
chore: upgrade to 1.10.0
chungquantin Aug 13, 2024
a258bf6
chore: rebase upstream 1.8.0
chungquantin Aug 14, 2024
88f423d
chore: update cargo.lock
chungquantin Aug 14, 2024
fb8c6eb
fix: undo benchmarking host functions removal
chungquantin Aug 14, 2024
8257cc4
fix: remove signed extra
chungquantin Aug 14, 2024
ff33961
feat: update the authoring duration
chungquantin Aug 14, 2024
587dc45
chore(upgrade): add feature gate to the unified host functions
chungquantin Aug 14, 2024
5608785
chore: revert pov reclaim feature
chungquantin Aug 15, 2024
827dc84
chore: update lock file
chungquantin Aug 15, 2024
ab65d6a
Merge remote-tracking branch 'refs/remotes/origin/chungquantin/chore-…
chungquantin Aug 15, 2024
1257186
feat: pov claim feature
chungquantin Aug 13, 2024
81115f5
chore: upgrade to 1.10.0
chungquantin Aug 13, 2024
242b68a
refactor: remove native executor, add unified host functions
chungquantin Aug 13, 2024
62ca070
feat: pov claim feature
chungquantin Aug 13, 2024
a72b206
chore: upgrade to 1.10.0
chungquantin Aug 13, 2024
9863cff
fix: undo benchmarking host functions removal
chungquantin Aug 14, 2024
d058b22
refactor: remove native executor, add unified host functions
chungquantin Aug 13, 2024
5344837
fix: undo benchmarking host functions removal
chungquantin Aug 14, 2024
b981174
chore: revert pov reclaim feature
chungquantin Aug 15, 2024
c9416ea
Merge branch 'developer' into chungquantin/chore-polkadot-v1.10.0
chungquantin Aug 15, 2024
256e8d4
Merge branch 'developer' into chungquantin/chore-polkadot-v1.10.0
chungquantin Aug 15, 2024
fff8d0d
fix: add missing experimental feature
chungquantin Aug 15, 2024
84d9334
chore: revert experimental flag
chungquantin Aug 15, 2024
764e41d
fix: remove EOL space
chungquantin Aug 15, 2024
b8d61ea
chore: rebase v1.10.0
chungquantin Aug 14, 2024
0db3bb9
fix: comment identation
chungquantin Aug 14, 2024
b6ee08f
fix: remove signed extra from testnet
chungquantin Aug 14, 2024
2b4ce6d
fix: mismatch dependency version
chungquantin Aug 14, 2024
a544bef
chore: upgrade to v1.11.0
chungquantin Aug 14, 2024
ff34782
fix: remove signed extra from testnet
chungquantin Aug 14, 2024
b33a5bc
fix: mismatch dependency version
chungquantin Aug 14, 2024
a624454
Merge remote-tracking branch 'refs/remotes/origin/chungquantin/chore-…
chungquantin Aug 15, 2024
410039e
Merge branch 'chungquantin/chore-polkadot-v1.11.0' into chungquantin/…
chungquantin Aug 15, 2024
d1e3027
Merge branch 'chungquantin/chore-polkadot-v1.12.0' into chungquantin/…
chungquantin Aug 15, 2024
9de05d8
fix: remove metadata hash from testnet
chungquantin Aug 15, 2024
3e9d856
fix: remove metadata hash extension
chungquantin Aug 15, 2024
b88473e
Merge branch 'developer' into chungquantin/chore-polkadot-v1.11.0
chungquantin Aug 16, 2024
d222eb6
refactor: simplify wasm build script
chungquantin Aug 16, 2024
fb24dc5
Merge branch 'chungquantin/chore-polkadot-v1.11.0' into chungquantin/…
chungquantin Aug 16, 2024
90b6ca8
Merge branch 'developer' into chungquantin/chore-polkadot-v1.12.0
chungquantin Aug 16, 2024
564c6d5
fix: remove frame metadata hash extension
chungquantin Aug 16, 2024
3ef3849
fix: remove metadata hash from testnet
chungquantin Aug 16, 2024
b8c4dcd
Merge branch 'chungquantin/chore-polkadot-v1.12.0' into chungquantin/…
chungquantin Aug 16, 2024
3607a5d
feat: simplify wasm build script
chungquantin Aug 16, 2024
c64188e
fix: update build metadata has parameters
chungquantin Aug 17, 2024
975b611
Merge branch 'developer' into chungquantin/chore-polkadot-v1.13.0
chungquantin Aug 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,760 changes: 2,404 additions & 2,356 deletions Cargo.lock

Large diffs are not rendered by default.

203 changes: 101 additions & 102 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ scale-info = { version = "2.10.0", default-features = false, features = [
smallvec = "1.11.0"
serde = "1.0.195"
clap = { version = "4.4.18", features = ["derive"] }
jsonrpsee = { version = "0.22.0", features = ["server"] }
jsonrpsee = { version = "0.22.5", features = ["server"] }
futures = "0.3.28"
serde_json = "1.0.111"
tracing-subscriber = { version = "0.3", default-features = false }
Expand All @@ -48,7 +48,7 @@ tokio = { version = "1.36", features = ["macros", "time", "rt-multi-thread"] }

# Build
substrate-build-script-utils = "11.0.0"
substrate-wasm-builder = "22.0.1"
substrate-wasm-builder = "23.0.0"

# Local
pop-runtime-devnet = { path = "runtime/devnet", default-features = true } # default-features=true required for `-p pop-node` builds
Expand All @@ -57,113 +57,112 @@ pop-runtime-common = { path = "runtime/common", default-features = false }
pop-primitives = { path = "./primitives", default-features = false }

# Substrate
sc-basic-authorship = "0.40.0"
sc-chain-spec = "33.0.0"
sc-cli = "0.42.0"
sc-client-api = "34.0.0"
sc-offchain = "35.0.0"
sc-consensus = "0.39.1"
sc-executor = "0.38.0"
sc-network = "0.40.0"
sc-network-sync = "0.39.0"
sc-rpc = "35.0.0"
sc-service = "0.41.0"
sc-sysinfo = "33.0.0"
sc-telemetry = "20.0.0"
sc-tracing = "34.0.0"
sc-transaction-pool = "34.0.0"
sc-transaction-pool-api = "34.0.0"
frame-benchmarking = { version = "34.0.0", default-features = false }
frame-benchmarking-cli = "38.0.0"
frame-executive = { version = "34.0.0", default-features = false }
frame-support = { version = "34.0.0", default-features = false }
frame-system = { version = "34.0.1", default-features = false }
frame-system-benchmarking = { version = "34.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "32.0.0", default-features = false }
frame-try-runtime = { version = "0.40.0", default-features = false }
pallet-aura = { version = "33.0.0", default-features = false }
pallet-authorship = { version = "34.0.0", default-features = false }
pallet-assets = { version = "35.0.0", default-features = false }
pallet-balances = { version = "35.0.0", default-features = false }
pallet-contracts = { version = "33.0.0", default-features = false }
pallet-message-queue = { version = "37.0.0", default-features = false }
pallet-multisig = { version = "34.0.0", default-features = false }
pallet-nft-fractionalization = { version = "16.0.0", default-features = false }
pallet-nfts = { version = "28.0.0", default-features = false }
pallet-nfts-runtime-api = { version = "20.0.0", default-features = false }
pallet-preimage = { version = "34.0.0", default-features = false }
pallet-proxy = { version = "34.0.0", default-features = false }
pallet-scheduler = { version = "35.0.0", default-features = false }
pallet-session = { version = "34.0.0", default-features = false }
pallet-sudo = { version = "34.0.0", default-features = false }
pallet-timestamp = { version = "33.0.0", default-features = false }
pallet-transaction-payment = { version = "34.0.0", default-features = false }
pallet-transaction-payment-rpc = "36.0.0"
pallet-transaction-payment-rpc-runtime-api = { version = "34.0.0", default-features = false }
pallet-utility = { version = "34.0.0", default-features = false }
sp-api = { version = "32.0.0", default-features = false }
sp-authority-discovery = { version = "32.0.0", default-features = false }
sp-block-builder = { version = "32.0.0", default-features = false }
sp-blockchain = "34.0.0"
sp-consensus-aura = { version = "0.38.0", default-features = false }
sp-consensus-babe = { version = "0.38.0", default-features = false }
sp-consensus-beefy = { version = "19.0.0", default-features = false }
sp-consensus-grandpa = { version = "19.0.0", default-features = false }
sp-core = { version = "33.0.1", default-features = false }
sp-keystore = "0.39.0"
sp-io = { version = "36.0.0", default-features = false }
sp-genesis-builder = { version = "0.13.0", default-features = false }
sp-inherents = { version = "32.0.0", default-features = false }
sp-offchain = { version = "32.0.0", default-features = false }
sp-runtime = { version = "37.0.0", default-features = false }
sp-timestamp = "32.0.0"
substrate-frame-rpc-system = "34.0.0"
sc-basic-authorship = "0.41.0"
sc-chain-spec = "34.0.0"
sc-cli = "0.43.0"
sc-client-api = "=35.0.0"
sc-offchain = "36.0.0"
sc-consensus = "0.40.0"
sc-executor = "0.39.0"
sc-network = "0.41.0"
sc-network-sync = "0.40.0"
sc-rpc = "36.0.0"
sc-service = "0.42.0"
sc-sysinfo = "34.0.0"
sc-telemetry = "21.0.0"
sc-tracing = "35.0.0"
sc-transaction-pool = "35.0.0"
sc-transaction-pool-api = "35.0.0"
frame-benchmarking = { version = "35.0.0", default-features = false }
frame-benchmarking-cli = "39.0.0"
frame-executive = { version = "35.0.0", default-features = false }
frame-support = { version = "35.0.0", default-features = false }
frame-system = { version = "35.0.0", default-features = false }
frame-system-benchmarking = { version = "35.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "33.0.0", default-features = false }
frame-try-runtime = { version = "0.41.0", default-features = false }
frame-metadata-hash-extension = { version = "0.3.0", default-features = false }
pallet-aura = { version = "34.0.0", default-features = false }
pallet-authorship = { version = "35.0.0", default-features = false }
pallet-assets = { version = "36.0.0", default-features = false }
pallet-balances = { version = "36.0.0", default-features = false }
pallet-contracts = { version = "34.0.0", default-features = false }
pallet-message-queue = { version = "38.0.0", default-features = false }
pallet-multisig = { version = "35.0.0", default-features = false }
pallet-nft-fractionalization = { version = "17.0.0", default-features = false }
pallet-nfts = { version = "29.0.0", default-features = false }
pallet-nfts-runtime-api = { version = "21.0.0", default-features = false }
pallet-preimage = { version = "35.0.0", default-features = false }
pallet-proxy = { version = "35.0.0", default-features = false }
pallet-scheduler = { version = "36.0.0", default-features = false }
pallet-session = { version = "35.0.0", default-features = false }
pallet-sudo = { version = "35.0.0", default-features = false }
pallet-timestamp = { version = "34.0.0", default-features = false }
pallet-transaction-payment = { version = "35.0.0", default-features = false }
pallet-transaction-payment-rpc = "37.0.0"
pallet-transaction-payment-rpc-runtime-api = { version = "35.0.0", default-features = false }
pallet-utility = { version = "35.0.0", default-features = false }
sp-api = { version = "33.0.0", default-features = false }
sp-authority-discovery = { version = "33.0.0", default-features = false }
sp-block-builder = { version = "33.0.0", default-features = false }
sp-blockchain = "35.0.0"
sp-consensus-aura = { version = "0.39.0", default-features = false }
sp-consensus-babe = { version = "0.39.0", default-features = false }
sp-consensus-beefy = { version = "20.0.0", default-features = false }
sp-consensus-grandpa = { version = "20.0.0", default-features = false }
sp-core = { version = "34.0.0", default-features = false }
sp-keystore = "0.40.0"
sp-io = { version = "37.0.0", default-features = false }
sp-genesis-builder = { version = "0.14.0", default-features = false }
sp-inherents = { version = "33.0.0", default-features = false }
sp-offchain = { version = "33.0.0", default-features = false }
sp-runtime = { version = "=38.0.0", default-features = false }
sp-timestamp = "33.0.0"
substrate-frame-rpc-system = "35.0.0"
substrate-prometheus-endpoint = "0.17.0"
sp-session = { version = "33.0.0", default-features = false }
sp-session = { version = "34.0.0", default-features = false }
sp-std = { version = "14.0.0", default-features = false }
sp-transaction-pool = { version = "32.0.0", default-features = false }
sp-version = { version = "35.0.0", default-features = false }
sp-transaction-pool = { version = "33.0.0", default-features = false }
sp-version = { version = "36.0.0", default-features = false }

# Polkadot
pallet-xcm = { version = "13.0.0", default-features = false }
polkadot-cli = "13.0.0"
polkadot-parachain-primitives = { version = "12.0.0", default-features = false }
polkadot-runtime-parachains = { version = "13.0.0", default-features = false }
polkadot-primitives = { version = "13.0.0", default-features = false }
polkadot-runtime-common = { version = "13.0.0", default-features = false }
rococo-runtime-constants = { version = "13.0.0", default-features = false }
rococo-runtime = { version = "13.0.0", default-features = false }
xcm = { version = "13.0.1", package = "staging-xcm", default-features = false }
xcm-builder = { version = "13.0.0", package = "staging-xcm-builder", default-features = false }
xcm-executor = { version = "13.0.0", package = "staging-xcm-executor", default-features = false }
pallet-xcm = { version = "14.0.0", default-features = false }
polkadot-cli = "14.0.0"
polkadot-parachain-primitives = { version = "13.0.0", default-features = false }
polkadot-runtime-parachains = { version = "14.0.0", default-features = false }
polkadot-primitives = { version = "14.0.0", default-features = false }
polkadot-runtime-common = { version = "14.0.0", default-features = false }
rococo-runtime-constants = { version = "14.0.0", default-features = false }
rococo-runtime = { version = "14.0.0", default-features = false }
xcm = { version = "14.0.0", package = "staging-xcm", default-features = false }
xcm-builder = { version = "14.0.0", package = "staging-xcm-builder", default-features = false }
xcm-executor = { version = "14.0.0", package = "staging-xcm-executor", default-features = false }

# Cumulus
asset-hub-rococo-runtime = { version = "0.17.0", default-features = false }
asset-test-utils = { version = "13.0.0", default-features = false }
cumulus-pallet-aura-ext = { version = "0.13.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.13.0", default-features = false, features = [
chungquantin marked this conversation as resolved.
Show resolved Hide resolved
"parameterized-consensus-hook",
] }
cumulus-pallet-session-benchmarking = { version = "15.0.0", default-features = false }
cumulus-pallet-xcm = { version = "0.13.0", default-features = false }
cumulus-pallet-xcmp-queue = { version = "0.13.0", default-features = false }
cumulus-primitives-aura = { version = "0.13.0", default-features = false }
cumulus-primitives-core = { version = "0.13.0", default-features = false }
cumulus-primitives-storage-weight-reclaim = { version = "4.0.0", default-features = false }
cumulus-primitives-utility = { version = "0.13.0", default-features = false }
emulated-integration-tests-common = { version = "9.0.0", default-features = false }
pallet-collator-selection = { version = "15.0.0", default-features = false }
parachains-common = { version = "13.0.0", default-features = false }
parachain-info = { version = "0.13.0", package = "staging-parachain-info", default-features = false }
cumulus-primitives-parachain-inherent = "0.13.0"
cumulus-relay-chain-interface = "0.13.0"
asset-hub-rococo-runtime = { version = "0.18.0", default-features = false }
asset-test-utils = { version = "14.0.0", default-features = false }
cumulus-pallet-aura-ext = { version = "0.14.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.14.0", default-features = false }
cumulus-pallet-session-benchmarking = { version = "16.0.0", default-features = false }
cumulus-pallet-xcm = { version = "0.14.0", default-features = false }
cumulus-pallet-xcmp-queue = { version = "0.14.0", default-features = false }
cumulus-primitives-aura = { version = "0.14.0", default-features = false }
cumulus-primitives-core = { version = "0.14.0", default-features = false }
cumulus-primitives-storage-weight-reclaim = { version = "5.0.0", default-features = false }
cumulus-primitives-utility = { version = "0.14.0", default-features = false }
emulated-integration-tests-common = { version = "10.0.0", default-features = false }
pallet-collator-selection = { version = "16.0.0", default-features = false }
parachains-common = { version = "14.0.0", default-features = false }
parachain-info = { version = "0.14.0", package = "staging-parachain-info", default-features = false }
cumulus-primitives-parachain-inherent = "0.14.0"
cumulus-relay-chain-interface = "0.14.0"
color-print = "0.3.4"
cumulus-client-cli = "0.13.0"
cumulus-client-collator = "0.13.0"
cumulus-client-consensus-aura = "0.13.0"
cumulus-client-consensus-common = "0.13.0"
cumulus-client-consensus-proposer = "0.13.0"
cumulus-client-service = "0.13.0"
cumulus-client-cli = "0.14.0"
cumulus-client-collator = "0.14.0"
cumulus-client-consensus-aura = "0.14.0"
cumulus-client-consensus-common = "0.14.0"
cumulus-client-consensus-proposer = "0.14.0"
cumulus-client-service = "0.14.0"

# Paseo
asset-hub-paseo-runtime = { git = "https://github.com/paseo-network/runtimes/", tag = "v1.2.5-system-chains", default-features = false }
Expand Down
6 changes: 2 additions & 4 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ use sp_core::{crypto::Ss58Codec, sr25519, Pair, Public};
use sp_runtime::traits::{IdentifyAccount, Verify};

/// Specialized `ChainSpec` for the development parachain runtime.
pub type DevnetChainSpec =
sc_service::GenericChainSpec<pop_runtime_devnet::RuntimeGenesisConfig, Extensions>;
pub type DevnetChainSpec = sc_service::GenericChainSpec<Extensions>;

/// Specialized `ChainSpec` for the testnet parachain runtime.
pub type TestnetChainSpec =
sc_service::GenericChainSpec<pop_runtime_testnet::RuntimeGenesisConfig, Extensions>;
pub type TestnetChainSpec = sc_service::GenericChainSpec<Extensions>;

/// The default XCM version to set in genesis config.
const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;
Expand Down
13 changes: 13 additions & 0 deletions runtime/devnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,16 @@ try-runtime = [
"polkadot-runtime-common/try-runtime",
"sp-runtime/try-runtime",
]

# Enable the metadata hash generation.
#
# This is hidden behind a feature because it increases the compile time.
# The wasm binary needs to be compiled twice, once to fetch the metadata,
# generate the metadata hash and then a second time with the
# `RUNTIME_METADATA_HASH` environment variable set for the `CheckMetadataHash`
# extension.
metadata-hash = ["substrate-wasm-builder/metadata-hash"]

# A convenience feature for enabling things when doing a build
# for an on-chain release.
on-chain-release-build = ["metadata-hash"]
9 changes: 8 additions & 1 deletion runtime/devnet/build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#[cfg(feature = "std")]
#[cfg(all(feature = "std", feature = "metadata-hash"))]
fn main() {
substrate_wasm_builder::WasmBuilder::init_with_defaults()
.enable_metadata_hash("PAS", 10)
.build()
}

#[cfg(all(feature = "std", not(feature = "metadata-hash")))]
fn main() {
substrate_wasm_builder::WasmBuilder::build_using_defaults()
}
Expand Down
18 changes: 6 additions & 12 deletions runtime/devnet/src/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use pallet_contracts::chain_extension::{
BufInBufOutState, ChainExtension, ChargedAmount, Environment, Ext, InitState, RetVal,
};
use pallet_contracts::WeightInfo;
use pop_primitives::storage_keys::RuntimeStateKeys;
use sp_core::crypto::UncheckedFrom;
use sp_runtime::{traits::Dispatchable, DispatchError};
Expand All @@ -15,8 +16,6 @@

const LOG_TARGET: &str = "pop-api::extension";

type ContractSchedule<T> = <T as pallet_contracts::Config>::Schedule;

#[derive(Default)]
pub struct PopApiExtension;

Expand All @@ -30,7 +29,7 @@
>,
T::AccountId: UncheckedFrom<T::Hash> + AsRef<[u8]>,
{
fn call<E: Ext>(&mut self, env: Environment<E, InitState>) -> Result<RetVal, DispatchError>

Check warning on line 32 in runtime/devnet/src/extensions.rs

View workflow job for this annotation

GitHub Actions / clippy

bound is defined in more than one place

warning: bound is defined in more than one place --> runtime/devnet/src/extensions.rs:32:10 | 32 | fn call<E: Ext>(&mut self, env: Environment<E, InitState>) -> Result<RetVal, DispatchError> | ^ 33 | where 34 | E: Ext<T = T>, | ^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_bound_locations = note: `#[warn(clippy::multiple_bound_locations)]` on by default
where
E: Ext<T = T>,
{
Expand Down Expand Up @@ -124,16 +123,14 @@
T: pallet_contracts::Config,
E: Ext<T = T>,
{
let contract_host_weight = ContractSchedule::<T>::get().host_fn_weights;

// calculate weight for reading bytes of `len`
// reference: https://github.com/paritytech/polkadot-sdk/blob/117a9433dac88d5ac00c058c9b39c511d47749d2/substrate/frame/contracts/src/wasm/runtime.rs#L267
let base_weight: Weight = contract_host_weight.return_per_byte.saturating_mul(len.into());
// reference: https://github.com/paritytech/polkadot-sdk/pull/4233/files#:~:text=CopyToContract(len)%20%3D%3E%20T%3A%3AWeightInfo%3A%3Aseal_input(len)%2C
let base_weight: Weight = T::WeightInfo::seal_return(len);
chungquantin marked this conversation as resolved.
Show resolved Hide resolved

// debug_message weight is a good approximation of the additional overhead of going
// from contract layer to substrate layer.
// reference: https://github.com/paritytech/ink-examples/blob/b8d2caa52cf4691e0ddd7c919e4462311deb5ad0/psp22-extension/runtime/psp22-extension-example.rs#L236
let overhead = contract_host_weight.debug_message;
// reference: https://github.com/paritytech/polkadot-sdk/pull/4233/files#:~:text=DebugMessage(len)%20%3D%3E%20T%3A%3AWeightInfo%3A%3Aseal_debug_message(len)%2C
let overhead = T::WeightInfo::seal_debug_message(len);

let charged_weight = env.charge_weight(base_weight.saturating_add(overhead))?;
log::debug!(target: LOG_TARGET, "{} charged weight: {:?}", log_prefix, charged_weight);
Expand Down Expand Up @@ -173,19 +170,16 @@
let mut env = env.buf_in_buf_out();

// To be conservative, we charge the weight for reading the input bytes of a fixed-size type.
let base_weight: Weight = ContractSchedule::<T>::get()
.host_fn_weights
.return_per_byte
.saturating_mul(env.in_len().into());
let base_weight: Weight = T::WeightInfo::seal_return(env.in_len());
chungquantin marked this conversation as resolved.
Show resolved Hide resolved
let charged_weight = env.charge_weight(base_weight)?;

log::debug!(target:LOG_TARGET, "{} charged weight: {:?}", LOG_PREFIX, charged_weight);

let key: RuntimeStateKeys = env.read_as()?;

let result = match key {
_ => Vec::<u8>::default(),
}

Check warning on line 182 in runtime/devnet/src/extensions.rs

View workflow job for this annotation

GitHub Actions / clippy

this match could be replaced by its body itself

warning: this match could be replaced by its body itself --> runtime/devnet/src/extensions.rs:180:15 | 180 | let result = match key { | __________________^ 181 | | _ => Vec::<u8>::default(), 182 | | } | |_____^ help: consider using the match body instead: `Vec::<u8>::default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding = note: `#[warn(clippy::match_single_binding)]` on by default
.encode();

log::trace!(
Expand Down
8 changes: 6 additions & 2 deletions runtime/devnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,10 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
type WeightInfo = ();
type PriceForSiblingDelivery = NoPriceForMessageDelivery<ParaId>;
// Limit the number of messages and signals a HRML channel can have at most
chungquantin marked this conversation as resolved.
Show resolved Hide resolved
type MaxActiveOutboundChannels = ConstU32<128>;
// Limit the number of HRML channels
type MaxPageSize = ConstU32<{ 1 << 16 }>;
}

parameter_types! {
Expand Down Expand Up @@ -641,7 +645,7 @@ impl_runtime_apis! {
Runtime::metadata_at_version(version)
}

fn metadata_versions() -> sp_std::vec::Vec<u32> {
fn metadata_versions() -> Vec<u32> {
Runtime::metadata_versions()
}
}
Expand Down Expand Up @@ -915,7 +919,7 @@ impl_runtime_apis! {

use frame_system_benchmarking::Pallet as SystemBench;
impl frame_system_benchmarking::Config for Runtime {
fn setup_set_code_requirements(code: &sp_std::vec::Vec<u8>) -> Result<(), BenchmarkError> {
fn setup_set_code_requirements(code: &Vec<u8>) -> Result<(), BenchmarkError> {
ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32);
Ok(())
}
Expand Down
9 changes: 8 additions & 1 deletion runtime/testnet/build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#[cfg(feature = "std")]
#[cfg(all(feature = "std", feature = "metadata-hash"))]

Check warning on line 1 in runtime/testnet/build.rs

View workflow job for this annotation

GitHub Actions / clippy

unexpected `cfg` condition value: `metadata-hash`

warning: unexpected `cfg` condition value: `metadata-hash` --> runtime/testnet/build.rs:1:28 | 1 | #[cfg(all(feature = "std", feature = "metadata-hash"))] | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: expected values for `feature` are: `default`, `runtime-benchmarks`, `std`, and `try-runtime` = help: consider adding `metadata-hash` as a feature in `Cargo.toml` = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default
fn main() {
substrate_wasm_builder::WasmBuilder::init_with_defaults()
.enable_metadata_hash("PAS", 10)
.build()
}

#[cfg(all(feature = "std", not(feature = "metadata-hash")))]

Check warning on line 8 in runtime/testnet/build.rs

View workflow job for this annotation

GitHub Actions / clippy

unexpected `cfg` condition value: `metadata-hash`

warning: unexpected `cfg` condition value: `metadata-hash` --> runtime/testnet/build.rs:8:32 | 8 | #[cfg(all(feature = "std", not(feature = "metadata-hash")))] | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: expected values for `feature` are: `default`, `runtime-benchmarks`, `std`, and `try-runtime` = help: consider adding `metadata-hash` as a feature in `Cargo.toml` = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
fn main() {
substrate_wasm_builder::WasmBuilder::build_using_defaults()
}
Expand Down
Loading
Loading