diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e7f3462b94..305d19604b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Marks the `pallet-revive` host function `account_id` stable - [#2578](https://github.com/use-ink/ink/pull/2578) - Stabilize `is_contract` - [#2654](https://github.com/use-ink/ink/pull/2654) - Extract `sandbox` from `ink_e2e` into a new `ink_sandbox` crate - [#2659](https://github.com/use-ink/ink/pull/2659) +- Synchronize with `polkadot-sdk/1b1cef306d9ceebf963fd15a04b5c79ee2618bce` ‒ [2675](https://github.com/use-ink/ink/pull/2675) ### Fixed - Fix decoding of `HostFn::minimum_balance` return value - [#2656](https://github.com/use-ink/ink/pull/2656) diff --git a/Cargo.lock b/Cargo.lock index 24fe1dcb818..14f726acbf5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1042,7 +1042,7 @@ checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" [[package]] name = "binary-merkle-tree" version = "13.0.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "hash-db", "log", @@ -1084,6 +1084,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43d193de1f7487df1914d3a568b772458861d33f9c54249612cc2893d6915054" dependencies = [ "bitcoin_hashes 0.13.0", + "rand 0.8.5", + "rand_core 0.6.4", "serde", "unicode-normalization", ] @@ -1724,7 +1726,7 @@ dependencies = [ "ink_metadata 6.0.0-alpha.4 (git+https://github.com/use-ink/ink?tag=v6.0.0-alpha.4)", "itertools 0.14.0", "parity-scale-codec", - "polkavm-linker 0.29.0", + "polkavm-linker 0.29.0 (git+https://github.com/paritytech/polkavm.git)", "regex", "rustc_version 0.4.1", "rustversion", @@ -2437,7 +2439,7 @@ dependencies = [ [[package]] name = "ethereum-standards" version = "0.1.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "alloy-core", ] @@ -2602,7 +2604,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "28.0.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "frame-support 28.0.0", "frame-support-procedural 23.0.0", @@ -2615,11 +2617,11 @@ dependencies = [ "serde", "sp-api 26.0.0", "sp-application-crypto 30.0.0", - "sp-core 28.0.0", - "sp-io 30.0.0", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-io 30.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "sp-runtime 31.0.1", - "sp-runtime-interface 24.0.0", - "sp-storage 19.0.0", + "sp-runtime-interface 24.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-storage 19.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "static_assertions", ] @@ -2668,7 +2670,7 @@ dependencies = [ [[package]] name = "frame-support" version = "28.0.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "aquamarine", "array-bytes", @@ -2688,21 +2690,21 @@ dependencies = [ "serde", "serde_json", "sp-api 26.0.0", - "sp-arithmetic 23.0.0", - "sp-core 28.0.0", - "sp-crypto-hashing-proc-macro 0.1.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", - "sp-debug-derive 14.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-arithmetic 23.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-crypto-hashing-proc-macro 0.1.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-debug-derive 14.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "sp-genesis-builder 0.8.0", "sp-inherents 26.0.0", - "sp-io 30.0.0", + "sp-io 30.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "sp-metadata-ir 0.6.0", "sp-runtime 31.0.1", "sp-staking 26.0.0", - "sp-state-machine 0.35.0", - "sp-std 14.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", - "sp-tracing 16.0.0", - "sp-trie 29.0.0", - "sp-weights 27.0.0", + "sp-state-machine 0.35.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-std 14.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-tracing 16.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-trie 29.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-weights 27.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "tt-call", ] @@ -2751,7 +2753,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "23.0.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "Inflector", "cfg-expr", @@ -2764,7 +2766,7 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "sp-crypto-hashing 0.1.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "syn 2.0.106", ] @@ -2792,7 +2794,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "10.0.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "frame-support-procedural-tools-derive 11.0.0", "proc-macro-crate", @@ -2817,7 +2819,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "11.0.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "proc-macro2", "quote", @@ -2838,7 +2840,7 @@ dependencies = [ [[package]] name = "frame-system" version = "28.0.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "cfg-if", "docify", @@ -2847,11 +2849,11 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 28.0.0", - "sp-io 30.0.0", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-io 30.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "sp-runtime 31.0.1", "sp-version 29.0.0", - "sp-weights 27.0.0", + "sp-weights 27.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", ] [[package]] @@ -3863,7 +3865,7 @@ dependencies = [ "ink_prelude 6.0.0-alpha.4 (git+https://github.com/use-ink/ink?tag=v6.0.0-alpha.4)", "itertools 0.14.0", "num-traits", - "pallet-revive-uapi 0.1.0", + "pallet-revive-uapi 0.1.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", "parity-scale-codec", "paste", "primitive-types 0.13.1", @@ -3871,10 +3873,10 @@ dependencies = [ "scale-encode", "scale-info", "serde", - "sp-core 28.0.0", - "sp-io 30.0.0", - "sp-runtime-interface 24.0.0", - "sp-weights 27.0.0", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-io 30.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-runtime-interface 24.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-weights 27.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", "xxhash-rust", ] @@ -3889,6 +3891,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", + "serde_json", "sp-runtime 43.0.0", ] @@ -3908,13 +3911,14 @@ dependencies = [ "pallet-balances", "pallet-revive", "pallet-timestamp", + "pallet-transaction-payment", "parity-scale-codec", "paste", "scale-info", "sha3", "sp-core 38.1.0", - "sp-externalities 0.25.0", - "sp-io 30.0.0", + "sp-externalities 0.25.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-io 30.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "sp-runtime 43.0.0", "subxt-metadata 0.44.0", "thiserror 2.0.17", @@ -4768,7 +4772,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "28.0.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "docify", "frame-benchmarking", @@ -4777,14 +4781,14 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-core 28.0.0", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "sp-runtime 31.0.1", ] [[package]] name = "pallet-revive" version = "0.1.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "alloy-core", "derive_more 0.99.20", @@ -4802,13 +4806,13 @@ dependencies = [ "num-integer", "num-traits", "pallet-revive-fixtures", - "pallet-revive-proc-macro 0.1.0", - "pallet-revive-uapi 0.1.0", + "pallet-revive-proc-macro 0.1.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "pallet-revive-uapi 0.1.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "pallet-transaction-payment", "parity-scale-codec", "paste", "polkavm", - "polkavm-common 0.27.0", + "polkavm-common 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.8.5", "revm", "ripemd", @@ -4816,12 +4820,12 @@ dependencies = [ "scale-info", "serde", "sp-api 26.0.0", - "sp-arithmetic 23.0.0", + "sp-arithmetic 23.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "sp-consensus-aura", "sp-consensus-babe", "sp-consensus-slots", - "sp-core 28.0.0", - "sp-io 30.0.0", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-io 30.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "sp-runtime 31.0.1", "substrate-bn", "subxt-signer 0.43.0", @@ -4830,20 +4834,30 @@ dependencies = [ [[package]] name = "pallet-revive-fixtures" version = "0.1.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "alloy-core", "anyhow", "cargo_metadata 0.15.4", "hex", - "pallet-revive-uapi 0.1.0", - "polkavm-linker 0.27.0", + "pallet-revive-uapi 0.1.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "polkavm-linker 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json", - "sp-core 28.0.0", - "sp-io 30.0.0", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-io 30.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "toml 0.8.23", ] +[[package]] +name = "pallet-revive-proc-macro" +version = "0.1.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "pallet-revive-proc-macro" version = "0.1.0" @@ -4868,17 +4882,30 @@ dependencies = [ [[package]] name = "pallet-revive-uapi" version = "0.1.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ + "alloy-core", "bitflags 1.3.2", "const-crypto", "hex-literal 0.4.1", - "pallet-revive-proc-macro 0.1.0", + "pallet-revive-proc-macro 0.1.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "parity-scale-codec", - "polkavm-derive 0.27.0", + "polkavm-derive 0.29.0", "scale-info", ] +[[package]] +name = "pallet-revive-uapi" +version = "0.1.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +dependencies = [ + "bitflags 1.3.2", + "const-crypto", + "hex-literal 0.4.1", + "pallet-revive-proc-macro 0.1.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "polkavm-derive 0.27.0", +] + [[package]] name = "pallet-revive-uapi" version = "0.8.0" @@ -4895,7 +4922,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "27.0.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "docify", "frame-benchmarking", @@ -4906,22 +4933,23 @@ dependencies = [ "scale-info", "sp-inherents 26.0.0", "sp-runtime 31.0.1", - "sp-storage 19.0.0", + "sp-storage 19.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "sp-timestamp", ] [[package]] name = "pallet-transaction-payment" version = "28.0.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "frame-benchmarking", "frame-support 28.0.0", "frame-system", + "log", "parity-scale-codec", "scale-info", "serde", - "sp-io 30.0.0", + "sp-io 30.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "sp-runtime 31.0.1", ] @@ -5152,22 +5180,22 @@ dependencies = [ [[package]] name = "polkavm" -version = "0.27.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef5796e5aaa109df210fed7c6ff82e89c7bf94c28f6332d57bd0efb865fdc2a" +checksum = "63c8211d36125b6cc451b3cbc46b8ee27fefb54521b67f43c8630bd1afbd44d4" dependencies = [ "libc", "log", "polkavm-assembler", - "polkavm-common 0.27.0", + "polkavm-common 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", "polkavm-linux-raw", ] [[package]] name = "polkavm-assembler" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70bf3be2911acc089dfe54a92bfec22002f4fbf423b8fa771d1f7e7227f0195f" +checksum = "914aacebfbc22da7772f5ecb6f79b39901dc4061121598bd4383a590a7506ebb" dependencies = [ "log", ] @@ -5183,6 +5211,12 @@ name = "polkavm-common" version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a19805789e7bf778ac5855f6fe9350353f6a1697c2aab9bfb6fc7c831be54fad" + +[[package]] +name = "polkavm-common" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f634b46a6a47a5de381f56d1d8cced9f8640d063b2b1a44b0da6dbef91bbd400" dependencies = [ "blake3", "log", @@ -5212,6 +5246,15 @@ dependencies = [ "polkavm-derive-impl-macro 0.27.0", ] +[[package]] +name = "polkavm-derive" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ba6256c003853b6adb5dc8394e0e1882a9545ee3bec4e4ce533e7e4f488825" +dependencies = [ + "polkavm-derive-impl-macro 0.29.0", +] + [[package]] name = "polkavm-derive-impl" version = "0.26.0" @@ -5236,6 +5279,18 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "polkavm-derive-impl" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90751404f08622c8a671695605cfc1bd83ec091339bd3258a37acc7a931c8741" +dependencies = [ + "polkavm-common 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "polkavm-derive-impl-macro" version = "0.26.0" @@ -5256,18 +5311,28 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10e463de593b485c8685d42737aae81c24005dba967deaaaccbb6f3e936d8596" +dependencies = [ + "polkavm-derive-impl 0.29.0", + "syn 2.0.106", +] + [[package]] name = "polkavm-linker" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fe3704d21e96c5d1e6a1b1a43ac57f9dce110d3331fbf8299e9f57d5884066" +checksum = "43e01613e9e3e4ebd624aa3a11f1775a5c90b881200c50e054fe13c3ba451f98" dependencies = [ "dirs", "gimli 0.31.1", "hashbrown 0.14.5", "log", "object 0.36.7", - "polkavm-common 0.27.0", + "polkavm-common 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", "regalloc2", "rustc-demangle", ] @@ -5282,16 +5347,16 @@ dependencies = [ "hashbrown 0.14.5", "log", "object 0.36.7", - "polkavm-common 0.29.0", + "polkavm-common 0.29.0 (git+https://github.com/paritytech/polkavm.git)", "regalloc2", "rustc-demangle", ] [[package]] name = "polkavm-linux-raw" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "061088785efd93e4367faf12f341bb356208c06bab43aa942d472068af80d1c4" +checksum = "751fbbcf86635834dd9a700039c74ce8c7871b317acc84582d9667dad2ed9848" [[package]] name = "polling" @@ -7080,7 +7145,7 @@ dependencies = [ [[package]] name = "sp-api" version = "26.0.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "docify", "hash-db", @@ -7088,13 +7153,13 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api-proc-macro 15.0.0", - "sp-core 28.0.0", - "sp-externalities 0.25.0", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-externalities 0.25.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "sp-metadata-ir 0.6.0", "sp-runtime 31.0.1", - "sp-runtime-interface 24.0.0", - "sp-state-machine 0.35.0", - "sp-trie 29.0.0", + "sp-runtime-interface 24.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-state-machine 0.35.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-trie 29.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "sp-version 29.0.0", "thiserror 1.0.69", ] @@ -7125,7 +7190,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "15.0.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "Inflector", "blake2", @@ -7154,13 +7219,13 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "30.0.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 28.0.0", - "sp-io 30.0.0", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-io 30.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", ] [[package]] @@ -7176,6 +7241,20 @@ dependencies = [ "sp-io 42.0.0", ] +[[package]] +name = "sp-arithmetic" +version = "23.0.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" +dependencies = [ + "docify", + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "static_assertions", +] + [[package]] name = "sp-arithmetic" version = "23.0.0" @@ -7208,7 +7287,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.32.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "async-trait", "parity-scale-codec", @@ -7224,7 +7303,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.32.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "async-trait", "parity-scale-codec", @@ -7233,7 +7312,7 @@ dependencies = [ "sp-api 26.0.0", "sp-application-crypto 30.0.0", "sp-consensus-slots", - "sp-core 28.0.0", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "sp-inherents 26.0.0", "sp-runtime 31.0.1", "sp-timestamp", @@ -7242,7 +7321,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.32.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "parity-scale-codec", "scale-info", @@ -7250,6 +7329,53 @@ dependencies = [ "sp-timestamp", ] +[[package]] +name = "sp-core" +version = "28.0.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" +dependencies = [ + "ark-vrf", + "array-bytes", + "bip39", + "bitflags 1.3.2", + "blake2", + "bounded-collections", + "bs58", + "dyn-clone", + "ed25519-zebra", + "futures", + "hash-db", + "hash256-std-hasher", + "impl-serde", + "itertools 0.11.0", + "k256", + "libsecp256k1", + "log", + "merlin", + "parity-scale-codec", + "parking_lot", + "paste", + "primitive-types 0.13.1", + "rand 0.8.5", + "scale-info", + "schnorrkel", + "secp256k1 0.28.2", + "secrecy 0.8.0", + "serde", + "sha2 0.10.9", + "sp-crypto-hashing 0.1.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-debug-derive 14.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-externalities 0.25.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-std 14.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-storage 19.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "ss58-registry", + "substrate-bip39 0.4.7 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "thiserror 1.0.69", + "tracing", + "w3f-bls", + "zeroize", +] + [[package]] name = "sp-core" version = "28.0.0" @@ -7286,11 +7412,11 @@ dependencies = [ "sha2 0.10.9", "sp-crypto-hashing 0.1.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", "sp-debug-derive 14.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", - "sp-externalities 0.25.0", + "sp-externalities 0.25.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", "sp-std 14.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", - "sp-storage 19.0.0", + "sp-storage 19.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", "ss58-registry", - "substrate-bip39 0.4.7", + "substrate-bip39 0.4.7 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", "thiserror 1.0.69", "tracing", "w3f-bls", @@ -7359,6 +7485,19 @@ dependencies = [ "twox-hash 1.6.3", ] +[[package]] +name = "sp-crypto-hashing" +version = "0.1.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" +dependencies = [ + "blake2b_simd", + "byteorder", + "digest 0.10.7", + "sha2 0.10.9", + "sha3", + "twox-hash 1.6.3", +] + [[package]] name = "sp-crypto-hashing" version = "0.1.0" @@ -7386,10 +7525,10 @@ dependencies = [ [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.1.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "quote", - "sp-crypto-hashing 0.1.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "syn 2.0.106", ] @@ -7404,6 +7543,16 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "sp-debug-derive" +version = "14.0.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "sp-debug-derive" version = "14.0.0" @@ -7414,6 +7563,16 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "sp-externalities" +version = "0.25.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-storage 19.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", +] + [[package]] name = "sp-externalities" version = "0.25.0" @@ -7421,7 +7580,7 @@ source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea717 dependencies = [ "environmental", "parity-scale-codec", - "sp-storage 19.0.0", + "sp-storage 19.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", ] [[package]] @@ -7438,7 +7597,7 @@ dependencies = [ [[package]] name = "sp-genesis-builder" version = "0.8.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "parity-scale-codec", "scale-info", @@ -7463,7 +7622,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "26.0.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -7487,6 +7646,32 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "sp-io" +version = "30.0.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" +dependencies = [ + "bytes", + "docify", + "ed25519-dalek", + "libsecp256k1", + "log", + "parity-scale-codec", + "polkavm-derive 0.26.0", + "rustversion", + "secp256k1 0.28.2", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-crypto-hashing 0.1.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-externalities 0.25.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-keystore 0.34.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-runtime-interface 24.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-state-machine 0.35.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-tracing 16.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-trie 29.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "tracing", + "tracing-core", +] + [[package]] name = "sp-io" version = "30.0.0" @@ -7501,14 +7686,14 @@ dependencies = [ "polkavm-derive 0.26.0", "rustversion", "secp256k1 0.28.2", - "sp-core 28.0.0", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", "sp-crypto-hashing 0.1.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", - "sp-externalities 0.25.0", - "sp-keystore 0.34.0", - "sp-runtime-interface 24.0.0", - "sp-state-machine 0.35.0", - "sp-tracing 16.0.0", - "sp-trie 29.0.0", + "sp-externalities 0.25.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-keystore 0.34.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-runtime-interface 24.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-state-machine 0.35.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-tracing 16.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-trie 29.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", "tracing", "tracing-core", ] @@ -7551,6 +7736,17 @@ dependencies = [ "strum", ] +[[package]] +name = "sp-keystore" +version = "0.34.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" +dependencies = [ + "parity-scale-codec", + "parking_lot", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-externalities 0.25.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", +] + [[package]] name = "sp-keystore" version = "0.34.0" @@ -7558,8 +7754,8 @@ source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea717 dependencies = [ "parity-scale-codec", "parking_lot", - "sp-core 28.0.0", - "sp-externalities 0.25.0", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-externalities 0.25.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", ] [[package]] @@ -7577,7 +7773,7 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.6.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -7595,6 +7791,15 @@ dependencies = [ "scale-info", ] +[[package]] +name = "sp-panic-handler" +version = "13.0.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" +dependencies = [ + "backtrace", + "regex", +] + [[package]] name = "sp-panic-handler" version = "13.0.0" @@ -7617,7 +7822,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "31.0.1" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "binary-merkle-tree 13.0.0", "docify", @@ -7633,12 +7838,12 @@ dependencies = [ "serde", "simple-mermaid", "sp-application-crypto 30.0.0", - "sp-arithmetic 23.0.0", - "sp-core 28.0.0", - "sp-io 30.0.0", - "sp-std 14.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", - "sp-trie 29.0.0", - "sp-weights 27.0.0", + "sp-arithmetic 23.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-io 30.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-std 14.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-trie 29.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-weights 27.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "tracing", "tuplex", ] @@ -7673,6 +7878,24 @@ dependencies = [ "tuplex", ] +[[package]] +name = "sp-runtime-interface" +version = "24.0.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "polkavm-derive 0.26.0", + "sp-externalities 0.25.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-runtime-interface-proc-macro 17.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-std 14.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-storage 19.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-tracing 16.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-wasm-interface 20.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "static_assertions", +] + [[package]] name = "sp-runtime-interface" version = "24.0.0" @@ -7682,12 +7905,12 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "polkavm-derive 0.26.0", - "sp-externalities 0.25.0", - "sp-runtime-interface-proc-macro 17.0.0", + "sp-externalities 0.25.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-runtime-interface-proc-macro 17.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", "sp-std 14.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", - "sp-storage 19.0.0", - "sp-tracing 16.0.0", - "sp-wasm-interface 20.0.0", + "sp-storage 19.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-tracing 16.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-wasm-interface 20.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", "static_assertions", ] @@ -7711,6 +7934,19 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "17.0.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" +dependencies = [ + "Inflector", + "expander", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "sp-runtime-interface-proc-macro" version = "17.0.0" @@ -7741,13 +7977,13 @@ dependencies = [ [[package]] name = "sp-staking" version = "26.0.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", "serde", - "sp-core 28.0.0", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "sp-runtime 31.0.1", ] @@ -7765,6 +8001,26 @@ dependencies = [ "sp-runtime 43.0.0", ] +[[package]] +name = "sp-state-machine" +version = "0.35.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "parking_lot", + "rand 0.8.5", + "smallvec", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-externalities 0.25.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-panic-handler 13.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-trie 29.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "thiserror 1.0.69", + "tracing", + "trie-db", +] + [[package]] name = "sp-state-machine" version = "0.35.0" @@ -7776,10 +8032,10 @@ dependencies = [ "parking_lot", "rand 0.8.5", "smallvec", - "sp-core 28.0.0", - "sp-externalities 0.25.0", - "sp-panic-handler 13.0.0", - "sp-trie 29.0.0", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-externalities 0.25.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-panic-handler 13.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-trie 29.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", "thiserror 1.0.69", "tracing", "trie-db", @@ -7812,11 +8068,28 @@ version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" +[[package]] +name = "sp-std" +version = "14.0.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" + [[package]] name = "sp-std" version = "14.0.0" source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +[[package]] +name = "sp-storage" +version = "19.0.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive 14.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", +] + [[package]] name = "sp-storage" version = "19.0.0" @@ -7845,7 +8118,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "26.0.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "async-trait", "parity-scale-codec", @@ -7854,6 +8127,18 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "sp-tracing" +version = "16.0.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" +dependencies = [ + "parity-scale-codec", + "regex", + "tracing", + "tracing-core", + "tracing-subscriber 0.3.20", +] + [[package]] name = "sp-tracing" version = "16.0.0" @@ -7879,6 +8164,31 @@ dependencies = [ "tracing-subscriber 0.3.20", ] +[[package]] +name = "sp-trie" +version = "29.0.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" +dependencies = [ + "ahash", + "foldhash 0.1.5", + "hash-db", + "hashbrown 0.15.5", + "memory-db", + "nohash-hasher", + "parity-scale-codec", + "parking_lot", + "rand 0.8.5", + "scale-info", + "schnellru", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-externalities 0.25.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "substrate-prometheus-endpoint 0.17.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "thiserror 1.0.69", + "tracing", + "trie-db", + "trie-root", +] + [[package]] name = "sp-trie" version = "29.0.0" @@ -7895,9 +8205,9 @@ dependencies = [ "rand 0.8.5", "scale-info", "schnellru", - "sp-core 28.0.0", - "sp-externalities 0.25.0", - "substrate-prometheus-endpoint 0.17.0", + "sp-core 28.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-externalities 0.25.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "substrate-prometheus-endpoint 0.17.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", "thiserror 1.0.69", "tracing", "trie-db", @@ -7933,16 +8243,16 @@ dependencies = [ [[package]] name = "sp-version" version = "29.0.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "impl-serde", "parity-scale-codec", "parity-wasm", "scale-info", "serde", - "sp-crypto-hashing-proc-macro 0.1.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-crypto-hashing-proc-macro 0.1.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "sp-runtime 31.0.1", - "sp-std 14.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", + "sp-std 14.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", "sp-version-proc-macro 13.0.0", "thiserror 1.0.69", ] @@ -7968,7 +8278,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "13.0.0" -source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1#a71ec19a94702ea71767ba5ac97603ea6c6305c1" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" dependencies = [ "parity-scale-codec", "proc-macro-warning", @@ -7990,6 +8300,17 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "sp-wasm-interface" +version = "20.0.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" +dependencies = [ + "anyhow", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", +] + [[package]] name = "sp-wasm-interface" version = "20.0.0" @@ -8013,6 +8334,20 @@ dependencies = [ "parity-scale-codec", ] +[[package]] +name = "sp-weights" +version = "27.0.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" +dependencies = [ + "bounded-collections", + "parity-scale-codec", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic 23.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", + "sp-debug-derive 14.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce)", +] + [[package]] name = "sp-weights" version = "27.0.0" @@ -8023,7 +8358,7 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-arithmetic 23.0.0", + "sp-arithmetic 23.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", "sp-debug-derive 14.0.0 (git+https://github.com/use-ink/polkadot-sdk.git?rev=a71ec19a94702ea71767ba5ac97603ea6c6305c1)", ] @@ -8135,6 +8470,18 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "substrate-bip39" +version = "0.4.7" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" +dependencies = [ + "hmac 0.12.1", + "pbkdf2", + "schnorrkel", + "sha2 0.10.9", + "zeroize", +] + [[package]] name = "substrate-bip39" version = "0.4.7" @@ -8173,6 +8520,20 @@ dependencies = [ "rustc-hex", ] +[[package]] +name = "substrate-prometheus-endpoint" +version = "0.17.0" +source = "git+https://github.com/use-ink/polkadot-sdk.git?rev=1b1cef306d9ceebf963fd15a04b5c79ee2618bce#1b1cef306d9ceebf963fd15a04b5c79ee2618bce" +dependencies = [ + "http-body-util", + "hyper", + "hyper-util", + "log", + "prometheus", + "thiserror 1.0.69", + "tokio", +] + [[package]] name = "substrate-prometheus-endpoint" version = "0.17.0" diff --git a/Cargo.toml b/Cargo.toml index fe8a791eab4..00f989ad072 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,7 +64,7 @@ scale-info = { version = "2.11", default-features = false } schemars = { version = "0.8" } secp256k1 = { version = "0.30.0" } serde = { version = "1.0.215", default-features = false } -serde_json = { version = "1.0.137" } +serde_json = { version = "1.0.145" } sha2 = { version = "0.10" } sha3 = { version = "0.10" } static_assertions = { version = "1.1" } diff --git a/crates/e2e/src/backend.rs b/crates/e2e/src/backend.rs index 958c7d8c304..ddb58932af5 100644 --- a/crates/e2e/src/backend.rs +++ b/crates/e2e/src/backend.rs @@ -17,7 +17,6 @@ use ink_env::{ call::utils::DecodeMessageResult, }; use ink_primitives::{ - DepositLimit, H160, abi::AbiEncodeWith, }; @@ -242,8 +241,8 @@ pub trait ContractsBackend { #[async_trait] pub trait BuilderClient: ContractsBackend { - /// Executes a bare `call` for the contract at `account_id`. This function does not - /// perform a dry-run, and the user is expected to provide the gas limit. + /// Executes a bare `call` for the contract at `account_id`. This function does + /// _not_ perform a dry-run, and the user is expected to provide the gas limit. /// /// Use it when you want to have a more precise control over submitting extrinsic. /// @@ -259,7 +258,7 @@ pub trait BuilderClient: ContractsBackend { message: &CallBuilderFinal, value: E::Balance, gas_limit: Weight, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: E::Balance, ) -> Result<(Self::EventLog, Option), Self::Error> where CallBuilderFinal: Clone; @@ -282,7 +281,7 @@ pub trait BuilderClient: ContractsBackend { caller: &Keypair, message: &CallBuilderFinal, value: E::Balance, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: Option, ) -> Result, Self::Error> where CallBuilderFinal: Clone; @@ -304,7 +303,7 @@ pub trait BuilderClient: ContractsBackend { dest: H160, input_data: Vec, value: E::Balance, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: Option, signer: &Keypair, ) -> Result, Self::Error>; @@ -318,7 +317,7 @@ pub trait BuilderClient: ContractsBackend { input_data: Vec, value: E::Balance, gas_limit: Weight, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: E::Balance, signer: &Keypair, ) -> Result<(Self::EventLog, Option), Self::Error>; @@ -368,7 +367,7 @@ pub trait BuilderClient: ContractsBackend { constructor: &mut CreateBuilderPartial, value: E::Balance, gas_limit: Weight, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: E::Balance, ) -> Result, Self::Error>; async fn raw_instantiate( @@ -378,7 +377,7 @@ pub trait BuilderClient: ContractsBackend { constructor: Vec, value: E::Balance, gas_limit: Weight, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: E::Balance, ) -> Result, Self::Error>; async fn raw_instantiate_dry_run( @@ -387,7 +386,7 @@ pub trait BuilderClient: ContractsBackend { caller: &Keypair, constructor: Vec, value: E::Balance, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: Option, ) -> Result, Self::Error>; async fn exec_instantiate( @@ -417,7 +416,7 @@ pub trait BuilderClient: ContractsBackend { caller: &Keypair, constructor: &mut CreateBuilderPartial, value: E::Balance, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: Option, ) -> Result, Self::Error>; /// Checks if `caller` was already mapped in `pallet-revive`. If not, it will do so diff --git a/crates/e2e/src/backend_calls.rs b/crates/e2e/src/backend_calls.rs index 6c355a3a3d8..5225041f147 100644 --- a/crates/e2e/src/backend_calls.rs +++ b/crates/e2e/src/backend_calls.rs @@ -18,17 +18,12 @@ use ink_env::{ Environment, call::utils::DecodeMessageResult, }; -use ink_primitives::{ - DepositLimit, - abi::AbiEncodeWith, -}; +use ink_primitives::abi::AbiEncodeWith; use sp_weights::Weight; use super::{ InstantiateDryRunResult, Keypair, - balance_to_deposit_limit, - balance_to_deposit_limit_dry_run, }; use crate::{ CallBuilderFinal, @@ -152,7 +147,7 @@ where self.caller, self.message, self.value, - balance_to_deposit_limit_dry_run::(self.storage_deposit_limit), + self.storage_deposit_limit, ) .await?; @@ -171,8 +166,7 @@ where self.message, self.value, gas_limit, - // todo: the `bare_call` converts this value back, this is unnecessary work - DepositLimit::Balance(dry_run.exec_result.storage_deposit.charge_or_zero()), + dry_run.exec_result.storage_deposit.charge_or_zero(), ) .await?; @@ -193,7 +187,7 @@ where self.caller, self.message, self.value, - balance_to_deposit_limit_dry_run::(self.storage_deposit_limit), + self.storage_deposit_limit, ) .await } @@ -214,7 +208,7 @@ where value: E::Balance, extra_gas_portion: Option, gas_limit: Option, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: Option, } impl<'a, E, Contract, Args, R, B, Abi> @@ -244,7 +238,7 @@ where value: 0u32.into(), extra_gas_portion: None, gas_limit: None, - storage_deposit_limit: DepositLimit::UnsafeOnlyForDryRun, + storage_deposit_limit: None, } } @@ -287,9 +281,11 @@ where } /// Specify the max amount of funds that can be charged for storage. + /// + /// *Important*: `None` means charging the maximum! pub fn storage_deposit_limit( &mut self, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: Option, ) -> &mut Self { self.storage_deposit_limit = storage_deposit_limit; self @@ -331,9 +327,7 @@ where self.constructor, self.value, gas_limit, - balance_to_deposit_limit::(Some( - dry_run.contract_result.storage_deposit.charge_or_zero(), - )), + dry_run.contract_result.storage_deposit.charge_or_zero(), ) .await?; diff --git a/crates/e2e/src/lib.rs b/crates/e2e/src/lib.rs index 9c503939d83..534ef5ca2e5 100644 --- a/crates/e2e/src/lib.rs +++ b/crates/e2e/src/lib.rs @@ -97,7 +97,6 @@ use ink_env::{ }; use ink_primitives::{ Address, - DepositLimit, H256, types::AccountIdMapper, }; @@ -207,45 +206,3 @@ where { <::Type as FromAddr>::from_addr(acc_id) } - -/// Transforms `Option<::Balance>>` into `DepositLimit`. -/// -/// This function must only be used for dry-runs, a `None` will -/// become an unrestricted deposit limit (`DepositLimit::UnsafeOnlyForDryRun`). -fn balance_to_deposit_limit_dry_run( - b: Option<::Balance>, -) -> DepositLimit<::Balance> { - match b { - Some(v) => DepositLimit::Balance(v), - None => DepositLimit::UnsafeOnlyForDryRun, - } -} - -/// Transforms `Option<::Balance>>` into `DepositLimit`. -/// This function must be used for submitting extrinsics on-chain. -/// -/// Panics if `limit` is `None`. Make sure to execute a dry-run -/// beforehand and use the `storage_deposit_limit` result of it here. -fn balance_to_deposit_limit( - limit: Option<::Balance>, -) -> DepositLimit<::Balance> { - match limit { - Some(val) => DepositLimit::Balance(val), - None => panic!("Deposit limit must be specified for on-chain submissions."), - } -} - -/// Transforms `DepositLimit<::Balance>` into `::Balance>`. -/// -/// Panics if `limit` is unrestricted (`DepositLimit::UnsafeOnlyForDryRun`). -fn deposit_limit_to_balance( - limit: DepositLimit<::Balance>, -) -> ::Balance { - match limit { - DepositLimit::Balance(val) => val, - DepositLimit::UnsafeOnlyForDryRun => { - panic!("Unrestricted deposit limit not allowed for balance conversion!") - } - } -} diff --git a/crates/e2e/src/subxt_client.rs b/crates/e2e/src/subxt_client.rs index 8e48a4ef66d..10fd5f4f734 100644 --- a/crates/e2e/src/subxt_client.rs +++ b/crates/e2e/src/subxt_client.rs @@ -25,7 +25,6 @@ use super::{ CreateBuilderPartial, constructor_exec_input, }, - deposit_limit_to_balance, events::{ CodeStoredEvent, EventWithTopics, @@ -69,10 +68,7 @@ use ink_env::{ }, }, }; -use ink_primitives::{ - DepositLimit, - abi::AbiEncodeWith, -}; +use ink_primitives::abi::AbiEncodeWith; use ink_revive_types::evm::CallTrace; use jsonrpsee::core::async_trait; use scale::{ @@ -530,7 +526,7 @@ where constructor: &mut CreateBuilderPartial, value: E::Balance, gas_limit: Weight, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: E::Balance, ) -> Result, Self::Error> { let data = constructor_exec_input(constructor.clone()); let ret = self @@ -546,9 +542,8 @@ where constructor: Vec, value: E::Balance, gas_limit: Weight, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: E::Balance, ) -> Result, Self::Error> { - let storage_deposit_limit = deposit_limit_to_balance::(storage_deposit_limit); let (events, trace) = self .api .instantiate_with_code( @@ -618,15 +613,8 @@ where storage_deposit_limit: E::Balance, ) -> Result, Self::Error> { let code = self.contracts.load_code(contract_name); - self.raw_instantiate( - code, - signer, - data, - value, - gas_limit, - DepositLimit::Balance(storage_deposit_limit), - ) - .await + self.raw_instantiate(code, signer, data, value, gas_limit, storage_deposit_limit) + .await } /// Important: For an uncomplicated UX of the E2E testing environment we @@ -644,7 +632,7 @@ where caller: &Keypair, constructor: &mut CreateBuilderPartial, value: E::Balance, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: Option, ) -> Result, Self::Error> { let code = self.contracts.load_code(contract_name); let data = constructor_exec_input(constructor.clone()); @@ -662,7 +650,7 @@ where caller: &Keypair, data: Vec, value: E::Balance, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: Option, ) -> Result, Self::Error> { // There's a side effect here! let _ = self.map_account(caller).await; @@ -749,7 +737,7 @@ where message: &CallBuilderFinal, value: E::Balance, gas_limit: Weight, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: E::Balance, ) -> Result<(Self::EventLog, Option), Self::Error> where CallBuilderFinal: Clone, @@ -774,7 +762,7 @@ where input_data: Vec, value: E::Balance, gas_limit: Weight, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: E::Balance, signer: &Keypair, ) -> Result<(Self::EventLog, Option), Self::Error> { let (tx_events, trace) = self @@ -783,7 +771,7 @@ where dest, value, gas_limit.into(), - deposit_limit_to_balance::(storage_deposit_limit), + storage_deposit_limit, input_data, signer, ) @@ -801,7 +789,7 @@ where .map_err(|e| Error::Decoding(e.to_string()))?; log_error(&format!( "Attempt to stringify returned data: {:?}", - String::from_utf8_lossy(&trace.clone().unwrap().output[..]) + String::from_utf8_lossy(&trace.clone().unwrap().output.0[..]) )); log_error(&format!( "extrinsic for `raw_call` failed: {dispatch_error} {trace:?}" @@ -828,7 +816,7 @@ where caller: &Keypair, message: &CallBuilderFinal, value: E::Balance, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: Option, ) -> Result, Self::Error> where CallBuilderFinal: Clone, @@ -872,7 +860,7 @@ where dest: H160, input_data: Vec, value: E::Balance, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: Option, signer: &Keypair, ) -> Result, Self::Error> { let (exec_result, trace) = self diff --git a/crates/e2e/src/xts.rs b/crates/e2e/src/xts.rs index 0e9e488e83b..5a75b9b91c1 100644 --- a/crates/e2e/src/xts.rs +++ b/crates/e2e/src/xts.rs @@ -25,10 +25,7 @@ use crate::contract_results::{ }; use core::marker::PhantomData; use funty::Fundamental; -use ink_primitives::{ - Address, - DepositLimit, -}; +use ink_primitives::Address; use ink_revive_types::{ CodeUploadResult, evm::{ @@ -200,7 +197,7 @@ struct RpcCallRequest { dest: Address, value: E::Balance, gas_limit: Option, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: Option, input_data: Vec, } @@ -272,17 +269,13 @@ where pub async fn instantiate_with_code_dry_run( &self, value: E::Balance, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: Option, code: Vec, data: Vec, salt: Option<[u8; 32]>, signer: &Keypair, ) -> ContractInstantiateResultFor { let code = Code::Upload(code); - let storage_deposit_limit = match storage_deposit_limit { - DepositLimit::Balance(v) => Some(v), - DepositLimit::UnsafeOnlyForDryRun => None, - }; let call_request = RpcInstantiateRequest:: { origin: Signer::::account_id(signer), value, @@ -618,7 +611,7 @@ where dest: Address, data: Vec, value: E::Balance, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: Option, signer: &Keypair, ) -> (ContractExecResultFor, Option) { let origin = Signer::::account_id(signer); @@ -651,10 +644,8 @@ where // we still take the return value of the dry run for submitting the extrinsic // that will take effect. let storage_deposit_limit = match storage_deposit_limit { - DepositLimit::UnsafeOnlyForDryRun => { - dry_run_result.storage_deposit.charge_or_zero() - } - DepositLimit::Balance(limit) => limit, + None => dry_run_result.storage_deposit.charge_or_zero(), + Some(limit) => limit, }; let call = subxt::tx::DefaultPayload::new( diff --git a/crates/env/src/engine/on_chain/pallet_revive.rs b/crates/env/src/engine/on_chain/pallet_revive.rs index f8ba30c07fa..e153bc8ad41 100644 --- a/crates/env/src/engine/on_chain/pallet_revive.rs +++ b/crates/env/src/engine/on_chain/pallet_revive.rs @@ -470,12 +470,13 @@ impl EnvInstance { fn call_bool_precompile(selector: [u8; 4], output: &mut [u8]) -> bool { debug_assert_eq!(output.len(), 32); const ADDR: [u8; 20] = hex_literal::hex!("0000000000000000000000000000000000000900"); - let _ = ext::delegate_call( + let _ = ext::call( CallFlags::empty(), &ADDR, u64::MAX, // `ref_time` to devote for execution. `u64::MAX` = all u64::MAX, // `proof_size` to devote for execution. `u64::MAX` = all &[u8::MAX; 32], // No deposit limit. + &U256::zero().to_little_endian(), // Value transferred to the contract. &selector[..], Some(&mut &mut output[..]), ) @@ -964,12 +965,13 @@ impl TypedEnvBackend for EnvInstance { const ADDR: [u8; 20] = hex_literal::hex!("0000000000000000000000000000000000000900"); - let _ = ext::delegate_call( + let _ = ext::call( CallFlags::empty(), &ADDR, u64::MAX, // `ref_time` to devote for execution. `u64::MAX` = all u64::MAX, // `proof_size` to devote for execution. `u64::MAX` = all &[u8::MAX; 32], // No deposit limit. + &U256::zero().to_little_endian(), // Value transferred to the contract. &selector[..], Some(&mut &mut output[..]), ) @@ -1256,12 +1258,13 @@ impl TypedEnvBackend for EnvInstance { const ADDR: [u8; 20] = hex_literal::hex!("0000000000000000000000000000000000000900"); - let call_result = ext::delegate_call( + let call_result = ext::call( CallFlags::empty(), &ADDR, u64::MAX, // `ref_time` to devote for execution. `u64::MAX` = all u64::MAX, // `proof_size` to devote for execution. `u64::MAX` = all &[u8::MAX; 32], // No deposit limit. + &U256::zero().to_little_endian(), // Value transferred to the contract. &sel[..], Some(&mut &mut output[..]), ); diff --git a/crates/primitives/src/lib.rs b/crates/primitives/src/lib.rs index ffedbe19db4..7ca9c5e9532 100644 --- a/crates/primitives/src/lib.rs +++ b/crates/primitives/src/lib.rs @@ -54,7 +54,6 @@ pub use self::{ AccountIdMapper, Address, Clear, - DepositLimit, Hash, }, }; diff --git a/crates/primitives/src/types.rs b/crates/primitives/src/types.rs index 2a033c7c77b..86a890adb49 100644 --- a/crates/primitives/src/types.rs +++ b/crates/primitives/src/types.rs @@ -207,30 +207,6 @@ impl Clear for Hash { // } // } -#[derive(Debug, Clone, Eq, PartialEq, Encode, Decode)] -#[cfg_attr( - feature = "std", - derive( - scale_info::TypeInfo, - EncodeAsType, - serde::Serialize, - serde::Deserialize - ) -)] -pub enum DepositLimit { - /// Allows bypassing all balance transfer checks. - UnsafeOnlyForDryRun, - - /// Specifies a maximum allowable balance for a deposit. - Balance(Balance), -} - -impl From for DepositLimit { - fn from(value: T) -> Self { - Self::Balance(value) - } -} - /// Allows to instantiate a type from its little-endian bytes representation. pub trait FromLittleEndian { /// The little-endian bytes representation. diff --git a/crates/revive-types/Cargo.toml b/crates/revive-types/Cargo.toml index b4adf252d7b..4083343b727 100644 --- a/crates/revive-types/Cargo.toml +++ b/crates/revive-types/Cargo.toml @@ -23,6 +23,9 @@ sp-runtime = { workspace = true } pallet-revive-uapi = { workspace = true, features = ["scale"] } alloy-core = { workspace = true, features = ["sol-types"] } +[dev-dependencies] +serde_json = { workspace = true } + [features] default = ["std"] std = [ diff --git a/crates/revive-types/src/byte.rs b/crates/revive-types/src/byte.rs new file mode 100644 index 00000000000..33396ee7b37 --- /dev/null +++ b/crates/revive-types/src/byte.rs @@ -0,0 +1,118 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//! Define Byte wrapper types for encoding and decoding hex strings + +use crate::hex_serde::HexCodec; +use alloc::{ + vec, + vec::Vec, +}; +use alloy_core::hex; +use core::{ + fmt::{ + Debug, + Display, + Formatter, + Result as FmtResult, + }, + str::FromStr, +}; +use scale::{ + Decode, + Encode, +}; +use scale_info::TypeInfo; +use serde::{ + Deserialize, + Serialize, +}; + +impl FromStr for Bytes { + type Err = hex::FromHexError; + fn from_str(s: &str) -> Result { + let data = hex::decode(s.trim_start_matches("0x"))?; + Ok(Bytes(data)) + } +} + +macro_rules! impl_hex { + ($type:ident, $inner:ty, $default:expr) => { + #[derive(Encode, Decode, Eq, PartialEq, Ord, PartialOrd, TypeInfo, Clone, Serialize, Deserialize, Hash)] + #[doc = concat!("`", stringify!($inner), "`", " wrapper type for encoding and decoding hex strings")] + pub struct $type(#[serde(with = "crate::hex_serde")] pub $inner); + + impl Default for $type { + fn default() -> Self { + $type($default) + } + } + + impl From<$inner> for $type { + fn from(inner: $inner) -> Self { + $type(inner) + } + } + + impl Debug for $type { + fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult { + let hex_str = self.0.to_hex(); + let truncated = &hex_str[..hex_str.len().min(100)]; + let ellipsis = if hex_str.len() > 100 { "..." } else { "" }; + write!(f, concat!(stringify!($type), "({}{})"), truncated,ellipsis) + } + } + + impl Display for $type { + fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult { + write!(f, "{}", self.0.to_hex()) + } + } + }; +} + +impl Bytes { + /// See `Vec::is_empty` + pub fn is_empty(&self) -> bool { + self.0.is_empty() + } +} + +impl_hex!(Byte, u8, 0u8); +impl_hex!(Bytes, Vec, vec![]); +impl_hex!(Bytes8, [u8; 8], [0u8; 8]); +impl_hex!(Bytes32, [u8; 32], [0u8; 32]); +impl_hex!(Bytes256, [u8; 256], [0u8; 256]); + +#[test] +fn serialize_works() { + let a = Byte(42); + let s = serde_json::to_string(&a).unwrap(); + assert_eq!(s, "\"0x2a\""); + let b = serde_json::from_str::(&s).unwrap(); + assert_eq!(a, b); + + let a = Bytes(b"bello world".to_vec()); + let s = serde_json::to_string(&a).unwrap(); + assert_eq!(s, "\"0x62656c6c6f20776f726c64\""); + let b = serde_json::from_str::(&s).unwrap(); + assert_eq!(a, b); + + let a = Bytes256([42u8; 256]); + let s = serde_json::to_string(&a).unwrap(); + let b = serde_json::from_str::(&s).unwrap(); + assert_eq!(a, b); +} diff --git a/crates/revive-types/src/evm.rs b/crates/revive-types/src/evm.rs index 77c78ac5bb3..b006b0b42df 100644 --- a/crates/revive-types/src/evm.rs +++ b/crates/revive-types/src/evm.rs @@ -15,6 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +use crate::byte::Bytes; use alloc::{ collections::BTreeMap, string::String, @@ -55,10 +56,10 @@ pub struct CallTrace { /// Address of the receiver. pub to: H160, /// Call input data. - pub input: Vec, + pub input: Bytes, /// Return data. - #[serde(skip_serializing_if = "Vec::is_empty")] - pub output: Vec, + #[serde(skip_serializing_if = "Bytes::is_empty")] + pub output: Bytes, /// The error message if the call failed. #[serde(skip_serializing_if = "Option::is_none")] pub error: Option, @@ -77,6 +78,9 @@ pub struct CallTrace { /// Type of call. #[serde(rename = "type")] pub call_type: CallType, + /// Number of child calls entered (for log position calculation) + #[serde(skip)] + pub child_call_count: u32, } /// A log emitted during a call. diff --git a/crates/revive-types/src/lib.rs b/crates/revive-types/src/lib.rs index dde5d22af58..80098c002b1 100644 --- a/crates/revive-types/src/lib.rs +++ b/crates/revive-types/src/lib.rs @@ -15,14 +15,18 @@ #![cfg_attr(not(feature = "std"), no_std)] extern crate alloc; +mod byte; pub mod evm; mod hex_serde; mod primitives; +pub use byte::Bytes; + pub use primitives::{ CodeUploadResult, CodeUploadReturnValue, ContractResult, + ExecConfig, ExecReturnValue, InstantiateReturnValue, StorageDeposit, diff --git a/crates/revive-types/src/primitives.rs b/crates/revive-types/src/primitives.rs index 1b41461f70f..b5e4f023275 100644 --- a/crates/revive-types/src/primitives.rs +++ b/crates/revive-types/src/primitives.rs @@ -21,6 +21,7 @@ use alloc::vec::Vec; use ink_primitives::{ H160, H256, + U256, Weight, }; use pallet_revive_uapi::ReturnFlags; @@ -227,3 +228,33 @@ pub struct CodeUploadReturnValue { /// Result type of a `bare_code_upload` call. pub type CodeUploadResult = Result, DispatchError>; + +/// `Stack` wide configuration options. +#[derive(Debug, Clone)] +pub struct ExecConfig { + /// Indicates whether the account nonce should be incremented after instantiating a + /// new contract. + /// + /// In Substrate, where transactions can be batched, the account's nonce should be + /// incremented after each instantiation, ensuring that each instantiation uses a + /// unique nonce. + /// + /// For transactions sent from Ethereum wallets, which cannot be batched, the nonce + /// should only be incremented once. In these cases, set this to `false` to + /// suppress an extra nonce increment. + /// + /// Note: + /// The origin's nonce is already incremented pre-dispatch by the `CheckNonce` + /// transaction extension. + /// + /// This does not apply to contract initiated instantiations. Those will always bump + /// the instantiating contract's nonce. + pub bump_nonce: bool, + /// Whether deposits will be withdrawn from the pallet_transaction_payment credit + /// (true) or free balance (false). + pub collect_deposit_from_hold: bool, + /// The gas price that was chosen for this transaction. + /// + /// It is determined when transforming `eth_transact` into a proper extrinsic. + pub effective_gas_price: Option, +} diff --git a/crates/sandbox/Cargo.toml b/crates/sandbox/Cargo.toml index 55330773734..0bf923cc08e 100644 --- a/crates/sandbox/Cargo.toml +++ b/crates/sandbox/Cargo.toml @@ -12,16 +12,17 @@ homepage.workspace = true [dependencies] sha3 = "0.10.8" frame-metadata = { workspace = true } -frame-system = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "a71ec19a94702ea71767ba5ac97603ea6c6305c1", default-features = false } -frame-support = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "a71ec19a94702ea71767ba5ac97603ea6c6305c1", default-features = false } -pallet-balances = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "a71ec19a94702ea71767ba5ac97603ea6c6305c1", default-features = false } -pallet-revive = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "a71ec19a94702ea71767ba5ac97603ea6c6305c1", default-features = false } -pallet-timestamp = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "a71ec19a94702ea71767ba5ac97603ea6c6305c1", default-features = false } +frame-system = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "1b1cef306d9ceebf963fd15a04b5c79ee2618bce", default-features = false } +frame-support = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "1b1cef306d9ceebf963fd15a04b5c79ee2618bce", default-features = false } +pallet-balances = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "1b1cef306d9ceebf963fd15a04b5c79ee2618bce", default-features = false } +pallet-transaction-payment = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "1b1cef306d9ceebf963fd15a04b5c79ee2618bce", default-features = false } +pallet-revive = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "1b1cef306d9ceebf963fd15a04b5c79ee2618bce", default-features = false } +pallet-timestamp = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "1b1cef306d9ceebf963fd15a04b5c79ee2618bce", default-features = false } scale = { workspace = true } sp-core = { workspace = true, default-features = false } -sp-externalities = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "a71ec19a94702ea71767ba5ac97603ea6c6305c1", default-features = false } +sp-externalities = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "1b1cef306d9ceebf963fd15a04b5c79ee2618bce", default-features = false } sp-runtime = { version = "43.0.0", default-features = false } -sp-io = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "a71ec19a94702ea71767ba5ac97603ea6c6305c1", default-features = false } +sp-io = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "1b1cef306d9ceebf963fd15a04b5c79ee2618bce", default-features = false } ink_primitives = { workspace = true } ink_revive_types = { workspace = true } @@ -47,6 +48,7 @@ std = [ "ink_primitives/std", "ink_revive_types/std", "pallet-balances/std", + "pallet-transaction-payment/std", "pallet-revive/std", "pallet-timestamp/std", "scale/std", diff --git a/crates/sandbox/src/api/revive_api.rs b/crates/sandbox/src/api/revive_api.rs index 09019cc1921..c7a240b9b37 100644 --- a/crates/sandbox/src/api/revive_api.rs +++ b/crates/sandbox/src/api/revive_api.rs @@ -11,19 +11,19 @@ use frame_support::{ sp_runtime::traits::Bounded, traits::{ Time, - fungible::Inspect, + fungible::{ + Inspect, + Mutate, + }, }, weights::Weight, }; use frame_system::pallet_prelude::OriginFor; -use ink_primitives::{ - Address, - DepositLimit, -}; +use ink_primitives::Address; use pallet_revive::{ - BumpNonce, Code, CodeUploadResult, + ExecConfig, evm::{ Tracer, TracerType, @@ -57,6 +57,14 @@ pub trait ContractAPI { #[allow(clippy::type_complexity, clippy::too_many_arguments)] fn map_account(&mut self, account: OriginFor) -> Result<(), DispatchError>; + /// `pallet-revive` uses a dedicated "pallet" account for tracking + /// storage deposits. The static account is returned by the + /// `pallet_revive::Pallet::account_id()` function. + /// + /// This function funds the account with the existential deposit + /// (i.e. minimum balance). + fn warm_up(&mut self); + /// Interface for `bare_instantiate` contract call with a simultaneous upload. /// /// # Arguments @@ -78,7 +86,7 @@ pub trait ContractAPI { salt: Option<[u8; 32]>, origin: OriginFor, gas_limit: Weight, - storage_deposit_limit: DepositLimit>, + storage_deposit_limit: BalanceOf, ) -> ContractResultInstantiate; /// Interface for `bare_instantiate` contract call for a previously uploaded contract. @@ -102,7 +110,7 @@ pub trait ContractAPI { salt: Option<[u8; 32]>, origin: OriginFor, gas_limit: Weight, - storage_deposit_limit: DepositLimit>, + storage_deposit_limit: BalanceOf, ) -> ContractResultInstantiate; /// Interface for `bare_upload_code` contract call. @@ -137,7 +145,7 @@ pub trait ContractAPI { data: Vec, origin: OriginFor, gas_limit: Weight, - storage_deposit_limit: DepositLimit>, + storage_deposit_limit: BalanceOf, ) -> ContractExecResultFor; fn evm_tracer(&mut self, tracer_type: TracerType) -> Tracer; @@ -146,7 +154,7 @@ pub trait ContractAPI { impl ContractAPI for T where T: Sandbox, - T::Runtime: pallet_revive::Config, + T::Runtime: pallet_balances::Config + pallet_revive::Config, BalanceOf: Into + TryFrom + Bounded, MomentOf: Into, <::Runtime as frame_system::Config>::Nonce: Into, @@ -163,6 +171,24 @@ where self.execute_with(|| pallet_revive::Pallet::::map_account(account_id)) } + /// `pallet-revive` uses a dedicated "pallet" account for tracking + /// storage deposits. The static account is returned by the + /// `pallet_revive::Pallet::account_id()` function. + /// + /// This function funds the account with the existential deposit + /// (i.e. minimum balance). + fn warm_up(&mut self) { + self.execute_with(|| { + let acc = pallet_revive::Pallet::::account_id(); + let ed = pallet_balances::Pallet::::minimum_balance(); + + // we only fund the account if need be + if pallet_balances::Pallet::::free_balance(&acc) < ed { + let _ = pallet_balances::Pallet::::mint_into(&acc, ed); + } + }); + } + fn deploy_contract( &mut self, contract_bytes: Vec, @@ -171,9 +197,9 @@ where salt: Option<[u8; 32]>, origin: OriginFor, gas_limit: Weight, - storage_deposit_limit: DepositLimit>, + storage_deposit_limit: BalanceOf, ) -> ContractResultInstantiate { - let storage_deposit_limit = storage_deposit_limit_fn(storage_deposit_limit); + self.warm_up(); self.execute_with(|| { pallet_revive::Pallet::::bare_instantiate( origin, @@ -183,7 +209,11 @@ where Code::Upload(contract_bytes), data, salt, - BumpNonce::Yes, + ExecConfig { + bump_nonce: true, + collect_deposit_from_hold: false, + effective_gas_price: None, + }, ) }) } @@ -196,9 +226,8 @@ where salt: Option<[u8; 32]>, origin: OriginFor, gas_limit: Weight, - storage_deposit_limit: DepositLimit>, + storage_deposit_limit: BalanceOf, ) -> ContractResultInstantiate { - let storage_deposit_limit = storage_deposit_limit_fn(storage_deposit_limit); self.execute_with(|| { pallet_revive::Pallet::::bare_instantiate( origin, @@ -208,7 +237,11 @@ where Code::Existing(code_hash), data, salt, - BumpNonce::Yes, + ExecConfig { + bump_nonce: true, + collect_deposit_from_hold: false, + effective_gas_price: None, + }, ) }) } @@ -235,9 +268,8 @@ where data: Vec, origin: OriginFor, gas_limit: Weight, - storage_deposit_limit: DepositLimit>, + storage_deposit_limit: BalanceOf, ) -> ContractExecResultFor { - let storage_deposit_limit = storage_deposit_limit_fn(storage_deposit_limit); self.execute_with(|| { pallet_revive::Pallet::::bare_call( origin, @@ -246,6 +278,11 @@ where gas_limit, storage_deposit_limit, data, + ExecConfig { + bump_nonce: true, + collect_deposit_from_hold: false, + effective_gas_price: None, + }, ) }) } @@ -255,18 +292,6 @@ where } } -/// todo -fn storage_deposit_limit_fn( - limit: DepositLimit, -) -> pallet_revive::DepositLimit { - match limit { - DepositLimit::UnsafeOnlyForDryRun => { - pallet_revive::DepositLimit::UnsafeOnlyForDryRun - } - DepositLimit::Balance(v) => pallet_revive::DepositLimit::Balance(v), - } -} - /// todo /// Converts bytes to a '\n'-split string, ignoring empty lines. pub fn decode_debug_buffer(buffer: &[u8]) -> Vec { @@ -286,7 +311,7 @@ mod tests { api::prelude::*, }; - const STORAGE_DEPOSIT_LIMIT: DepositLimit = DepositLimit::UnsafeOnlyForDryRun; + const STORAGE_DEPOSIT_LIMIT: u128 = u128::MAX; fn compile_module(contract_name: &str) -> Vec { // todo compile the contract, instead of reading the binary @@ -359,7 +384,7 @@ mod tests { None, origin.clone(), DefaultSandbox::default_gas_limit(), - DepositLimit::Balance(100000000000000), + 100000000000000, ); assert!(result.result.is_ok()); assert!(!result.result.unwrap().result.did_revert()); @@ -372,7 +397,7 @@ mod tests { None, origin, DefaultSandbox::default_gas_limit(), - DepositLimit::Balance(100000000000000), + 100000000000000, ); assert!(result.result.is_err()); let dispatch_err = result.result.unwrap_err(); diff --git a/crates/sandbox/src/client.rs b/crates/sandbox/src/client.rs index abdab4e5689..e62544a288a 100644 --- a/crates/sandbox/src/client.rs +++ b/crates/sandbox/src/client.rs @@ -75,7 +75,6 @@ use ink_env::{ call::utils::DecodeMessageResult, }; use ink_primitives::{ - DepositLimit, H160, H256, U256, @@ -291,15 +290,8 @@ where storage_deposit_limit: E::Balance, ) -> Result, Self::Error> { let code = self.contracts.load_code(contract_name); - self.raw_instantiate( - code, - signer, - data, - value, - gas_limit, - DepositLimit::Balance(storage_deposit_limit), - ) - .await + self.raw_instantiate(code, signer, data, value, gas_limit, storage_deposit_limit) + .await } async fn bare_instantiate< @@ -314,7 +306,7 @@ where constructor: &mut CreateBuilderPartial, value: E::Balance, gas_limit: Weight, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: E::Balance, ) -> Result, Self::Error> { let data = constructor_exec_input(constructor.clone()); self.raw_instantiate(code, caller, data, value, gas_limit, storage_deposit_limit) @@ -328,7 +320,7 @@ where data: Vec, value: E::Balance, gas_limit: Weight, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: E::Balance, ) -> Result, Self::Error> { let _ = as BuilderClient>::map_account(self, caller).await; @@ -401,7 +393,7 @@ where caller: &Keypair, constructor: &mut CreateBuilderPartial, value: E::Balance, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: Option, ) -> Result, Self::Error> { let code = self.contracts.load_code(contract_name); let exec_input = constructor.clone().params().exec_input().encode(); @@ -425,7 +417,7 @@ where caller: &Keypair, data: Vec, value: E::Balance, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: Option, ) -> Result, Self::Error> { // There's a side effect here! let _ = @@ -439,7 +431,7 @@ where salt(), caller_to_origin::(caller), S::default_gas_limit(), - storage_deposit_limit, + storage_deposit_limit.unwrap_or(E::Balance::max_value()), ) }); @@ -527,7 +519,7 @@ where message: &CallBuilderFinal, value: E::Balance, gas_limit: Weight, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: E::Balance, ) -> Result<(Self::EventLog, Option), Self::Error> where CallBuilderFinal: Clone, @@ -556,7 +548,7 @@ where input_data: Vec, value: E::Balance, gas_limit: Weight, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: E::Balance, signer: &Keypair, ) -> Result<(Self::EventLog, Option), Self::Error> { // todo @@ -600,7 +592,7 @@ where caller: &Keypair, message: &CallBuilderFinal, value: E::Balance, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: Option, ) -> Result, Self::Error> where CallBuilderFinal: Clone, @@ -623,7 +615,7 @@ where dest: H160, input_data: Vec, value: E::Balance, - storage_deposit_limit: DepositLimit, + storage_deposit_limit: Option, caller: &Keypair, ) -> Result, Self::Error> { // There's a side effect here! @@ -637,7 +629,7 @@ where input_data, caller_to_origin::(caller), S::default_gas_limit(), - storage_deposit_limit, + storage_deposit_limit.unwrap_or(E::Balance::max_value()), ) }); if result.result.is_err() { diff --git a/crates/sandbox/src/lib.rs b/crates/sandbox/src/lib.rs index 70bc72fa72c..65e33383c63 100644 --- a/crates/sandbox/src/lib.rs +++ b/crates/sandbox/src/lib.rs @@ -19,9 +19,12 @@ use frame_system::{ }, }; use ink_primitives::U256; -use ink_revive_types::evm::{ - CallLog, - CallTrace, +use ink_revive_types::{ + Bytes, + evm::{ + CallLog, + CallTrace, + }, }; pub use macros::{ BlockBuilder, @@ -47,6 +50,7 @@ pub use { pallet_balances, pallet_revive, pallet_timestamp, + pallet_transaction_payment, paste, sp_core::crypto::Ss58Codec, sp_externalities::{ @@ -191,8 +195,8 @@ pub fn to_revive_trace(t: pallet_revive::evm::CallTrace) -> CallTrace { gas: t.gas, gas_used: t.gas_used, to: t.to, - input: t.input.0, - output: t.output.0, + input: Bytes(t.input.0), + output: Bytes(t.output.0), error: t.error, revert_reason: t.revert_reason, calls: t.calls.into_iter().map(to_revive_trace).collect(), @@ -210,6 +214,7 @@ pub fn to_revive_trace(t: pallet_revive::evm::CallTrace) -> CallTrace { .collect(), value: t.value, call_type: to_revive_call_type(t.call_type), + child_call_count: t.child_call_count, } } diff --git a/crates/sandbox/src/macros.rs b/crates/sandbox/src/macros.rs index 75c2c0986e4..b399d7cc645 100644 --- a/crates/sandbox/src/macros.rs +++ b/crates/sandbox/src/macros.rs @@ -23,7 +23,9 @@ impl< > BlockBuilder { /// Create a new externalities with the given balances. - pub fn new_ext(balances: Vec<(T::AccountId, T::Balance)>) -> TestExternalities { + pub fn new_ext( + balances: Vec<(T::AccountId, ::Balance)>, + ) -> TestExternalities { let mut storage = frame_system::GenesisConfig::::default() .build_storage() .unwrap(); @@ -116,13 +118,18 @@ mod construct_runtime { sp_runtime::{ traits::Convert, AccountId32, Perbill, + FixedU128, }, - traits::{ConstBool, ConstU128, ConstU32, ConstU64, Currency}, - weights::Weight, + traits::{ConstBool, ConstU8, ConstU128, ConstU32, ConstU64, Currency}, + weights::{Weight, IdentityFee}, }; + use $crate::pallet_transaction_payment::{FungibleAdapter}; + use $crate::Snapshot; + pub type Balance = u128; + // Define the runtime type as a collection of pallets construct_runtime!( pub enum $runtime { @@ -130,13 +137,13 @@ mod construct_runtime { Balances: $crate::pallet_balances, Timestamp: $crate::pallet_timestamp, Revive: $crate::pallet_revive, + TransactionPayment: $crate::pallet_transaction_payment, $( $pallet_name: $pallet, )* } ); - // Configure pallet system #[derive_impl($crate::frame_system::config_preludes::SolochainDefaultConfig as $crate::frame_system::DefaultConfig)] impl $crate::frame_system::Config for $runtime { type Block = $crate::frame_system::mocking::MockBlockU32<$runtime>; @@ -145,11 +152,10 @@ mod construct_runtime { type AccountData = $crate::pallet_balances::AccountData<<$runtime as $crate::pallet_balances::Config>::Balance>; } - // Configure pallet balances impl $crate::pallet_balances::Config for $runtime { type RuntimeEvent = RuntimeEvent; type WeightInfo = (); - type Balance = u128; + type Balance = Balance; type DustRemoval = (); type ExistentialDeposit = ConstU128<1>; type AccountStore = System; @@ -163,7 +169,6 @@ mod construct_runtime { type DoneSlashHandler = (); } - // Configure pallet timestamp impl $crate::pallet_timestamp::Config for $runtime { type Moment = u64; type OnTimestampSet = (); @@ -171,7 +176,17 @@ mod construct_runtime { type WeightInfo = (); } - // Configure pallet revive + impl $crate::pallet_transaction_payment::Config for $runtime { + type RuntimeEvent = RuntimeEvent; + type OnChargeTransaction = FungibleAdapter; + type OperationalFeeMultiplier = ConstU8<5>; + type WeightToFee = $crate::pallet_revive::evm::fees::BlockRatioFee<1, 1, Self>; + type LengthToFee = IdentityFee; + type FeeMultiplierUpdate = (); + type WeightInfo = $crate::pallet_transaction_payment::weights::SubstrateWeight<$runtime>; + } + + // Configure `pallet-revive` type BalanceOf = >::Balance; impl Convert for $runtime { fn convert(w: Weight) -> BalanceOf { @@ -181,6 +196,7 @@ mod construct_runtime { parameter_types! { pub CodeHashLockupDepositPercent: Perbill = Perbill::from_percent(0); + pub const MaxEthExtrinsicWeight: FixedU128 = FixedU128::from_rational(1,2); } impl $crate::pallet_revive::Config for $runtime { @@ -188,12 +204,13 @@ mod construct_runtime { type ChainId = ConstU64<1>; type NativeToEthRatio = ConstU32<100_000_000>; type Time = Timestamp; + type Balance = Balance; type Currency = Balances; type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; + type RuntimeOrigin = RuntimeOrigin; type DepositPerItem = ConstU128<1>; type DepositPerByte = ConstU128<1>; - type WeightPrice = Self; type WeightInfo = (); type RuntimeMemory = ConstU32<{ 128 * 1024 * 1024 }>; type PVFMemory = ConstU32<{ 512 * 1024 * 1024 }>; @@ -202,7 +219,6 @@ mod construct_runtime { type RuntimeHoldReason = RuntimeHoldReason; type UploadOrigin = $crate::frame_system::EnsureSigned; type InstantiateOrigin = $crate::frame_system::EnsureSigned; - type EthGasEncoder = (); type FindAuthor = (); type Precompiles = ( // todo @@ -211,6 +227,9 @@ mod construct_runtime { //XcmPrecompile, ); type AllowEVMBytecode = ConstBool; + type FeeInfo = (); + type MaxEthExtrinsicWeight = MaxEthExtrinsicWeight; + type DebugEnabled = ConstBool; } /// Default initial balance for the default account. diff --git a/integration-tests/public/contract-xcm/Cargo.toml b/integration-tests/public/contract-xcm/Cargo.toml index de2026c504c..2363bc20a76 100644 --- a/integration-tests/public/contract-xcm/Cargo.toml +++ b/integration-tests/public/contract-xcm/Cargo.toml @@ -7,8 +7,8 @@ publish = false [dependencies] ink = { path = "../../../crates/ink", default-features = false, features = ["unstable-hostfn"] } -frame-support = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "a71ec19a94702ea71767ba5ac97603ea6c6305c1", default-features = false } -pallet-balances = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "a71ec19a94702ea71767ba5ac97603ea6c6305c1", default-features = false } +frame-support = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "1b1cef306d9ceebf963fd15a04b5c79ee2618bce", default-features = false } +pallet-balances = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "1b1cef306d9ceebf963fd15a04b5c79ee2618bce", default-features = false } [dev-dependencies] ink_e2e = { path = "../../../crates/e2e" } diff --git a/integration-tests/public/runtime-call-contract/Cargo.toml b/integration-tests/public/runtime-call-contract/Cargo.toml index 0a8f5e501df..703d6ba3061 100644 --- a/integration-tests/public/runtime-call-contract/Cargo.toml +++ b/integration-tests/public/runtime-call-contract/Cargo.toml @@ -11,11 +11,11 @@ keywords = ["polkavm", "ink", "riscv", "blockchain", "edsl"] publish = false [workspace.dependencies] -frame-support = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "a71ec19a94702ea71767ba5ac97603ea6c6305c1", default-features = false } -frame-system = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "a71ec19a94702ea71767ba5ac97603ea6c6305c1", default-features = false } -pallet-balances = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "a71ec19a94702ea71767ba5ac97603ea6c6305c1", default-features = false } -pallet-revive = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "a71ec19a94702ea71767ba5ac97603ea6c6305c1", default-features = false } -sp-runtime = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "a71ec19a94702ea71767ba5ac97603ea6c6305c1", default-features = false } +frame-support = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "1b1cef306d9ceebf963fd15a04b5c79ee2618bce", default-features = false } +frame-system = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "1b1cef306d9ceebf963fd15a04b5c79ee2618bce", default-features = false } +pallet-balances = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "1b1cef306d9ceebf963fd15a04b5c79ee2618bce", default-features = false } +pallet-revive = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "1b1cef306d9ceebf963fd15a04b5c79ee2618bce", default-features = false } +sp-runtime = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "1b1cef306d9ceebf963fd15a04b5c79ee2618bce", default-features = false } # todo codec = { package = "parity-scale-codec", version = "3.7.4", default-features = false } scale-info = { version = "2.11.1", default-features = false } @@ -38,7 +38,7 @@ sandbox-runtime = { path = "sandbox-runtime", default-features = false } scale-value = "0.18.0" # can't use workspace dependency because of `cargo-contract` build not # working with workspace dependencies -frame-support = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "a71ec19a94702ea71767ba5ac97603ea6c6305c1", default-features = false } +frame-support = { git = "https://github.com/use-ink/polkadot-sdk.git", rev = "1b1cef306d9ceebf963fd15a04b5c79ee2618bce", default-features = false } [lib] path = "lib.rs" diff --git a/integration-tests/public/runtime-call-contract/sandbox-runtime/pallet-revive-caller/src/executor.rs b/integration-tests/public/runtime-call-contract/sandbox-runtime/pallet-revive-caller/src/executor.rs index a4411fc6baa..f146145fcc2 100644 --- a/integration-tests/public/runtime-call-contract/sandbox-runtime/pallet-revive-caller/src/executor.rs +++ b/integration-tests/public/runtime-call-contract/sandbox-runtime/pallet-revive-caller/src/executor.rs @@ -19,7 +19,7 @@ use ink::{ primitives::U256, }; use pallet_revive::{ - DepositLimit, + ExecConfig, MomentOf, }; use sp_runtime::traits::Bounded; @@ -61,8 +61,13 @@ where ink_sandbox::balance_to_evm_value::(self.value), self.gas_limit, // self.storage_deposit_limit, - DepositLimit::UnsafeOnlyForDryRun, // todo + BalanceOf::::max_value(), // todo data, + ExecConfig { + bump_nonce: true, + collect_deposit_from_hold: false, + effective_gas_price: None, + }, ); let output = result.result?; diff --git a/integration-tests/solidity-abi/sol-cross-contract/e2e_tests.rs b/integration-tests/solidity-abi/sol-cross-contract/e2e_tests.rs index 611d44fe67d..23953813e81 100644 --- a/integration-tests/solidity-abi/sol-cross-contract/e2e_tests.rs +++ b/integration-tests/solidity-abi/sol-cross-contract/e2e_tests.rs @@ -10,12 +10,11 @@ use ink::{ Address, SolDecode, SolEncode, - primitives::DepositLimit, }; use ink_revive_types::ExecReturnValue; use ink_sandbox::frame_system::pallet_prelude::OriginFor; -const STORAGE_DEPOSIT_LIMIT: DepositLimit = DepositLimit::UnsafeOnlyForDryRun; +const STORAGE_DEPOSIT_LIMIT: u128 = u128::MAX; #[test] fn call_sol_encoded_message() { diff --git a/integration-tests/solidity-abi/sol-encoding/e2e_tests.rs b/integration-tests/solidity-abi/sol-encoding/e2e_tests.rs index 75ba704c52c..1b9187cb305 100644 --- a/integration-tests/solidity-abi/sol-encoding/e2e_tests.rs +++ b/integration-tests/solidity-abi/sol-encoding/e2e_tests.rs @@ -3,7 +3,6 @@ use ink::{ Address, SolDecode, SolEncode, - primitives::DepositLimit, }; use ink_e2e::ContractsRegistry; use ink_revive_types::ExecReturnValue; @@ -14,7 +13,7 @@ use ink_sandbox::{ frame_system::pallet_prelude::OriginFor, }; -const STORAGE_DEPOSIT_LIMIT: DepositLimit = DepositLimit::UnsafeOnlyForDryRun; +const STORAGE_DEPOSIT_LIMIT: u128 = u128::MAX; #[test] fn call_solidity_encoded_message() { diff --git a/integration-tests/solidity-abi/solidity-calls-flipper/e2e_tests.rs b/integration-tests/solidity-abi/solidity-calls-flipper/e2e_tests.rs index ab12a3086db..41fd75e351c 100644 --- a/integration-tests/solidity-abi/solidity-calls-flipper/e2e_tests.rs +++ b/integration-tests/solidity-abi/solidity-calls-flipper/e2e_tests.rs @@ -7,7 +7,6 @@ use ink::{ Balance, DefaultEnvironment, }, - primitives::DepositLimit, }; use ink_e2e::{ BuilderClient, @@ -142,7 +141,7 @@ where ink_addr, data_sol, 0u32.into(), - ink::primitives::DepositLimit::UnsafeOnlyForDryRun, + None, &signer, ) .await @@ -163,7 +162,7 @@ async fn call_ink_no_return( data_sol, Balance::from(0u128), DEFAULT_GAS.into(), - DepositLimit::Balance(Balance::MAX), + Balance::MAX, &signer, ) .await;