mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-23 17:28:23 +00:00
Merge branch 'main' into fix/frontier-add-pov-to-create
This commit is contained in:
commit
b6c8096ab4
339 changed files with 3862 additions and 2975 deletions
3486
operator/Cargo.lock
generated
3486
operator/Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -5,12 +5,11 @@ edition = "2021"
|
|||
homepage = "https://datahaven.xyz/"
|
||||
license = "GPL-3"
|
||||
repository = "https://github.com/datahavenxyz/datahaven"
|
||||
version = "0.26.0"
|
||||
version = "0.30.0"
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
"node",
|
||||
"pallets/outbound-commitment-store",
|
||||
"pallets/*",
|
||||
"precompiles/*",
|
||||
"primitives/bridge",
|
||||
|
|
@ -40,11 +39,11 @@ pallet-evm-precompile-proxy = { path = "./precompiles/proxy", default-features =
|
|||
pallet-evm-precompile-referenda = { path = "./precompiles/referenda", default-features = false }
|
||||
pallet-evm-precompile-registry = { path = "./precompiles/precompile-registry", default-features = false }
|
||||
pallet-external-validator-slashes = { path = "./pallets/external-validator-slashes", default-features = false }
|
||||
pallet-grandpa-benchmarking = { path = "./pallets/grandpa-benchmarking", default-features = false }
|
||||
pallet-external-validators = { path = "./pallets/external-validators", default-features = false }
|
||||
pallet-external-validators-rewards = { path = "./pallets/external-validators-rewards", default-features = false }
|
||||
pallet-outbound-commitment-store = { path = "./pallets/outbound-commitment-store", default-features = false }
|
||||
pallet-proxy-genesis-companion = { path = "./pallets/proxy-genesis-companion", default-features = false }
|
||||
pallet-grandpa-benchmarking = { path = "./pallets/grandpa-benchmarking", default-features = false }
|
||||
pallet-session-benchmarking = { path = "./pallets/session-benchmarking", default-features = false }
|
||||
|
||||
# Crates.io (wasm)
|
||||
|
|
@ -57,7 +56,7 @@ async-trait = { version = "0.1.42" }
|
|||
blake2-rfc = { version = "0.2.18", default-features = false }
|
||||
byte-slice-cast = { version = "1.2.1", default-features = false }
|
||||
clap = { version = "4.5.10", features = ["derive", "env"] }
|
||||
codec = { version = "3.6.12", default-features = false, package = "parity-scale-codec" }
|
||||
codec = { version = "3.7.4", default-features = false, package = "parity-scale-codec" }
|
||||
ethabi = { version = "2.0.0", default-features = false, package = "ethabi-decode" }
|
||||
ethbloom = { version = "0.14.1", default-features = false }
|
||||
ethereum-types = { version = "0.15.1", default-features = false }
|
||||
|
|
@ -83,7 +82,7 @@ openssl-sys = { version = "0.9", features = [
|
|||
"vendored",
|
||||
] } # This is just to set the "vendored" feature required for the crossbuild, so that OpenSSL builds from source
|
||||
parity-bytes = { version = "0.1.2", default-features = false }
|
||||
parity-scale-codec = { version = "3.0.0", default-features = false, features = [
|
||||
parity-scale-codec = { version = "3.7.4", default-features = false, features = [
|
||||
"derive",
|
||||
] }
|
||||
paste = "1.0.14"
|
||||
|
|
@ -108,117 +107,117 @@ tracing-subscriber = { version = "=0.3.19", features = [
|
|||
url = "2.2.2"
|
||||
|
||||
# Polkadot SDK
|
||||
cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
frame-support = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
frame-support-test = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
frame-system = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
mmr-gadget = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
mmr-rpc = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-assets = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-babe = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-beefy = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-beefy-mmr = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-conviction-voting = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-identity = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-im-online = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-migrations = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-mmr = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-nfts = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-offences = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-parameters = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-preimage = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-proxy = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-referenda = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-safe-mode = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-tx-pause = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-whitelist = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
parachain-info = { package = "staging-parachain-info", git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false }
|
||||
parachains-common = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2412-6", default-features = false }
|
||||
polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sc-cli = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sc-client-api = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sc-consensus = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sc-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sc-consensus-beefy = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sc-consensus-beefy-rpc = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sc-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sc-consensus-manual-seal = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sc-executor = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sc-network = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sc-service = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-api = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-application-crypto = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-consensus = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-consensus-beefy = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-consensus-slots = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-core = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-crypto-hashing = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-io = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-mmr-primitives = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-runtime-interface = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-session = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-staking = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-std = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-storage = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-tracing = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-trie = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
sp-version = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
xcm = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false, package = "staging-xcm" }
|
||||
xcm-builder = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false, package = "staging-xcm-builder" }
|
||||
xcm-executor = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false, package = "staging-xcm-executor" }
|
||||
cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
frame-support-test = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
mmr-gadget = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
mmr-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-assets = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-babe = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-beefy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-beefy-mmr = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "stable2503", default-features = false }
|
||||
pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-conviction-voting = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-identity = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-im-online = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-migrations = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-mmr = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-nfts = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-offences = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-parameters = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-preimage = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-proxy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-referenda = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-safe-mode = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-staking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-tx-pause = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-whitelist = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
parachain-info = { package = "staging-parachain-info", git = "https://github.com/paritytech/polkadot-sdk.git", branch = "stable2503", default-features = false }
|
||||
parachains-common = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "stable2503", default-features = false }
|
||||
polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sc-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sc-client-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sc-consensus = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sc-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sc-consensus-beefy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sc-consensus-beefy-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sc-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sc-consensus-manual-seal = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sc-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sc-network = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sc-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-application-crypto = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-consensus = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-consensus-beefy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-consensus-slots = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-crypto-hashing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-mmr-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-runtime-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-staking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-storage = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-trie = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false, package = "staging-xcm" }
|
||||
xcm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false, package = "staging-xcm-builder" }
|
||||
xcm-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false, package = "staging-xcm-executor" }
|
||||
|
||||
# Snowbridge
|
||||
bp-relayers = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
bp-relayers = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
bridge-hub-common = { path = "primitives/snowbridge/bridge-hub-common", default-features = false }
|
||||
snowbridge-beacon-primitives = { path = "primitives/snowbridge/beacon", default-features = false }
|
||||
snowbridge-core = { path = "primitives/snowbridge/core", default-features = false }
|
||||
|
|
@ -231,7 +230,7 @@ snowbridge-pallet-ethereum-client = { path = "pallets/ethereum-client", default-
|
|||
snowbridge-pallet-ethereum-client-fixtures = { path = "pallets/ethereum-client/fixtures", default-features = false }
|
||||
snowbridge-pallet-inbound-queue-v2 = { path = "pallets/inbound-queue-v2", default-features = false }
|
||||
snowbridge-pallet-inbound-queue-v2-fixtures = { path = "pallets/inbound-queue-v2/fixtures", default-features = false }
|
||||
snowbridge-pallet-outbound-queue = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2412-6", default-features = false }
|
||||
snowbridge-pallet-outbound-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2503", default-features = false }
|
||||
snowbridge-pallet-outbound-queue-v2 = { path = "pallets/outbound-queue-v2", default-features = false }
|
||||
snowbridge-pallet-system = { path = "pallets/system", default-features = false }
|
||||
snowbridge-pallet-system-v2 = { path = "pallets/system-v2", default-features = false }
|
||||
|
|
@ -240,74 +239,77 @@ snowbridge-test-utils = { path = "primitives/snowbridge/test-utils", default-fea
|
|||
snowbridge-verification-primitives = { path = "primitives/snowbridge/verification", default-features = false }
|
||||
|
||||
# Frontier (wasm)
|
||||
evm = { git = "https://github.com/rust-ethereum/evm", rev = "6d86fe2d3bcc14887c2575f62958a67ac2d523db", default-features = false }
|
||||
fp-account = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
fp-evm = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
fp-rpc = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
fp-self-contained = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
fp-storage = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
pallet-base-fee = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
pallet-dynamic-fee = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
pallet-ethereum = { git = "https://github.com/polkadot-evm/frontier/", branch = "stable2412", default-features = false }
|
||||
pallet-evm = { git = "https://github.com/polkadot-evm/frontier/", branch = "stable2412", default-features = false }
|
||||
pallet-evm-chain-id = { git = "https://github.com/polkadot-evm/frontier/", branch = "stable2412", default-features = false }
|
||||
pallet-evm-precompile-blake2 = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
pallet-evm-precompile-bn128 = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
pallet-evm-precompile-modexp = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
pallet-evm-precompile-sha3fips = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
pallet-evm-precompile-simple = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
pallet-hotfix-sufficients = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
precompile-utils = { git = "https://github.com/polkadot-evm/frontier/", branch = "stable2412", default-features = false }
|
||||
precompile-utils-macro = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
evm = { version = "0.43.2", default-features = false }
|
||||
fp-account = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
fp-evm = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
fp-rpc = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
fp-self-contained = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
fp-storage = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
pallet-base-fee = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
pallet-dynamic-fee = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
pallet-ethereum = { git = "https://github.com/polkadot-evm/frontier/", branch = "stable2503", default-features = false }
|
||||
pallet-evm = { git = "https://github.com/polkadot-evm/frontier/", branch = "stable2503", default-features = false }
|
||||
pallet-evm-chain-id = { git = "https://github.com/polkadot-evm/frontier/", branch = "stable2503", default-features = false }
|
||||
pallet-evm-precompile-blake2 = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
pallet-evm-precompile-bn128 = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
pallet-evm-precompile-modexp = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
pallet-evm-precompile-sha3fips = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
pallet-evm-precompile-simple = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
pallet-hotfix-sufficients = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
precompile-utils = { git = "https://github.com/polkadot-evm/frontier/", branch = "stable2503", default-features = false }
|
||||
precompile-utils-macro = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
ethereum = { version = "0.18.2", default-features = false, features = [
|
||||
"with-scale",
|
||||
] }
|
||||
|
||||
# Frontier (client)
|
||||
fc-api = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
fc-cli = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
fc-consensus = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
fc-db = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412" }
|
||||
fc-mapping-sync = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
fc-rpc = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
fc-rpc-core = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
fc-storage = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2412", default-features = false }
|
||||
fc-api = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
fc-cli = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
fc-consensus = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
fc-db = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503" }
|
||||
fc-mapping-sync = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
fc-rpc = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
fc-rpc-core = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
fc-storage = { git = "https://github.com/polkadot-evm/frontier", branch = "stable2503", default-features = false }
|
||||
|
||||
# StorageHub
|
||||
## Runtime
|
||||
pallet-bucket-nfts = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
pallet-cr-randomness = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
pallet-file-system = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
pallet-file-system-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
pallet-payment-streams = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
pallet-payment-streams-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
pallet-proofs-dealer = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
pallet-proofs-dealer-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
pallet-randomness = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
pallet-storage-providers = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
pallet-storage-providers-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shp-constants = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shp-data-price-updater = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shp-file-key-verifier = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shp-file-metadata = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shp-forest-verifier = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shp-traits = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shp-treasury-funding = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
pallet-bucket-nfts = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
pallet-cr-randomness = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
pallet-file-system = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
pallet-file-system-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
pallet-payment-streams = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
pallet-payment-streams-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
pallet-proofs-dealer = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
pallet-proofs-dealer-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
pallet-randomness = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
pallet-storage-providers = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
pallet-storage-providers-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shp-constants = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shp-data-price-updater = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shp-file-key-verifier = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shp-file-metadata = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shp-forest-verifier = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shp-traits = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shp-treasury-funding = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
## Client
|
||||
shc-actors-derive = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shc-actors-framework = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shc-blockchain-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shc-client = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shc-common = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shc-file-manager = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shc-file-transfer-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shc-fisherman-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shc-forest-manager = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shc-indexer-db = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shc-indexer-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shc-rpc = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shp-opaque = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shp-tx-implicits-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shp-types = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
shc-actors-derive = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shc-actors-framework = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shc-blockchain-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shc-client = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shc-common = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shc-file-manager = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shc-file-transfer-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shc-fisherman-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shc-forest-manager = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shc-indexer-db = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shc-indexer-service = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shc-rpc = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shp-opaque = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shp-tx-implicits-runtime-api = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
shp-types = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
## Precompiles
|
||||
pallet-evm-precompile-file-system = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.4.3", default-features = false }
|
||||
pallet-evm-precompile-file-system = { git = "https://github.com/Moonsong-Labs/storage-hub.git", tag = "v0.5.1", default-features = false }
|
||||
|
||||
|
||||
# Static linking
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
|
||||
use sp_std::marker::PhantomData;
|
||||
use core::marker::PhantomData;
|
||||
|
||||
/// Weights for `{{pallet}}`.
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
|
|
|
|||
|
|
@ -147,6 +147,7 @@ pub fn create_benchmark_extrinsic<RuntimeApi>(
|
|||
frame_system::CheckWeight::<runtime::Runtime>::new(),
|
||||
pallet_transaction_payment::ChargeTransactionPayment::<runtime::Runtime>::from(0),
|
||||
frame_metadata_hash_extension::CheckMetadataHash::<runtime::Runtime>::new(false),
|
||||
frame_system::WeightReclaim::<runtime::Runtime>::new(),
|
||||
);
|
||||
|
||||
let raw_payload = runtime::SignedPayload::from_raw(
|
||||
|
|
@ -162,6 +163,7 @@ pub fn create_benchmark_extrinsic<RuntimeApi>(
|
|||
(),
|
||||
(),
|
||||
None,
|
||||
(),
|
||||
),
|
||||
);
|
||||
let signature = raw_payload.using_encoded(|e| sender.sign(e));
|
||||
|
|
|
|||
|
|
@ -427,78 +427,72 @@ pub fn run() -> sc_cli::Result<()> {
|
|||
};
|
||||
|
||||
match config.network.network_backend {
|
||||
// TODO: Litep2p becomes standard with Polkadot SDK stable2412-7 (should move None to other arm)
|
||||
// cfr. https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-stable2412-7
|
||||
Some(sc_network::config::NetworkBackendType::Libp2p) | None => {
|
||||
match config.chain_spec {
|
||||
ref spec if spec.is_mainnet() => {
|
||||
service::new_full::<
|
||||
datahaven_mainnet_runtime::Runtime,
|
||||
datahaven_mainnet_runtime::RuntimeApi,
|
||||
sc_network::NetworkWorker<_, _>,
|
||||
>(
|
||||
config, cli.eth, role_options, indexer_options, sealing_mode
|
||||
)
|
||||
.await
|
||||
}
|
||||
ref spec if spec.is_testnet() => {
|
||||
service::new_full::<
|
||||
datahaven_testnet_runtime::Runtime,
|
||||
datahaven_testnet_runtime::RuntimeApi,
|
||||
sc_network::NetworkWorker<_, _>,
|
||||
>(
|
||||
config, cli.eth, role_options, indexer_options, sealing_mode
|
||||
)
|
||||
.await
|
||||
}
|
||||
_ => {
|
||||
service::new_full::<
|
||||
datahaven_stagenet_runtime::Runtime,
|
||||
datahaven_stagenet_runtime::RuntimeApi,
|
||||
sc_network::NetworkWorker<_, _>,
|
||||
>(
|
||||
config, cli.eth, role_options, indexer_options, sealing_mode
|
||||
)
|
||||
.await
|
||||
}
|
||||
sc_network::config::NetworkBackendType::Libp2p => match config.chain_spec {
|
||||
ref spec if spec.is_mainnet() => {
|
||||
service::new_full::<
|
||||
datahaven_mainnet_runtime::Runtime,
|
||||
datahaven_mainnet_runtime::RuntimeApi,
|
||||
sc_network::NetworkWorker<_, _>,
|
||||
>(
|
||||
config, cli.eth, role_options, indexer_options, sealing_mode
|
||||
)
|
||||
.await
|
||||
}
|
||||
.map_err(sc_cli::Error::Service)
|
||||
}
|
||||
Some(sc_network::config::NetworkBackendType::Litep2p) => {
|
||||
match config.chain_spec {
|
||||
ref spec if spec.is_mainnet() => {
|
||||
service::new_full::<
|
||||
datahaven_mainnet_runtime::Runtime,
|
||||
datahaven_mainnet_runtime::RuntimeApi,
|
||||
sc_network::Litep2pNetworkBackend,
|
||||
>(
|
||||
config, cli.eth, role_options, indexer_options, sealing_mode
|
||||
)
|
||||
.await
|
||||
}
|
||||
ref spec if spec.is_testnet() => {
|
||||
service::new_full::<
|
||||
datahaven_testnet_runtime::Runtime,
|
||||
datahaven_testnet_runtime::RuntimeApi,
|
||||
sc_network::Litep2pNetworkBackend,
|
||||
>(
|
||||
config, cli.eth, role_options, indexer_options, sealing_mode
|
||||
)
|
||||
.await
|
||||
}
|
||||
_ => {
|
||||
service::new_full::<
|
||||
datahaven_stagenet_runtime::Runtime,
|
||||
datahaven_stagenet_runtime::RuntimeApi,
|
||||
sc_network::Litep2pNetworkBackend,
|
||||
>(
|
||||
config, cli.eth, role_options, indexer_options, sealing_mode
|
||||
)
|
||||
.await
|
||||
}
|
||||
ref spec if spec.is_testnet() => {
|
||||
service::new_full::<
|
||||
datahaven_testnet_runtime::Runtime,
|
||||
datahaven_testnet_runtime::RuntimeApi,
|
||||
sc_network::NetworkWorker<_, _>,
|
||||
>(
|
||||
config, cli.eth, role_options, indexer_options, sealing_mode
|
||||
)
|
||||
.await
|
||||
}
|
||||
_ => {
|
||||
service::new_full::<
|
||||
datahaven_stagenet_runtime::Runtime,
|
||||
datahaven_stagenet_runtime::RuntimeApi,
|
||||
sc_network::NetworkWorker<_, _>,
|
||||
>(
|
||||
config, cli.eth, role_options, indexer_options, sealing_mode
|
||||
)
|
||||
.await
|
||||
}
|
||||
.map_err(sc_cli::Error::Service)
|
||||
}
|
||||
.map_err(sc_cli::Error::Service),
|
||||
sc_network::config::NetworkBackendType::Litep2p => match config.chain_spec {
|
||||
ref spec if spec.is_mainnet() => {
|
||||
service::new_full::<
|
||||
datahaven_mainnet_runtime::Runtime,
|
||||
datahaven_mainnet_runtime::RuntimeApi,
|
||||
sc_network::Litep2pNetworkBackend,
|
||||
>(
|
||||
config, cli.eth, role_options, indexer_options, sealing_mode
|
||||
)
|
||||
.await
|
||||
}
|
||||
ref spec if spec.is_testnet() => {
|
||||
service::new_full::<
|
||||
datahaven_testnet_runtime::Runtime,
|
||||
datahaven_testnet_runtime::RuntimeApi,
|
||||
sc_network::Litep2pNetworkBackend,
|
||||
>(
|
||||
config, cli.eth, role_options, indexer_options, sealing_mode
|
||||
)
|
||||
.await
|
||||
}
|
||||
_ => {
|
||||
service::new_full::<
|
||||
datahaven_stagenet_runtime::Runtime,
|
||||
datahaven_stagenet_runtime::RuntimeApi,
|
||||
sc_network::Litep2pNetworkBackend,
|
||||
>(
|
||||
config, cli.eth, role_options, indexer_options, sealing_mode
|
||||
)
|
||||
.await
|
||||
}
|
||||
}
|
||||
.map_err(sc_cli::Error::Service),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ use sc_consensus_beefy::communication::notification::{
|
|||
};
|
||||
use sc_consensus_manual_seal::rpc::{EngineCommand, ManualSeal, ManualSealApiServer};
|
||||
use sc_network_sync::SyncingService;
|
||||
use sc_transaction_pool::{ChainApi, Pool};
|
||||
use sc_transaction_pool::ChainApi;
|
||||
use sc_transaction_pool_api::TransactionPool;
|
||||
use shc_client::types::FileStorageT;
|
||||
use shc_common::traits::StorageEnableRuntime;
|
||||
|
|
@ -54,7 +54,7 @@ use shc_rpc::StorageHubClientRpcConfig;
|
|||
use sp_consensus_babe::{BabeApi, SlotDuration};
|
||||
use sp_consensus_beefy::AuthorityIdBound;
|
||||
use sp_core::H256;
|
||||
use sp_runtime::traits::BlakeTwo256;
|
||||
use sp_runtime::traits::{BlakeTwo256, Block as BlockT, Header as HeaderT};
|
||||
use std::collections::BTreeMap;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
|
@ -69,9 +69,10 @@ pub struct BeefyDeps<AuthorityId: AuthorityIdBound> {
|
|||
}
|
||||
|
||||
/// Full client dependencies.
|
||||
pub struct FullDeps<P, B, AuthorityId: AuthorityIdBound, A: ChainApi, FL, FS, Runtime>
|
||||
pub struct FullDeps<P, B, AuthorityId: AuthorityIdBound, FL, FS, Runtime>
|
||||
where
|
||||
Runtime: StorageEnableRuntime,
|
||||
FS: ForestStorageHandler<Runtime> + Clone + Send + Sync + 'static,
|
||||
{
|
||||
/// The client instance to use.
|
||||
pub client: Arc<StorageHubClient<Runtime::RuntimeApi>>,
|
||||
|
|
@ -80,7 +81,7 @@ where
|
|||
/// BEEFY dependencies.
|
||||
pub beefy: BeefyDeps<AuthorityId>,
|
||||
/// Graph pool instance.
|
||||
pub graph: Arc<Pool<A>>,
|
||||
pub graph: Arc<P>,
|
||||
/// Backend used by the node.
|
||||
pub backend: Arc<B>,
|
||||
/// Network service
|
||||
|
|
@ -112,8 +113,8 @@ where
|
|||
}
|
||||
|
||||
/// Instantiate all full RPC extensions.
|
||||
pub fn create_full<P, BE, AuthorityId, A, FL, FSH, Runtime>(
|
||||
deps: FullDeps<P, BE, AuthorityId, A, FL, FSH, Runtime>,
|
||||
pub fn create_full<P, BE, AuthorityId, FL, FSH, Runtime>(
|
||||
deps: FullDeps<P, BE, AuthorityId, FL, FSH, Runtime>,
|
||||
subscription_task_executor: sc_rpc::SubscriptionTaskExecutor,
|
||||
pubsub_notification_sinks: Arc<
|
||||
fc_mapping_sync::EthereumBlockNotificationSinks<
|
||||
|
|
@ -122,11 +123,10 @@ pub fn create_full<P, BE, AuthorityId, A, FL, FSH, Runtime>(
|
|||
>,
|
||||
) -> Result<RpcModule<()>, Box<dyn std::error::Error + Send + Sync>>
|
||||
where
|
||||
P: TransactionPool<Block = Block> + 'static,
|
||||
P: TransactionPool<Block = Block, Hash = <Block as BlockT>::Hash> + 'static,
|
||||
BE: Backend<Block> + Send + Sync + 'static,
|
||||
BE::State: StateBackend<BlakeTwo256>,
|
||||
AuthorityId: AuthorityIdBound,
|
||||
A: ChainApi<Block = Block> + 'static,
|
||||
Runtime: StorageEnableRuntime,
|
||||
Runtime::RuntimeApi: StorageEnableRuntimeApi<
|
||||
RuntimeApi: mmr_rpc::MmrRuntimeApi<
|
||||
|
|
@ -139,7 +139,7 @@ where
|
|||
>,
|
||||
StorageHubClient<Runtime::RuntimeApi>: StorageProvider<Block, BE>,
|
||||
FL: FileStorageT,
|
||||
FSH: ForestStorageHandler<Runtime> + Send + Sync + 'static,
|
||||
FSH: ForestStorageHandler<Runtime> + Clone + Send + Sync + 'static,
|
||||
{
|
||||
use mmr_rpc::{Mmr, MmrApiServer};
|
||||
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
|
||||
|
|
@ -225,7 +225,7 @@ where
|
|||
};
|
||||
|
||||
module.merge(
|
||||
Eth::<_, _, _, _, _, _, _, DefaultEthConfig<StorageHubClient<Runtime::RuntimeApi>, BE>>::new(
|
||||
Eth::<_, _, _, _, _, _, DefaultEthConfig<StorageHubClient<Runtime::RuntimeApi>, BE>>::new(
|
||||
Arc::clone(&client),
|
||||
Arc::clone(&pool),
|
||||
graph.clone(),
|
||||
|
|
|
|||
|
|
@ -572,7 +572,7 @@ where
|
|||
Vec::default(),
|
||||
));
|
||||
|
||||
let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) =
|
||||
let (network, system_rpc_tx, tx_handler_controller, sync_service) =
|
||||
sc_service::build_network(sc_service::BuildNetworkParams {
|
||||
config: &config,
|
||||
net_config,
|
||||
|
|
@ -698,7 +698,7 @@ where
|
|||
let deps = crate::rpc::FullDeps {
|
||||
client: client.clone(),
|
||||
pool: pool.clone(),
|
||||
graph: pool.pool().clone(),
|
||||
graph: pool.clone(),
|
||||
beefy: BeefyDeps::<BeefyId> {
|
||||
beefy_finality_proof_stream: beefy_rpc_links
|
||||
.from_voter_justif_stream
|
||||
|
|
@ -996,7 +996,6 @@ where
|
|||
.await?;
|
||||
}
|
||||
|
||||
network_starter.start_network();
|
||||
Ok(task_manager)
|
||||
}
|
||||
|
||||
|
|
@ -1375,7 +1374,6 @@ where
|
|||
.with_blockchain(
|
||||
client.clone(),
|
||||
keystore.clone(),
|
||||
Arc::new(rpc_handlers),
|
||||
rocks_db_path.clone(),
|
||||
maintenance_mode,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ frame-support = { workspace = true }
|
|||
frame-system = { workspace = true }
|
||||
sp-core = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
|
||||
snowbridge-core = { workspace = true }
|
||||
snowbridge-outbound-queue-primitives = { workspace = true }
|
||||
|
|
@ -48,7 +47,6 @@ std = [
|
|||
"sp-core/std",
|
||||
"sp-io/std",
|
||||
"sp-runtime/std",
|
||||
"sp-std/std",
|
||||
"xcm/std",
|
||||
"xcm-builder/std",
|
||||
"pallet-balances/std",
|
||||
|
|
|
|||
|
|
@ -29,7 +29,9 @@
|
|||
//! It uses a dedicated Ethereum sovereign account to hold locked tokens during transfers.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
extern crate alloc;
|
||||
|
||||
use alloc::vec;
|
||||
use frame_support::{
|
||||
pallet_prelude::*,
|
||||
traits::{
|
||||
|
|
@ -41,7 +43,6 @@ use snowbridge_core::TokenId;
|
|||
use snowbridge_outbound_queue_primitives::v2::{Command, Message as OutboundMessage, SendMessage};
|
||||
use sp_core::{H160, H256};
|
||||
use sp_runtime::{traits::Saturating, BoundedVec};
|
||||
use sp_std::vec;
|
||||
|
||||
pub use pallet::*;
|
||||
|
||||
|
|
|
|||
|
|
@ -166,9 +166,12 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
|
|||
(BOB, INITIAL_BALANCE),
|
||||
(CHARLIE, INITIAL_BALANCE),
|
||||
];
|
||||
pallet_balances::GenesisConfig::<Test> { balances }
|
||||
.assimilate_storage(&mut t)
|
||||
.unwrap();
|
||||
pallet_balances::GenesisConfig::<Test> {
|
||||
balances,
|
||||
dev_accounts: Default::default(),
|
||||
}
|
||||
.assimilate_storage(&mut t)
|
||||
.unwrap();
|
||||
|
||||
let mut ext: sp_io::TestExternalities = t.into();
|
||||
ext.execute_with(|| {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ frame-system = { workspace = true }
|
|||
sp-core = { workspace = true }
|
||||
sp-io = { optional = true, workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
|
||||
pallet-timestamp = { optional = true, workspace = true }
|
||||
snowbridge-beacon-primitives = { workspace = true }
|
||||
|
|
@ -77,7 +76,6 @@ std = [
|
|||
"sp-core/std",
|
||||
"sp-io/std",
|
||||
"sp-runtime/std",
|
||||
"sp-std/std",
|
||||
'frame-benchmarking/std',
|
||||
]
|
||||
try-runtime = [
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ snowbridge-beacon-primitives = { workspace = true }
|
|||
snowbridge-core = { workspace = true }
|
||||
snowbridge-inbound-queue-primitives = { workspace = true }
|
||||
sp-core = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
|
|
@ -33,5 +32,4 @@ std = [
|
|||
"snowbridge-core/std",
|
||||
"snowbridge-inbound-queue-primitives/std",
|
||||
"sp-core/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@
|
|||
// Generated, do not edit!
|
||||
// See README.md for instructions to generate
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
extern crate alloc;
|
||||
|
||||
use alloc::{boxed::Box, vec};
|
||||
use hex_literal::hex;
|
||||
use snowbridge_beacon_primitives::{
|
||||
types::deneb, AncestryProof, BeaconHeader, ExecutionProof, NextSyncCommitteeUpdate,
|
||||
|
|
@ -11,7 +13,6 @@ use snowbridge_beacon_primitives::{
|
|||
};
|
||||
use snowbridge_inbound_queue_primitives::{EventProof, InboundQueueFixture, Log, Proof};
|
||||
use sp_core::U256;
|
||||
use sp_std::{boxed::Box, vec};
|
||||
|
||||
const SC_SIZE: usize = 512;
|
||||
const SC_BITS_SIZE: usize = 64;
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@
|
|||
// SPDX-FileCopyrightText: 2023 Snowfork <hello@snowfork.com>
|
||||
use crate::{
|
||||
decompress_sync_committee_bits, Config, CurrentSyncCommittee, Pallet as EthereumBeaconClient,
|
||||
Update, ValidatorsRoot, Vec,
|
||||
Update, ValidatorsRoot,
|
||||
};
|
||||
use alloc::vec::Vec;
|
||||
use snowbridge_beacon_primitives::PublicKeyPrepared;
|
||||
use sp_core::H256;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ use super::*;
|
|||
use frame_support::ensure;
|
||||
use snowbridge_beacon_primitives::ExecutionProof;
|
||||
|
||||
use alloc::vec::Vec;
|
||||
use snowbridge_beacon_primitives::merkle_proof::{generalized_index_length, subtree_index};
|
||||
use snowbridge_ethereum::Receipt;
|
||||
use snowbridge_inbound_queue_primitives::{
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
//!
|
||||
//! * [`Call::submit`]: Submit a finalized beacon header with an optional sync committee update
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
extern crate alloc;
|
||||
|
||||
pub mod config;
|
||||
pub mod functions;
|
||||
|
|
@ -38,6 +39,7 @@ mod tests_electra;
|
|||
#[cfg(feature = "runtime-benchmarks")]
|
||||
mod benchmarking;
|
||||
|
||||
use alloc::boxed::Box;
|
||||
use frame_support::{
|
||||
dispatch::{DispatchResult, PostDispatchInfo},
|
||||
pallet_prelude::OptionQuery,
|
||||
|
|
@ -53,7 +55,6 @@ use snowbridge_beacon_primitives::{
|
|||
};
|
||||
use snowbridge_core::{BasicOperatingMode, RingBufferMap};
|
||||
use sp_core::H256;
|
||||
use sp_std::prelude::*;
|
||||
pub use weights::WeightInfo;
|
||||
|
||||
use functions::{
|
||||
|
|
@ -71,6 +72,7 @@ pub const LOG_TARGET: &str = "ethereum-client";
|
|||
pub mod pallet {
|
||||
use super::*;
|
||||
|
||||
use alloc::vec::Vec;
|
||||
use frame_support::pallet_prelude::*;
|
||||
use frame_system::pallet_prelude::*;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
// SPDX-FileCopyrightText: 2023 Snowfork <hello@snowfork.com>
|
||||
use crate as ethereum_beacon_client;
|
||||
use crate::config;
|
||||
use alloc::default::Default;
|
||||
use frame_support::{derive_impl, dispatch::DispatchResult, parameter_types};
|
||||
use pallet_timestamp;
|
||||
use snowbridge_beacon_primitives::{Fork, ForkVersions};
|
||||
use snowbridge_inbound_queue_primitives::{Log, Proof};
|
||||
use sp_std::default::Default;
|
||||
use std::{fs::File, path::PathBuf};
|
||||
|
||||
type Block = frame_system::mocking::MockBlock<Test>;
|
||||
|
|
@ -136,6 +136,10 @@ parameter_types! {
|
|||
},
|
||||
electra: Fork {
|
||||
version: [5, 0, 0, 0], // 0x05000000
|
||||
epoch: 0,
|
||||
},
|
||||
fulu: Fork {
|
||||
version: [6, 0, 0, 0], // 0x06000000
|
||||
epoch: 80000000000,
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
// SPDX-FileCopyrightText: 2023 Snowfork <hello@snowfork.com>
|
||||
use crate as ethereum_beacon_client;
|
||||
use crate::config;
|
||||
use alloc::default::Default;
|
||||
use frame_support::{derive_impl, dispatch::DispatchResult, parameter_types};
|
||||
use pallet_timestamp;
|
||||
use snowbridge_beacon_primitives::{Fork, ForkVersions};
|
||||
use snowbridge_inbound_queue_primitives::{Log, Proof};
|
||||
use sp_std::default::Default;
|
||||
use std::{fs::File, path::PathBuf};
|
||||
|
||||
type Block = frame_system::mocking::MockBlock<Test>;
|
||||
|
|
@ -117,6 +117,10 @@ parameter_types! {
|
|||
electra: Fork {
|
||||
version: [5, 0, 0, 0], // 0x05000000
|
||||
epoch: 0,
|
||||
},
|
||||
fulu: Fork {
|
||||
version: [6, 0, 0, 0], // 0x06000000
|
||||
epoch: 0,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -248,6 +248,10 @@ fn compute_fork_version() {
|
|||
version: [0, 0, 0, 5],
|
||||
epoch: 50,
|
||||
},
|
||||
fulu: Fork {
|
||||
version: [0, 0, 0, 6],
|
||||
epoch: 60,
|
||||
},
|
||||
};
|
||||
new_tester().execute_with(|| {
|
||||
assert_eq!(
|
||||
|
|
|
|||
|
|
@ -247,6 +247,10 @@ fn compute_fork_version() {
|
|||
version: [0, 0, 0, 5],
|
||||
epoch: 50,
|
||||
},
|
||||
fulu: Fork {
|
||||
version: [0, 0, 0, 6],
|
||||
epoch: 60,
|
||||
},
|
||||
};
|
||||
new_tester().execute_with(|| {
|
||||
assert_eq!(
|
||||
|
|
@ -281,6 +285,10 @@ fn compute_fork_version() {
|
|||
EthereumBeaconClient::select_fork_version(&mock_fork_versions, 50),
|
||||
[0, 0, 0, 5]
|
||||
);
|
||||
assert_eq!(
|
||||
EthereumBeaconClient::select_fork_version(&mock_fork_versions, 60),
|
||||
[0, 0, 0, 6]
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
|
||||
use sp_std::marker::PhantomData;
|
||||
use core::marker::PhantomData;
|
||||
|
||||
/// Weight functions needed for ethereum_beacon_client.
|
||||
pub trait WeightInfo {
|
||||
|
|
|
|||
|
|
@ -35,20 +35,24 @@ const MAX_SLASHES: u32 = 1000;
|
|||
mod benchmarks {
|
||||
use super::*;
|
||||
|
||||
fn dummy_slash<T: Config>(slash_id: T::SlashId) -> Slash<T::AccountId, T::SlashId> {
|
||||
let dummy = || T::AccountId::decode(&mut TrailingZeroInput::zeroes()).unwrap();
|
||||
Slash {
|
||||
validator: dummy(),
|
||||
reporters: vec![],
|
||||
slash_id,
|
||||
percentage: Perbill::from_percent(1),
|
||||
confirmed: false,
|
||||
offence_kind: OffenceKind::LivenessOffence,
|
||||
}
|
||||
}
|
||||
|
||||
#[benchmark]
|
||||
fn cancel_deferred_slash(s: Linear<1, MAX_SLASHES>) -> Result<(), BenchmarkError> {
|
||||
let mut existing_slashes = Vec::new();
|
||||
let era = T::EraIndexProvider::active_era().index;
|
||||
let dummy = || T::AccountId::decode(&mut TrailingZeroInput::zeroes()).unwrap();
|
||||
for _ in 0..MAX_SLASHES {
|
||||
existing_slashes.push(Slash {
|
||||
validator: dummy(),
|
||||
reporters: vec![],
|
||||
slash_id: One::one(),
|
||||
percentage: Perbill::from_percent(1),
|
||||
confirmed: false,
|
||||
offence_kind: OffenceKind::LivenessOffence,
|
||||
});
|
||||
existing_slashes.push(dummy_slash::<T>(One::one()));
|
||||
}
|
||||
Slashes::<T>::insert(
|
||||
era.saturating_add(T::SlashDeferDuration::get())
|
||||
|
|
@ -102,35 +106,55 @@ mod benchmarks {
|
|||
|
||||
#[benchmark]
|
||||
fn process_slashes_queue(s: Linear<1, 200>) -> Result<(), BenchmarkError> {
|
||||
let mut queue = VecDeque::new();
|
||||
let dummy = || T::AccountId::decode(&mut TrailingZeroInput::zeroes()).unwrap();
|
||||
let first_batch = (0..s)
|
||||
.map(|_| dummy_slash::<T>(One::one()))
|
||||
.collect::<Vec<_>>();
|
||||
let second_batch = vec![dummy_slash::<T>(One::one())];
|
||||
|
||||
for _ in 0..(s + 1) {
|
||||
queue.push_back(Slash {
|
||||
validator: dummy(),
|
||||
reporters: vec![],
|
||||
slash_id: One::one(),
|
||||
percentage: Perbill::from_percent(1),
|
||||
confirmed: false,
|
||||
offence_kind: OffenceKind::LivenessOffence,
|
||||
});
|
||||
}
|
||||
|
||||
UnreportedSlashesQueue::<T>::set(queue);
|
||||
assert!(ExternalValidatorSlashes::<T>::unsent_queue_push((
|
||||
1,
|
||||
first_batch
|
||||
)));
|
||||
assert!(ExternalValidatorSlashes::<T>::unsent_queue_push((
|
||||
2,
|
||||
second_batch
|
||||
)));
|
||||
|
||||
let processed;
|
||||
|
||||
#[block]
|
||||
{
|
||||
processed = Pallet::<T>::process_slashes_queue(s).unwrap();
|
||||
processed = match Pallet::<T>::process_slashes_queue() {
|
||||
crate::ProcessSlashesQueueOutcome::Sent(count) => count,
|
||||
crate::ProcessSlashesQueueOutcome::Empty
|
||||
| crate::ProcessSlashesQueueOutcome::Requeued(_) => {
|
||||
return Err(BenchmarkError::Stop("unexpected slashes queue outcome"))
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
assert_eq!(UnreportedSlashesQueue::<T>::get().len(), 1);
|
||||
assert_eq!(ExternalValidatorSlashes::<T>::unsent_queue_len(), 1);
|
||||
assert_eq!(processed, s);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[benchmark]
|
||||
fn retry_unsent_slash_era() -> Result<(), BenchmarkError> {
|
||||
let batch = vec![dummy_slash::<T>(One::one())];
|
||||
assert!(ExternalValidatorSlashes::<T>::unsent_queue_push((1, batch)));
|
||||
|
||||
let origin =
|
||||
T::GovernanceOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
|
||||
|
||||
#[extrinsic_call]
|
||||
_(origin as T::RuntimeOrigin, 1u32);
|
||||
|
||||
assert!(ExternalValidatorSlashes::<T>::unsent_queue_is_empty());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[benchmark]
|
||||
fn set_slashing_mode() -> Result<(), BenchmarkError> {
|
||||
#[extrinsic_call]
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ extern crate alloc;
|
|||
use pallet_external_validators::apply;
|
||||
use snowbridge_outbound_queue_primitives::SendError;
|
||||
use {
|
||||
alloc::{collections::vec_deque::VecDeque, string::String, vec, vec::Vec},
|
||||
alloc::{string::String, vec, vec::Vec},
|
||||
frame_support::{pallet_prelude::*, traits::DefensiveSaturating},
|
||||
frame_system::pallet_prelude::*,
|
||||
log::log,
|
||||
|
|
@ -132,10 +132,21 @@ pub mod pallet {
|
|||
},
|
||||
/// The slashes message was sent correctly.
|
||||
SlashesMessageSent { message_id: H256 },
|
||||
/// The slashes message failed to send and the batch was moved to the back
|
||||
/// of the queue for retry.
|
||||
SlashesMessageSendFailed { era: EraIndex, count: u32 },
|
||||
/// A queued slashes batch was retried manually and sent successfully.
|
||||
SlashesMessageRetried {
|
||||
message_id: H256,
|
||||
era: EraIndex,
|
||||
count: u32,
|
||||
},
|
||||
/// We injected a slash
|
||||
SlashInjected { slash_id: T::SlashId, era: u32 },
|
||||
/// Number of slashes processed
|
||||
SlashAddedToQueue { number: u32, era: u32 },
|
||||
/// The unsent queue is full; this slash era could not be enqueued.
|
||||
UnsentQueueFull { era: EraIndex },
|
||||
}
|
||||
|
||||
#[pallet::config]
|
||||
|
|
@ -199,6 +210,9 @@ pub mod pallet {
|
|||
|
||||
/// The weight information of this pallet.
|
||||
type WeightInfo: WeightInfo;
|
||||
|
||||
/// Origin for governance calls such as retrying an unsent slash batch.
|
||||
type GovernanceOrigin: EnsureOrigin<Self::RuntimeOrigin>;
|
||||
}
|
||||
|
||||
#[pallet::error]
|
||||
|
|
@ -226,6 +240,10 @@ pub mod pallet {
|
|||
/// No PendingOffenceKind found for (session, validator) — offence was not
|
||||
/// reported through EquivocationReportWrapper, so the offence kind is unknown.
|
||||
MissingOffenceKind,
|
||||
/// The specified era is not in the unsent slash queue.
|
||||
EraNotInUnsentQueue,
|
||||
/// The message delivery still failed on retry.
|
||||
MessageSendFailed,
|
||||
}
|
||||
|
||||
#[apply(derive_storage_traits)]
|
||||
|
|
@ -269,12 +287,26 @@ pub mod pallet {
|
|||
pub type Slashes<T: Config> =
|
||||
StorageMap<_, Twox64Concat, EraIndex, Vec<Slash<T::AccountId, T::SlashId>>, ValueQuery>;
|
||||
|
||||
/// All unreported slashes that will be processed in the future.
|
||||
/// Maximum number of unsent slash batches in the retry ring buffer.
|
||||
pub const UNSENT_QUEUE_CAPACITY: u32 = 64;
|
||||
|
||||
/// Ring buffer of slash batches whose outbound message still needs to be sent.
|
||||
/// Each slot stores the original slash era together with a bounded-size batch
|
||||
/// of slash records. Retries keep the original era so the outbound message id
|
||||
/// remains stable across later blocks and eras.
|
||||
#[pallet::storage]
|
||||
#[pallet::unbounded]
|
||||
#[pallet::getter(fn unreported_slashes)]
|
||||
pub type UnreportedSlashesQueue<T: Config> =
|
||||
StorageValue<_, VecDeque<Slash<T::AccountId, T::SlashId>>, ValueQuery>;
|
||||
pub type UnsentSlashBatch<T: Config> =
|
||||
StorageMap<_, Twox64Concat, u32, (EraIndex, Vec<Slash<T::AccountId, T::SlashId>>)>;
|
||||
|
||||
/// Ring buffer head: next slot to be processed by `on_initialize`.
|
||||
#[pallet::storage]
|
||||
pub type UnsentSlashHead<T: Config> = StorageValue<_, u32, ValueQuery>;
|
||||
|
||||
/// Ring buffer tail: next slot to write a new entry into.
|
||||
/// When head == tail the buffer is empty.
|
||||
#[pallet::storage]
|
||||
pub type UnsentSlashTail<T: Config> = StorageValue<_, u32, ValueQuery>;
|
||||
|
||||
// Turns slashing on or off
|
||||
#[pallet::storage]
|
||||
|
|
@ -415,6 +447,44 @@ pub mod pallet {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[pallet::call_index(2)]
|
||||
#[pallet::weight(T::WeightInfo::retry_unsent_slash_era())]
|
||||
pub fn retry_unsent_slash_era(origin: OriginFor<T>, era_index: EraIndex) -> DispatchResult {
|
||||
T::GovernanceOrigin::ensure_origin(origin)?;
|
||||
|
||||
let head = UnsentSlashHead::<T>::get();
|
||||
let tail = UnsentSlashTail::<T>::get();
|
||||
let mut found = None;
|
||||
let mut slot = head;
|
||||
while slot != tail {
|
||||
if let Some(entry @ (idx, _)) = UnsentSlashBatch::<T>::get(slot) {
|
||||
if idx == era_index {
|
||||
found = Some((slot, entry));
|
||||
break;
|
||||
}
|
||||
}
|
||||
slot = (slot + 1) % UNSENT_QUEUE_CAPACITY;
|
||||
}
|
||||
|
||||
let (slot, (era, slashes)) = found.ok_or(Error::<T>::EraNotInUnsentQueue)?;
|
||||
let count = slashes.len() as u32;
|
||||
let slashes_to_send = slashes
|
||||
.iter()
|
||||
.map(Self::slash_to_send_data)
|
||||
.collect::<Vec<_>>();
|
||||
let message_id = Self::send_slashes_message(&slashes_to_send, era)
|
||||
.ok_or(Error::<T>::MessageSendFailed)?;
|
||||
|
||||
Self::unsent_queue_remove_slot(slot);
|
||||
Self::deposit_event(Event::<T>::SlashesMessageRetried {
|
||||
message_id,
|
||||
era,
|
||||
count,
|
||||
});
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[pallet::call_index(3)]
|
||||
#[pallet::weight(T::WeightInfo::set_slashing_mode())]
|
||||
pub fn set_slashing_mode(origin: OriginFor<T>, mode: SlashingModeOption) -> DispatchResult {
|
||||
|
|
@ -429,12 +499,12 @@ pub mod pallet {
|
|||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
|
||||
fn on_initialize(_n: BlockNumberFor<T>) -> Weight {
|
||||
let processed = Self::process_slashes_queue(T::QueuedSlashesProcessedPerBlock::get());
|
||||
|
||||
if let Some(p) = processed {
|
||||
T::WeightInfo::process_slashes_queue(p)
|
||||
} else {
|
||||
T::WeightInfo::process_slashes_queue(0)
|
||||
match Self::process_slashes_queue() {
|
||||
ProcessSlashesQueueOutcome::Empty => T::WeightInfo::process_slashes_queue(0),
|
||||
ProcessSlashesQueueOutcome::Sent(count)
|
||||
| ProcessSlashesQueueOutcome::Requeued(count) => {
|
||||
T::WeightInfo::process_slashes_queue(count)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -655,70 +725,65 @@ where
|
|||
|
||||
impl<T: Config> Pallet<T> {
|
||||
fn add_era_slashes_to_queue(active_era: EraIndex) {
|
||||
let mut slashes: VecDeque<_> = Slashes::<T>::get(active_era).into();
|
||||
let slashes = Slashes::<T>::get(active_era);
|
||||
if slashes.is_empty() {
|
||||
return;
|
||||
}
|
||||
|
||||
let len = slashes.len();
|
||||
let batch_size = T::QueuedSlashesProcessedPerBlock::get().max(1) as usize;
|
||||
let mut enqueued = 0u32;
|
||||
|
||||
UnreportedSlashesQueue::<T>::mutate(|queue| queue.append(&mut slashes));
|
||||
for batch in slashes.chunks(batch_size) {
|
||||
if Self::unsent_queue_push((active_era, batch.to_vec())) {
|
||||
enqueued = enqueued.saturating_add(batch.len() as u32);
|
||||
} else {
|
||||
log::warn!(
|
||||
target: "ext_validators_slashes",
|
||||
"Unsent slash queue full, cannot enqueue era {active_era}",
|
||||
);
|
||||
Self::deposit_event(Event::<T>::UnsentQueueFull { era: active_era });
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if len > 0 {
|
||||
if enqueued > 0 {
|
||||
Self::deposit_event(Event::<T>::SlashAddedToQueue {
|
||||
number: len as u32,
|
||||
number: enqueued,
|
||||
era: active_era,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns number of slashes that were sent to ethereum.
|
||||
fn process_slashes_queue(amount: u32) -> Option<u32> {
|
||||
let mut slashes_to_send: Vec<SlashData<T::AccountId>> = vec![];
|
||||
let era_index = T::EraIndexProvider::active_era().index;
|
||||
fn slash_to_send_data(slash: &Slash<T::AccountId, T::SlashId>) -> SlashData<T::AccountId> {
|
||||
// Keep the original slash batch intact until delivery succeeds so failed
|
||||
// batches can be moved to the back of the queue instead of being dropped.
|
||||
let max_wad = T::MaxSlashWad::get();
|
||||
let wad_to_slash = (slash.percentage.deconstruct() as u128)
|
||||
.saturating_mul(max_wad)
|
||||
.checked_div(1_000_000_000u128)
|
||||
.unwrap_or(0)
|
||||
.min(max_wad);
|
||||
|
||||
UnreportedSlashesQueue::<T>::mutate(|queue| {
|
||||
for _ in 0..amount {
|
||||
let Some(slash) = queue.pop_front() else {
|
||||
// no more slashes to process in the queue
|
||||
break;
|
||||
};
|
||||
|
||||
// Convert Perbill to EigenLayer WAD format with linear mapping.
|
||||
// Perbill(100%) → MaxSlashWad (e.g. 5% WAD = 5e16).
|
||||
// Formula: perbill_inner * MaxSlashWad / 1e9
|
||||
// Clamp to MaxSlashWad to guard against overflow if governance
|
||||
// sets MaxSlashWad high enough for saturating_mul to hit u128::MAX.
|
||||
let max_wad = T::MaxSlashWad::get();
|
||||
let wad_to_slash = (slash.percentage.deconstruct() as u128)
|
||||
.saturating_mul(max_wad)
|
||||
.checked_div(1_000_000_000u128)
|
||||
.unwrap_or(0)
|
||||
.min(max_wad);
|
||||
|
||||
slashes_to_send.push(SlashData {
|
||||
validator: slash.validator,
|
||||
wad_to_slash,
|
||||
description: slash.offence_kind.to_description(),
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if slashes_to_send.is_empty() {
|
||||
return None;
|
||||
SlashData {
|
||||
validator: slash.validator.clone(),
|
||||
wad_to_slash,
|
||||
description: slash.offence_kind.to_description(),
|
||||
}
|
||||
}
|
||||
|
||||
let slashes_count = slashes_to_send.len() as u32;
|
||||
fn send_slashes_message(
|
||||
slashes_to_send: &[SlashData<T::AccountId>],
|
||||
era_index: EraIndex,
|
||||
) -> Option<H256> {
|
||||
let outbound =
|
||||
T::SendMessage::build(&slashes_to_send.to_vec(), era_index).or_else(|| {
|
||||
log::warn!(target: "ext_validators_slashes", "Failed to build outbound message");
|
||||
None
|
||||
})?;
|
||||
|
||||
let outbound = match T::SendMessage::build(&slashes_to_send, era_index) {
|
||||
Some(send_msg) => send_msg,
|
||||
None => {
|
||||
log::error!(target: "ext_validators_slashes", "Failed to build outbound message");
|
||||
return None;
|
||||
}
|
||||
};
|
||||
|
||||
// Validate and deliver the message
|
||||
let ticket = T::SendMessage::validate(outbound)
|
||||
.map_err(|e| {
|
||||
log::error!(
|
||||
log::warn!(
|
||||
target: "ext_validators_slashes",
|
||||
"Failed to validate outbound message: {:?}",
|
||||
e
|
||||
|
|
@ -726,20 +791,126 @@ impl<T: Config> Pallet<T> {
|
|||
})
|
||||
.ok()?;
|
||||
|
||||
let message_id = T::SendMessage::deliver(ticket)
|
||||
T::SendMessage::deliver(ticket)
|
||||
.map_err(|e| {
|
||||
log::error!(
|
||||
log::warn!(
|
||||
target: "ext_validators_slashes",
|
||||
"Failed to deliver outbound message: {:?}",
|
||||
e
|
||||
);
|
||||
})
|
||||
.ok()?;
|
||||
|
||||
Self::deposit_event(Event::<T>::SlashesMessageSent { message_id });
|
||||
|
||||
Some(slashes_count)
|
||||
.ok()
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub(crate) fn unsent_queue_is_empty() -> bool {
|
||||
UnsentSlashHead::<T>::get() == UnsentSlashTail::<T>::get()
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub(crate) fn unsent_queue_len() -> u32 {
|
||||
let head = UnsentSlashHead::<T>::get();
|
||||
let tail = UnsentSlashTail::<T>::get();
|
||||
tail.wrapping_sub(head) % UNSENT_QUEUE_CAPACITY
|
||||
}
|
||||
|
||||
pub(crate) fn unsent_queue_push(
|
||||
entry: (EraIndex, Vec<Slash<T::AccountId, T::SlashId>>),
|
||||
) -> bool {
|
||||
let head = UnsentSlashHead::<T>::get();
|
||||
let tail = UnsentSlashTail::<T>::get();
|
||||
let next_tail = (tail + 1) % UNSENT_QUEUE_CAPACITY;
|
||||
if next_tail == head {
|
||||
return false;
|
||||
}
|
||||
|
||||
UnsentSlashBatch::<T>::insert(tail, entry);
|
||||
UnsentSlashTail::<T>::put(next_tail);
|
||||
true
|
||||
}
|
||||
|
||||
fn unsent_queue_remove_slot(slot: u32) {
|
||||
let tail = UnsentSlashTail::<T>::get();
|
||||
let mut cur = slot;
|
||||
loop {
|
||||
let next = (cur + 1) % UNSENT_QUEUE_CAPACITY;
|
||||
if next == tail {
|
||||
break;
|
||||
}
|
||||
|
||||
if let Some(entry) = UnsentSlashBatch::<T>::get(next) {
|
||||
UnsentSlashBatch::<T>::insert(cur, entry);
|
||||
}
|
||||
cur = next;
|
||||
}
|
||||
|
||||
UnsentSlashBatch::<T>::remove(cur);
|
||||
let new_tail = if tail == 0 {
|
||||
UNSENT_QUEUE_CAPACITY - 1
|
||||
} else {
|
||||
tail - 1
|
||||
};
|
||||
UnsentSlashTail::<T>::put(new_tail);
|
||||
|
||||
let head = UnsentSlashHead::<T>::get();
|
||||
if head == tail {
|
||||
UnsentSlashHead::<T>::put(new_tail);
|
||||
}
|
||||
}
|
||||
|
||||
/// Retry contract shared with rewards:
|
||||
/// - process the current head batch,
|
||||
/// - if send succeeds, remove it from the queue,
|
||||
/// - if send fails, move the same batch to the back so later slash batches can progress.
|
||||
pub(crate) fn process_slashes_queue() -> ProcessSlashesQueueOutcome {
|
||||
let head = UnsentSlashHead::<T>::get();
|
||||
let tail = UnsentSlashTail::<T>::get();
|
||||
|
||||
if head == tail {
|
||||
return ProcessSlashesQueueOutcome::Empty;
|
||||
}
|
||||
|
||||
let Some((era_index, slashes)) = UnsentSlashBatch::<T>::get(head) else {
|
||||
UnsentSlashHead::<T>::put((head + 1) % UNSENT_QUEUE_CAPACITY);
|
||||
return ProcessSlashesQueueOutcome::Empty;
|
||||
};
|
||||
|
||||
let slashes_count = slashes.len() as u32;
|
||||
let slashes_to_send = slashes
|
||||
.iter()
|
||||
.map(Self::slash_to_send_data)
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
match Self::send_slashes_message(&slashes_to_send, era_index) {
|
||||
Some(message_id) => {
|
||||
UnsentSlashBatch::<T>::remove(head);
|
||||
UnsentSlashHead::<T>::put((head + 1) % UNSENT_QUEUE_CAPACITY);
|
||||
Self::deposit_event(Event::<T>::SlashesMessageSent { message_id });
|
||||
ProcessSlashesQueueOutcome::Sent(slashes_count)
|
||||
}
|
||||
None => {
|
||||
UnsentSlashBatch::<T>::remove(head);
|
||||
UnsentSlashHead::<T>::put((head + 1) % UNSENT_QUEUE_CAPACITY);
|
||||
UnsentSlashBatch::<T>::insert(tail, (era_index, slashes));
|
||||
UnsentSlashTail::<T>::put((tail + 1) % UNSENT_QUEUE_CAPACITY);
|
||||
log::warn!(
|
||||
target: "ext_validators_slashes",
|
||||
"Failed to send {slashes_count} slash entries for era {era_index}, moved batch to back of queue",
|
||||
);
|
||||
Self::deposit_event(Event::<T>::SlashesMessageSendFailed {
|
||||
era: era_index,
|
||||
count: slashes_count,
|
||||
});
|
||||
ProcessSlashesQueueOutcome::Requeued(slashes_count)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) enum ProcessSlashesQueueOutcome {
|
||||
Empty,
|
||||
Sent(u32),
|
||||
Requeued(u32),
|
||||
}
|
||||
|
||||
/// A pending slash record. The value of the slash has been computed but not applied yet,
|
||||
|
|
|
|||
|
|
@ -134,7 +134,9 @@ thread_local! {
|
|||
pub static SENT_ETHEREUM_MESSAGE_NONCE: RefCell<u64> = const { RefCell::new(0) };
|
||||
pub static MOCK_REPORT_OFFENCE_SHOULD_FAIL: RefCell<bool> = const { RefCell::new(false) };
|
||||
pub static MOCK_REPORT_OFFENCE_CALLED: RefCell<bool> = const { RefCell::new(false) };
|
||||
pub static MOCK_SEND_MESSAGE_SHOULD_FAIL: RefCell<bool> = const { RefCell::new(false) };
|
||||
pub static LAST_SENT_SLASHES: RefCell<Vec<crate::SlashData<AccountId>>> = RefCell::new(Vec::new());
|
||||
pub static LAST_BUILT_ERA: RefCell<Option<EraIndex>> = const { RefCell::new(None) };
|
||||
}
|
||||
|
||||
impl MockEraIndexProvider {
|
||||
|
|
@ -171,6 +173,7 @@ impl pallet_session::Config for Test {
|
|||
type ValidatorIdOf = ConvertInto;
|
||||
type NextSessionRotation = pallet_session::PeriodicSessions<Period, Offset>;
|
||||
type WeightInfo = ();
|
||||
type DisablingStrategy = ();
|
||||
}
|
||||
|
||||
sp_runtime::impl_opaque_keys! {
|
||||
|
|
@ -221,19 +224,32 @@ impl MockOkOutboundQueue {
|
|||
pub fn last_sent_slashes() -> Vec<crate::SlashData<AccountId>> {
|
||||
LAST_SENT_SLASHES.with(|r| r.borrow().clone())
|
||||
}
|
||||
|
||||
pub fn last_built_era() -> Option<EraIndex> {
|
||||
LAST_BUILT_ERA.with(|r| *r.borrow())
|
||||
}
|
||||
|
||||
pub fn set_should_fail(fail: bool) {
|
||||
MOCK_SEND_MESSAGE_SHOULD_FAIL.with(|r| *r.borrow_mut() = fail);
|
||||
}
|
||||
}
|
||||
impl crate::SendMessage<AccountId> for MockOkOutboundQueue {
|
||||
type Ticket = ();
|
||||
type Message = ();
|
||||
fn build(slashes: &Vec<crate::SlashData<AccountId>>, _: u32) -> Option<Self::Ticket> {
|
||||
fn build(slashes: &Vec<crate::SlashData<AccountId>>, era: u32) -> Option<Self::Ticket> {
|
||||
LAST_SENT_SLASHES.with(|r| *r.borrow_mut() = slashes.clone());
|
||||
LAST_BUILT_ERA.with(|r| *r.borrow_mut() = Some(era));
|
||||
Some(())
|
||||
}
|
||||
fn validate(_: Self::Ticket) -> Result<Self::Ticket, SendError> {
|
||||
Ok(())
|
||||
}
|
||||
fn deliver(_: Self::Ticket) -> Result<H256, SendError> {
|
||||
Ok(H256::zero())
|
||||
if MOCK_SEND_MESSAGE_SHOULD_FAIL.with(|r| *r.borrow()) {
|
||||
Err(SendError::MessageTooLarge)
|
||||
} else {
|
||||
Ok(H256::zero())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -270,6 +286,7 @@ impl external_validator_slashes::Config for Test {
|
|||
type QueuedSlashesProcessedPerBlock = ConstU32<20>;
|
||||
type WeightInfo = ();
|
||||
type SendMessage = MockOkOutboundQueue;
|
||||
type GovernanceOrigin = frame_system::EnsureRoot<u64>;
|
||||
}
|
||||
|
||||
pub struct FullIdentificationOf;
|
||||
|
|
@ -285,6 +302,9 @@ impl pallet_session::historical::Config for Test {
|
|||
}
|
||||
// Build genesis storage according to the mock runtime.
|
||||
pub fn new_test_ext() -> sp_io::TestExternalities {
|
||||
MOCK_SEND_MESSAGE_SHOULD_FAIL.with(|r| *r.borrow_mut() = false);
|
||||
LAST_SENT_SLASHES.with(|r| r.borrow_mut().clear());
|
||||
LAST_BUILT_ERA.with(|r| *r.borrow_mut() = None);
|
||||
system::GenesisConfig::<Test>::default()
|
||||
.build_storage()
|
||||
.unwrap()
|
||||
|
|
|
|||
|
|
@ -28,6 +28,40 @@ use {
|
|||
sp_staking::offence::ReportOffence,
|
||||
};
|
||||
|
||||
fn queued_slash_ids() -> Vec<u32> {
|
||||
let mut queued = Vec::new();
|
||||
let mut slot = UnsentSlashHead::<Test>::get();
|
||||
let tail = UnsentSlashTail::<Test>::get();
|
||||
|
||||
while slot != tail {
|
||||
if let Some((_, batch)) = UnsentSlashBatch::<Test>::get(slot) {
|
||||
queued.extend(batch.into_iter().map(|slash| slash.slash_id));
|
||||
}
|
||||
slot = (slot + 1) % UNSENT_QUEUE_CAPACITY;
|
||||
}
|
||||
|
||||
queued
|
||||
}
|
||||
|
||||
fn queued_batch_eras() -> Vec<u32> {
|
||||
let mut queued = Vec::new();
|
||||
let mut slot = UnsentSlashHead::<Test>::get();
|
||||
let tail = UnsentSlashTail::<Test>::get();
|
||||
|
||||
while slot != tail {
|
||||
if let Some((era, _)) = UnsentSlashBatch::<Test>::get(slot) {
|
||||
queued.push(era);
|
||||
}
|
||||
slot = (slot + 1) % UNSENT_QUEUE_CAPACITY;
|
||||
}
|
||||
|
||||
queued
|
||||
}
|
||||
|
||||
fn unsent_queue_len() -> u32 {
|
||||
ExternalValidatorSlashes::unsent_queue_len()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn root_can_inject_manual_offence() {
|
||||
new_test_ext().execute_with(|| {
|
||||
|
|
@ -574,14 +608,228 @@ fn test_on_offence_defer_period_0_messages_get_queued() {
|
|||
|
||||
assert_eq!(Slashes::<Test>::get(get_slashing_era(1)).len(), 25);
|
||||
start_era(2, 2, 2);
|
||||
assert_eq!(UnreportedSlashesQueue::<Test>::get().len(), 25);
|
||||
assert_eq!(unsent_queue_len(), 2);
|
||||
assert_eq!(queued_batch_eras(), vec![2, 2]);
|
||||
|
||||
// this triggers on_initialize
|
||||
run_block();
|
||||
assert_eq!(UnreportedSlashesQueue::<Test>::get().len(), 5);
|
||||
assert_eq!(unsent_queue_len(), 1);
|
||||
assert_eq!(queued_slash_ids(), (20..25).collect::<Vec<_>>());
|
||||
|
||||
run_block();
|
||||
assert_eq!(UnreportedSlashesQueue::<Test>::get().len(), 0);
|
||||
assert!(ExternalValidatorSlashes::unsent_queue_is_empty());
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn failed_slashes_batch_is_moved_to_back_of_queue() {
|
||||
new_test_ext().execute_with(|| {
|
||||
crate::mock::DeferPeriodGetter::with_defer_period(0);
|
||||
MockOkOutboundQueue::set_should_fail(true);
|
||||
|
||||
start_era(0, 0, 0);
|
||||
start_era(1, 1, 1);
|
||||
|
||||
for i in 0..25 {
|
||||
PendingOffenceKind::<Test>::insert(0, 3 + i, OffenceKind::LivenessOffence);
|
||||
Pallet::<Test>::on_offence(
|
||||
&[OffenceDetails {
|
||||
offender: (3 + i, ()),
|
||||
reporters: vec![],
|
||||
}],
|
||||
&[Perbill::from_percent(75)],
|
||||
0,
|
||||
);
|
||||
}
|
||||
|
||||
start_era(2, 2, 2);
|
||||
assert_eq!(queued_slash_ids(), (0..25).collect::<Vec<_>>());
|
||||
assert_eq!(queued_batch_eras(), vec![2, 2]);
|
||||
|
||||
run_block();
|
||||
|
||||
assert_eq!(unsent_queue_len(), 2);
|
||||
assert_eq!(
|
||||
queued_slash_ids(),
|
||||
(20..25).chain(0..20).collect::<Vec<_>>()
|
||||
);
|
||||
System::assert_has_event(RuntimeEvent::ExternalValidatorSlashes(
|
||||
crate::Event::SlashesMessageSendFailed { era: 2, count: 20 },
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn failed_slashes_batch_retries_after_send_is_reenabled() {
|
||||
new_test_ext().execute_with(|| {
|
||||
crate::mock::DeferPeriodGetter::with_defer_period(0);
|
||||
MockOkOutboundQueue::set_should_fail(true);
|
||||
|
||||
start_era(0, 0, 0);
|
||||
start_era(1, 1, 1);
|
||||
|
||||
for i in 0..25 {
|
||||
PendingOffenceKind::<Test>::insert(0, 3 + i, OffenceKind::LivenessOffence);
|
||||
Pallet::<Test>::on_offence(
|
||||
&[OffenceDetails {
|
||||
offender: (3 + i, ()),
|
||||
reporters: vec![],
|
||||
}],
|
||||
&[Perbill::from_percent(75)],
|
||||
0,
|
||||
);
|
||||
}
|
||||
|
||||
start_era(2, 2, 2);
|
||||
run_block();
|
||||
assert_eq!(
|
||||
queued_slash_ids(),
|
||||
(20..25).chain(0..20).collect::<Vec<_>>()
|
||||
);
|
||||
|
||||
start_era(3, 3, 3);
|
||||
MockOkOutboundQueue::set_should_fail(false);
|
||||
|
||||
run_block();
|
||||
assert_eq!(unsent_queue_len(), 1);
|
||||
assert_eq!(queued_slash_ids(), (0..20).collect::<Vec<_>>());
|
||||
assert_eq!(MockOkOutboundQueue::last_sent_slashes().len(), 5);
|
||||
assert_eq!(MockOkOutboundQueue::last_built_era(), Some(2));
|
||||
System::assert_has_event(RuntimeEvent::ExternalValidatorSlashes(
|
||||
crate::Event::SlashesMessageSent {
|
||||
message_id: Default::default(),
|
||||
},
|
||||
));
|
||||
|
||||
run_block();
|
||||
assert!(ExternalValidatorSlashes::unsent_queue_is_empty());
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn retry_extrinsic_succeeds_for_matching_era() {
|
||||
new_test_ext().execute_with(|| {
|
||||
crate::mock::DeferPeriodGetter::with_defer_period(0);
|
||||
|
||||
start_era(0, 0, 0);
|
||||
start_era(1, 1, 1);
|
||||
|
||||
for i in 0..25 {
|
||||
PendingOffenceKind::<Test>::insert(0, 3 + i, OffenceKind::LivenessOffence);
|
||||
Pallet::<Test>::on_offence(
|
||||
&[OffenceDetails {
|
||||
offender: (3 + i, ()),
|
||||
reporters: vec![],
|
||||
}],
|
||||
&[Perbill::from_percent(75)],
|
||||
0,
|
||||
);
|
||||
}
|
||||
|
||||
start_era(2, 2, 2);
|
||||
start_era(5, 5, 5);
|
||||
|
||||
assert_ok!(ExternalValidatorSlashes::retry_unsent_slash_era(
|
||||
RuntimeOrigin::root(),
|
||||
2,
|
||||
));
|
||||
|
||||
assert_eq!(unsent_queue_len(), 1);
|
||||
assert_eq!(queued_slash_ids(), (20..25).collect::<Vec<_>>());
|
||||
assert_eq!(MockOkOutboundQueue::last_built_era(), Some(2));
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn retry_extrinsic_errors_when_era_not_queued() {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_noop!(
|
||||
ExternalValidatorSlashes::retry_unsent_slash_era(RuntimeOrigin::root(), 2),
|
||||
Error::<Test>::EraNotInUnsentQueue
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn retry_extrinsic_requires_root() {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_noop!(
|
||||
ExternalValidatorSlashes::retry_unsent_slash_era(RuntimeOrigin::signed(1), 2),
|
||||
sp_runtime::DispatchError::BadOrigin
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn retry_extrinsic_preserves_failed_batch_when_send_still_fails() {
|
||||
new_test_ext().execute_with(|| {
|
||||
crate::mock::DeferPeriodGetter::with_defer_period(0);
|
||||
MockOkOutboundQueue::set_should_fail(true);
|
||||
|
||||
start_era(0, 0, 0);
|
||||
start_era(1, 1, 1);
|
||||
|
||||
for i in 0..25 {
|
||||
PendingOffenceKind::<Test>::insert(0, 3 + i, OffenceKind::LivenessOffence);
|
||||
Pallet::<Test>::on_offence(
|
||||
&[OffenceDetails {
|
||||
offender: (3 + i, ()),
|
||||
reporters: vec![],
|
||||
}],
|
||||
&[Perbill::from_percent(75)],
|
||||
0,
|
||||
);
|
||||
}
|
||||
|
||||
start_era(2, 2, 2);
|
||||
let before = queued_slash_ids();
|
||||
|
||||
assert_noop!(
|
||||
ExternalValidatorSlashes::retry_unsent_slash_era(RuntimeOrigin::root(), 2),
|
||||
Error::<Test>::MessageSendFailed
|
||||
);
|
||||
|
||||
assert_eq!(queued_slash_ids(), before);
|
||||
assert_eq!(unsent_queue_len(), 2);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unsent_queue_full_emits_event() {
|
||||
new_test_ext().execute_with(|| {
|
||||
crate::mock::DeferPeriodGetter::with_defer_period(0);
|
||||
|
||||
for i in 0..63u32 {
|
||||
let slash = Slash {
|
||||
validator: 1000 + i as u64,
|
||||
reporters: vec![],
|
||||
slash_id: i,
|
||||
percentage: Perbill::from_percent(1),
|
||||
confirmed: true,
|
||||
offence_kind: OffenceKind::LivenessOffence,
|
||||
};
|
||||
assert!(ExternalValidatorSlashes::unsent_queue_push((
|
||||
1,
|
||||
vec![slash]
|
||||
)));
|
||||
}
|
||||
|
||||
Slashes::<Test>::insert(
|
||||
2,
|
||||
vec![Slash {
|
||||
validator: 5000u64,
|
||||
reporters: vec![],
|
||||
slash_id: 999,
|
||||
percentage: Perbill::from_percent(10),
|
||||
confirmed: true,
|
||||
offence_kind: OffenceKind::LivenessOffence,
|
||||
}],
|
||||
);
|
||||
|
||||
start_era(2, 2, 2);
|
||||
|
||||
assert_eq!(unsent_queue_len(), 63);
|
||||
assert_eq!(Slashes::<Test>::get(2).len(), 1);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -628,14 +876,13 @@ fn test_on_offence_defer_period_0_messages_get_queued_across_eras() {
|
|||
}
|
||||
assert_eq!(Slashes::<Test>::get(get_slashing_era(1)).len(), 25);
|
||||
start_era(2, 2, 2);
|
||||
assert_eq!(UnreportedSlashesQueue::<Test>::get().len(), 25);
|
||||
assert_eq!(unsent_queue_len(), 2);
|
||||
|
||||
// this triggers on_initialize
|
||||
run_block();
|
||||
assert_eq!(UnreportedSlashesQueue::<Test>::get().len(), 5);
|
||||
assert_eq!(unsent_queue_len(), 1);
|
||||
assert_eq!(queued_slash_ids(), (20..25).collect::<Vec<_>>());
|
||||
|
||||
// We have 5 non-dispatched, which should accumulate
|
||||
// We shoulld have 30 after we initialie era 3
|
||||
for i in 0..25 {
|
||||
PendingOffenceKind::<Test>::insert(2, 3 + i, OffenceKind::LivenessOffence);
|
||||
Pallet::<Test>::on_offence(
|
||||
|
|
@ -651,15 +898,20 @@ fn test_on_offence_defer_period_0_messages_get_queued_across_eras() {
|
|||
}
|
||||
|
||||
start_era(3, 3, 3);
|
||||
assert_eq!(UnreportedSlashesQueue::<Test>::get().len(), 30);
|
||||
assert_eq!(unsent_queue_len(), 3);
|
||||
assert_eq!(queued_batch_eras(), vec![2, 3, 3]);
|
||||
|
||||
// this triggers on_initialize
|
||||
run_block();
|
||||
assert_eq!(UnreportedSlashesQueue::<Test>::get().len(), 10);
|
||||
assert_eq!(unsent_queue_len(), 2);
|
||||
assert_eq!(queued_batch_eras(), vec![3, 3]);
|
||||
|
||||
// this triggers on_initialize
|
||||
run_block();
|
||||
assert_eq!(UnreportedSlashesQueue::<Test>::get().len(), 0);
|
||||
assert_eq!(unsent_queue_len(), 1);
|
||||
|
||||
run_block();
|
||||
assert!(ExternalValidatorSlashes::unsent_queue_is_empty());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ pub trait WeightInfo {
|
|||
fn force_inject_slash() -> Weight;
|
||||
fn root_test_send_msg_to_eth() -> Weight;
|
||||
fn process_slashes_queue(s: u32, ) -> Weight;
|
||||
fn retry_unsent_slash_era() -> Weight;
|
||||
fn set_slashing_mode() -> Weight;
|
||||
}
|
||||
|
||||
|
|
@ -136,6 +137,11 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
|
|||
.saturating_add(Weight::from_parts(0, 42).saturating_mul(s.into()))
|
||||
}
|
||||
|
||||
fn retry_unsent_slash_era() -> Weight {
|
||||
// Same as the success path for one queued batch.
|
||||
Self::process_slashes_queue(10)
|
||||
}
|
||||
|
||||
fn set_slashing_mode() -> Weight {
|
||||
Weight::from_parts(7_402_000, 3601)
|
||||
.saturating_add(T::DbWeight::get().reads(1_u64))
|
||||
|
|
@ -221,6 +227,10 @@ impl WeightInfo for () {
|
|||
.saturating_add(Weight::from_parts(0, 42).saturating_mul(s.into()))
|
||||
}
|
||||
|
||||
fn retry_unsent_slash_era() -> Weight {
|
||||
Self::process_slashes_queue(10)
|
||||
}
|
||||
|
||||
fn set_slashing_mode() -> Weight {
|
||||
Weight::from_parts(7_402_000, 3601)
|
||||
.saturating_add(RocksDbWeight::get().reads(1_u64))
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ frame-system = { workspace = true }
|
|||
sp-core = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-staking = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
|
||||
frame-benchmarking = { workspace = true }
|
||||
|
||||
|
|
@ -58,7 +57,6 @@ std = [
|
|||
"sp-io/std",
|
||||
"sp-runtime/std",
|
||||
"sp-staking/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"frame-benchmarking/runtime-benchmarks",
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ use {
|
|||
crate::types::BenchmarkHelper,
|
||||
frame_benchmarking::{account, v2::*, BenchmarkError},
|
||||
frame_support::traits::{Currency, EnsureOrigin},
|
||||
sp_std::prelude::*,
|
||||
};
|
||||
|
||||
const SEED: u32 = 0;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
//! Storage will be cleared after a period of time.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
extern crate alloc;
|
||||
|
||||
#[cfg(test)]
|
||||
mod mock;
|
||||
|
|
@ -33,6 +34,7 @@ pub mod weights;
|
|||
|
||||
pub use pallet::*;
|
||||
|
||||
use alloc::vec::Vec;
|
||||
use {
|
||||
crate::types::{EraRewardsUtils, HandleInflation, SendMessage},
|
||||
frame_support::traits::{Get, ValidatorSet},
|
||||
|
|
@ -44,7 +46,6 @@ use {
|
|||
Perbill,
|
||||
},
|
||||
sp_staking::SessionIndex,
|
||||
sp_std::vec::Vec,
|
||||
};
|
||||
|
||||
/// Trait for checking if a validator has been slashed in a given era
|
||||
|
|
@ -65,10 +66,10 @@ pub mod pallet {
|
|||
use sp_runtime::PerThing;
|
||||
|
||||
pub use crate::weights::WeightInfo;
|
||||
use alloc::collections::BTreeMap;
|
||||
use {
|
||||
super::*, frame_support::pallet_prelude::*, frame_system::pallet_prelude::OriginFor,
|
||||
pallet_external_validators::traits::EraIndexProvider, sp_runtime::Saturating,
|
||||
sp_std::collections::btree_map::BTreeMap,
|
||||
};
|
||||
|
||||
/// The current storage version.
|
||||
|
|
|
|||
|
|
@ -283,6 +283,7 @@ impl HandleInflation<H160> for InflationMinter {
|
|||
// Pallet to provide some mock data, used to test
|
||||
#[frame_support::pallet]
|
||||
pub mod mock_data {
|
||||
use alloc::vec::Vec;
|
||||
use {
|
||||
frame_support::pallet_prelude::*,
|
||||
pallet_external_validators::traits::{ActiveEraInfo, EraIndex, EraIndexProvider},
|
||||
|
|
@ -293,9 +294,9 @@ pub mod mock_data {
|
|||
pub active_era: Option<ActiveEraInfo>,
|
||||
pub era_inflation: Option<u128>,
|
||||
/// Set of validators that are considered offline (for liveness testing)
|
||||
pub offline_validators: sp_std::vec::Vec<sp_core::H160>,
|
||||
pub offline_validators: Vec<sp_core::H160>,
|
||||
/// Set of (era_index, validator_id) pairs that are slashed
|
||||
pub slashed_validators: sp_std::vec::Vec<(u32, sp_core::H160)>,
|
||||
pub slashed_validators: Vec<(u32, sp_core::H160)>,
|
||||
/// When true, MockOkOutboundQueue::validate will return Err(SendError::MessageTooLarge)
|
||||
pub send_message_fails: bool,
|
||||
}
|
||||
|
|
@ -357,9 +358,12 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
|
|||
ExistentialDeposit::get(),
|
||||
), // Rewards account needs existential deposit
|
||||
];
|
||||
pallet_balances::GenesisConfig::<Test> { balances }
|
||||
.assimilate_storage(&mut t)
|
||||
.unwrap();
|
||||
pallet_balances::GenesisConfig::<Test> {
|
||||
balances,
|
||||
dev_accounts: Default::default(),
|
||||
}
|
||||
.assimilate_storage(&mut t)
|
||||
.unwrap();
|
||||
|
||||
let ext: sp_io::TestExternalities = t.into();
|
||||
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@
|
|||
|
||||
use {
|
||||
crate::{self as pallet_external_validators_rewards, mock::*},
|
||||
alloc::collections::btree_map::BTreeMap,
|
||||
frame_support::{assert_noop, assert_ok, traits::fungible::Mutate},
|
||||
pallet_external_validators::traits::{ActiveEraInfo, OnEraEnd, OnEraStart},
|
||||
sp_core::H160,
|
||||
sp_std::collections::btree_map::BTreeMap,
|
||||
};
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with Tanssi. If not, see <http://www.gnu.org/licenses/>
|
||||
|
||||
use alloc::vec::Vec;
|
||||
use snowbridge_outbound_queue_primitives::SendError;
|
||||
use sp_core::{H160, H256};
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
/// Data needed for EigenLayer rewards submission via Snowbridge.
|
||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
|
||||
use sp_std::marker::PhantomData;
|
||||
use core::marker::PhantomData;
|
||||
|
||||
/// Weight functions needed for pallet_external_validators_rewards.
|
||||
pub trait WeightInfo {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ frame-system = { workspace = true }
|
|||
impl-trait-for-tuples = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-staking = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
sp-core = { workspace = true }
|
||||
|
||||
frame-benchmarking = { workspace = true }
|
||||
|
|
@ -56,7 +55,6 @@ std = [
|
|||
"sp-io/std",
|
||||
"sp-runtime/std",
|
||||
"sp-staking/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"frame-benchmarking/runtime-benchmarks",
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ use {
|
|||
pallet_session::{self as session, SessionManager},
|
||||
rand::{RngCore, SeedableRng},
|
||||
sp_runtime::{codec, traits::Convert},
|
||||
sp_std::prelude::*,
|
||||
};
|
||||
const SEED: u32 = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,16 +31,17 @@
|
|||
//! The structure of this pallet and the concept of eras is inspired by `pallet_staking` from Polkadot.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
extern crate alloc;
|
||||
|
||||
pub use pallet::*;
|
||||
use {
|
||||
alloc::{collections::btree_set::BTreeSet, vec::Vec},
|
||||
frame_support::pallet_prelude::Weight,
|
||||
log::log,
|
||||
parity_scale_codec::{Decode, Encode, MaxEncodedLen},
|
||||
parity_scale_codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen},
|
||||
scale_info::TypeInfo,
|
||||
sp_runtime::{traits::Get, RuntimeDebug},
|
||||
sp_staking::SessionIndex,
|
||||
sp_std::{collections::btree_set::BTreeSet, vec::Vec},
|
||||
traits::{
|
||||
ActiveEraInfo, EraIndex, EraIndexProvider, ExternalIndexProvider, InvulnerablesProvider,
|
||||
OnEraEnd, OnEraStart, ValidatorProvider,
|
||||
|
|
@ -92,6 +93,7 @@ pub mod pallet {
|
|||
use frame_support::traits::Currency;
|
||||
use {
|
||||
super::*,
|
||||
alloc::vec::Vec,
|
||||
frame_support::{
|
||||
dispatch::DispatchResultWithPostInfo,
|
||||
pallet_prelude::*,
|
||||
|
|
@ -101,7 +103,6 @@ pub mod pallet {
|
|||
frame_system::pallet_prelude::*,
|
||||
sp_core::H160,
|
||||
sp_runtime::{traits::Convert, SaturatedConversion},
|
||||
sp_std::vec::Vec,
|
||||
};
|
||||
|
||||
/// Configure the pallet by specifying the parameters and types on which it depends.
|
||||
|
|
@ -255,7 +256,7 @@ pub mod pallet {
|
|||
// T::ValidatorId does not impl Ord or Hash so we cannot collect into set directly,
|
||||
// but we can check for duplicates if we encode them first.
|
||||
.map(|x| x.encode())
|
||||
.collect::<sp_std::collections::btree_set::BTreeSet<_>>();
|
||||
.collect::<alloc::collections::btree_set::BTreeSet<_>>();
|
||||
assert!(
|
||||
duplicate_validators.len() == self.whitelisted_validators.len(),
|
||||
"duplicate validators in genesis."
|
||||
|
|
@ -763,7 +764,17 @@ impl<T: Config> InvulnerablesProvider<T::ValidatorId> for Pallet<T> {
|
|||
|
||||
/// Mode of era-forcing.
|
||||
#[derive(
|
||||
Copy, Clone, PartialEq, Eq, Default, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen,
|
||||
Copy,
|
||||
Clone,
|
||||
PartialEq,
|
||||
Eq,
|
||||
Default,
|
||||
Encode,
|
||||
Decode,
|
||||
RuntimeDebug,
|
||||
TypeInfo,
|
||||
MaxEncodedLen,
|
||||
DecodeWithMemTracking,
|
||||
)]
|
||||
pub enum Forcing {
|
||||
/// Not forcing anything - just let whatever happen.
|
||||
|
|
|
|||
|
|
@ -199,6 +199,7 @@ impl pallet_session::Config for Test {
|
|||
type SessionHandler = TestSessionHandler;
|
||||
type Keys = MockSessionKeys;
|
||||
type WeightInfo = ();
|
||||
type DisablingStrategy = ();
|
||||
}
|
||||
|
||||
// Pallet to provide some mock data, used to test
|
||||
|
|
@ -298,9 +299,12 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
|
|||
keys,
|
||||
..Default::default()
|
||||
};
|
||||
pallet_balances::GenesisConfig::<Test> { balances }
|
||||
.assimilate_storage(&mut t)
|
||||
.unwrap();
|
||||
pallet_balances::GenesisConfig::<Test> {
|
||||
balances,
|
||||
dev_accounts: Default::default(),
|
||||
}
|
||||
.assimilate_storage(&mut t)
|
||||
.unwrap();
|
||||
pallet_external_validators::GenesisConfig::<Test> {
|
||||
skip_external_validators: false,
|
||||
whitelisted_validators,
|
||||
|
|
|
|||
|
|
@ -14,12 +14,12 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with Tanssi. If not, see <http://www.gnu.org/licenses/>
|
||||
|
||||
use alloc::vec::Vec;
|
||||
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
|
||||
use scale_info::TypeInfo;
|
||||
use snowbridge_outbound_queue_primitives::SendError;
|
||||
use sp_core::H256;
|
||||
use sp_runtime::RuntimeDebug;
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
/// Information regarding the active era (era in used in session).
|
||||
#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)]
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
|
||||
use sp_std::marker::PhantomData;
|
||||
use core::marker::PhantomData;
|
||||
|
||||
/// Weight functions needed for pallet_external_validators.
|
||||
pub trait WeightInfo {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ sp-application-crypto = { workspace = true }
|
|||
sp-core = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-session = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
|
|
@ -42,7 +41,6 @@ std = [
|
|||
"sp-core/std",
|
||||
"sp-runtime/std",
|
||||
"sp-session/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"frame-benchmarking/runtime-benchmarks",
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ pallet-balances = { workspace = true }
|
|||
sp-core = { workspace = true }
|
||||
sp-io = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
|
||||
xcm = { workspace = true }
|
||||
xcm-builder = { workspace = true }
|
||||
|
|
@ -87,7 +86,6 @@ std = [
|
|||
"sp-core/std",
|
||||
"sp-io/std",
|
||||
"sp-runtime/std",
|
||||
"sp-std/std",
|
||||
"tracing/std",
|
||||
"xcm-builder/std",
|
||||
"xcm-executor/std",
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ snowbridge-beacon-primitives = { workspace = true }
|
|||
snowbridge-core = { workspace = true }
|
||||
snowbridge-inbound-queue-primitives = { workspace = true }
|
||||
sp-core = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
|
|
@ -33,5 +32,4 @@ std = [
|
|||
"snowbridge-core/std",
|
||||
"snowbridge-inbound-queue-primitives/std",
|
||||
"sp-core/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-FileCopyrightText: 2023 Snowfork <hello@snowfork.com>
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
extern crate alloc;
|
||||
|
||||
pub mod register_token;
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
// Generated, do not edit!
|
||||
// See ethereum client README.md for instructions to generate
|
||||
|
||||
use alloc::vec;
|
||||
use hex_literal::hex;
|
||||
use snowbridge_beacon_primitives::{
|
||||
types::deneb, AncestryProof, BeaconHeader, ExecutionProof, VersionedExecutionPayloadHeader,
|
||||
};
|
||||
use snowbridge_inbound_queue_primitives::{EventProof, InboundQueueFixture, Log, Proof};
|
||||
use sp_core::U256;
|
||||
use sp_std::vec;
|
||||
|
||||
pub fn make_register_token_message() -> InboundQueueFixture {
|
||||
InboundQueueFixture {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ mod mock;
|
|||
mod test;
|
||||
|
||||
pub use crate::weights::WeightInfo;
|
||||
use alloc::boxed::Box;
|
||||
use frame_system::ensure_signed;
|
||||
use snowbridge_core::{
|
||||
sparse_bitmap::{SparseBitmap, SparseBitmapImpl},
|
||||
|
|
@ -48,7 +49,6 @@ use snowbridge_inbound_queue_primitives::{
|
|||
};
|
||||
use sp_core::H160;
|
||||
use sp_runtime::traits::Zero;
|
||||
use sp_std::prelude::*;
|
||||
use xcm::prelude::*;
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
// SPDX-FileCopyrightText: 2023 Snowfork <hello@snowfork.com>
|
||||
use super::*;
|
||||
use codec::Encode;
|
||||
use core::marker::PhantomData;
|
||||
use frame_support::traits::Get;
|
||||
use sp_runtime::traits::TryConvert;
|
||||
use sp_runtime::DispatchError;
|
||||
use sp_std::marker::PhantomData;
|
||||
use xcm::prelude::{ExecuteXcm, Location, Parachain, SendError, SendXcm, XcmHash};
|
||||
|
||||
/// A message processor that simply returns the Blake2_256 hash of the SCALE encoded message
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ use super::*;
|
|||
|
||||
use crate::{self as inbound_queue_v2, message_processors::XcmMessageProcessor};
|
||||
use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
|
||||
use core::{convert::From, default::Default, marker::PhantomData};
|
||||
use frame_support::{derive_impl, parameter_types, traits::ConstU32};
|
||||
use hex_literal::hex;
|
||||
use scale_info::TypeInfo;
|
||||
|
|
@ -17,7 +18,6 @@ use sp_runtime::{
|
|||
traits::{IdentityLookup, MaybeEquivalence, TryConvert},
|
||||
BuildStorage, DispatchError,
|
||||
};
|
||||
use sp_std::{convert::From, default::Default, marker::PhantomData};
|
||||
use xcm::{opaque::latest::WESTEND_GENESIS_HASH, prelude::*};
|
||||
type Block = frame_system::mocking::MockBlock<Test>;
|
||||
pub use snowbridge_test_utils::mock_xcm::{MockXcmExecutor, MockXcmSender};
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
|
||||
use sp_std::marker::PhantomData;
|
||||
use core::marker::PhantomData;
|
||||
|
||||
/// Weight functions needed for ethereum_beacon_client.
|
||||
pub trait WeightInfo {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ sp-arithmetic = { workspace = true }
|
|||
sp-core = { workspace = true }
|
||||
sp-io = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
|
||||
bp-relayers = { workspace = true }
|
||||
bridge-hub-common = { workspace = true }
|
||||
|
|
@ -82,7 +81,6 @@ std = [
|
|||
"sp-core/std",
|
||||
"sp-io/std",
|
||||
"sp-runtime/std",
|
||||
"sp-std/std",
|
||||
"xcm-builder/std",
|
||||
"xcm-executor/std",
|
||||
"xcm/std",
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ snowbridge-core = { workspace = true }
|
|||
snowbridge-merkle-tree = { workspace = true }
|
||||
snowbridge-outbound-queue-primitives = { workspace = true }
|
||||
sp-api = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
xcm = { workspace = true }
|
||||
|
||||
[features]
|
||||
|
|
@ -35,6 +34,5 @@ std = [
|
|||
"snowbridge-merkle-tree/std",
|
||||
"snowbridge-outbound-queue-primitives/std",
|
||||
"sp-api/std",
|
||||
"sp-std/std",
|
||||
"xcm/std",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -21,6 +21,9 @@ use crate::Pallet as OutboundQueue;
|
|||
)]
|
||||
mod benchmarks {
|
||||
use super::*;
|
||||
use alloc::boxed::Box;
|
||||
use alloc::vec;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
/// Build `Upgrade` message with `MaxMessagePayloadSize`, in the worst-case.
|
||||
fn build_message<T: Config>() -> (Message, OutboundMessage) {
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
// Generated, do not edit!
|
||||
// See ethereum client README.md for instructions to generate
|
||||
|
||||
use alloc::vec;
|
||||
use hex_literal::hex;
|
||||
use snowbridge_beacon_primitives::{
|
||||
types::deneb, AncestryProof, BeaconHeader, ExecutionProof, VersionedExecutionPayloadHeader,
|
||||
};
|
||||
use snowbridge_verification_primitives::{EventFixture, EventProof, Log, Proof};
|
||||
use sp_core::U256;
|
||||
use sp_std::vec;
|
||||
|
||||
pub fn make_submit_delivery_receipt_message() -> EventFixture {
|
||||
EventFixture {
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@
|
|||
//!
|
||||
//! * `prove_message`: Generate a merkle proof for a committed message
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
extern crate alloc;
|
||||
|
||||
pub mod api;
|
||||
pub mod process_message_impl;
|
||||
pub mod send_message_impl;
|
||||
|
|
@ -93,7 +95,6 @@ use sp_runtime::{
|
|||
traits::{BlockNumberProvider, Hash, MaybeEquivalence},
|
||||
DigestItem,
|
||||
};
|
||||
use sp_std::prelude::*;
|
||||
pub use types::{OnNewCommitment, PendingOrder, ProcessMessageOriginOf};
|
||||
pub use weights::WeightInfo;
|
||||
use xcm::latest::{Location, NetworkId};
|
||||
|
|
@ -107,6 +108,8 @@ pub use pallet::*;
|
|||
#[frame_support::pallet]
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
use alloc::boxed::Box;
|
||||
use alloc::vec::Vec;
|
||||
use frame_support::pallet_prelude::*;
|
||||
use frame_system::pallet_prelude::*;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ use frame_support::{
|
|||
};
|
||||
|
||||
use codec::{DecodeWithMemTracking, Encode, MaxEncodedLen};
|
||||
use core::marker::PhantomData;
|
||||
use hex_literal::hex;
|
||||
use scale_info::TypeInfo;
|
||||
use snowbridge_core::{
|
||||
|
|
@ -23,7 +24,6 @@ use sp_runtime::{
|
|||
traits::{BlakeTwo256, IdentityLookup, Keccak256},
|
||||
AccountId32, BuildStorage, FixedU128,
|
||||
};
|
||||
use sp_std::marker::PhantomData;
|
||||
use xcm::prelude::Here;
|
||||
use xcm_executor::traits::ConvertLocation;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ use scale_info::TypeInfo;
|
|||
pub use snowbridge_merkle_tree::MerkleProof;
|
||||
use sp_core::H256;
|
||||
use sp_runtime::RuntimeDebug;
|
||||
use sp_std::prelude::*;
|
||||
|
||||
pub type ProcessMessageOriginOf<T> = <Pallet<T> as ProcessMessage>::Origin;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ frame-system = { workspace = true }
|
|||
pallet-proxy = { workspace = true }
|
||||
scale-info = { workspace = true, features = ["derive"] }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
pallet-balances = { workspace = true, features = ["insecure_zero_ed", "std"] }
|
||||
|
|
@ -30,7 +29,6 @@ std = [
|
|||
"pallet-proxy/std",
|
||||
"scale-info/std",
|
||||
"sp-runtime/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
try-runtime = [
|
||||
"frame-support/try-runtime",
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
//! obstacles to including it here.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
extern crate alloc;
|
||||
|
||||
#[cfg(test)]
|
||||
mod mock;
|
||||
|
|
@ -32,9 +33,9 @@ pub use pallet::*;
|
|||
|
||||
#[pallet]
|
||||
pub mod pallet {
|
||||
use alloc::vec::Vec;
|
||||
use frame_support::pallet_prelude::*;
|
||||
use frame_system::pallet_prelude::BlockNumberFor;
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
/// Pallet for configuring proxy at genesis
|
||||
#[pallet::pallet]
|
||||
|
|
@ -44,7 +45,11 @@ pub mod pallet {
|
|||
/// This pallet requires pallet-proxy to be installed.
|
||||
#[pallet::config]
|
||||
pub trait Config:
|
||||
frame_system::Config + pallet_proxy::Config<ProxyType = <Self as Config>::ProxyType>
|
||||
frame_system::Config
|
||||
+ pallet_proxy::Config<
|
||||
ProxyType = <Self as Config>::ProxyType,
|
||||
BlockNumberProvider = frame_system::Pallet<Self>,
|
||||
>
|
||||
{
|
||||
/// This MUST be the same as in pallet_proxy or it won't compile
|
||||
type ProxyType: MaybeSerializeDeserialize + Clone;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
//! A minimal runtime including the proxy-genesis-companion pallet
|
||||
use super::*;
|
||||
use crate as proxy_companion;
|
||||
use codec::{Decode, Encode, MaxEncodedLen};
|
||||
use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
|
||||
use frame_support::{
|
||||
construct_runtime, derive_impl, parameter_types,
|
||||
traits::{ConstU32, InstanceFilter},
|
||||
|
|
@ -79,6 +79,7 @@ parameter_types! {
|
|||
Debug,
|
||||
MaxEncodedLen,
|
||||
scale_info::TypeInfo,
|
||||
DecodeWithMemTracking,
|
||||
serde::Serialize,
|
||||
serde::Deserialize,
|
||||
Default,
|
||||
|
|
@ -108,6 +109,7 @@ impl pallet_proxy::Config for Test {
|
|||
type CallHasher = BlakeTwo256;
|
||||
type AnnouncementDepositBase = AnnouncementDepositBase;
|
||||
type AnnouncementDepositFactor = AnnouncementDepositFactor;
|
||||
type BlockNumberProvider = System;
|
||||
}
|
||||
|
||||
impl Config for Test {
|
||||
|
|
@ -147,7 +149,7 @@ impl ExtBuilder {
|
|||
|
||||
pallet_balances::GenesisConfig::<Test> {
|
||||
balances: self.balances,
|
||||
..Default::default()
|
||||
dev_accounts: Default::default(),
|
||||
}
|
||||
.assimilate_storage(&mut t)
|
||||
.expect("Pallet balances storage can be assimilated");
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ frame-support = { workspace = true }
|
|||
frame-system = { workspace = true }
|
||||
pallet-session = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
|
|
@ -30,7 +29,6 @@ std = [
|
|||
"frame-system/std",
|
||||
"pallet-session/std",
|
||||
"sp-runtime/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"frame-benchmarking/runtime-benchmarks",
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ snowbridge-pallet-system = { workspace = true }
|
|||
sp-core = { workspace = true }
|
||||
sp-io = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
xcm = { workspace = true }
|
||||
xcm-executor = { workspace = true }
|
||||
|
||||
|
|
@ -70,7 +69,6 @@ std = [
|
|||
"sp-core/std",
|
||||
"sp-io/std",
|
||||
"sp-runtime/std",
|
||||
"sp-std/std",
|
||||
"xcm-executor/std",
|
||||
"xcm/std",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ exclude-from-umbrella = true
|
|||
codec = { features = ["derive"], workspace = true }
|
||||
snowbridge-core.workspace = true
|
||||
sp-api.workspace = true
|
||||
sp-std.workspace = true
|
||||
xcm.workspace = true
|
||||
|
||||
[features]
|
||||
|
|
@ -30,6 +29,5 @@ std = [
|
|||
"codec/std",
|
||||
"snowbridge-core/std",
|
||||
"sp-api/std",
|
||||
"sp-std/std",
|
||||
"xcm/std",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ use xcm::prelude::*;
|
|||
#[benchmarks]
|
||||
mod benchmarks {
|
||||
use super::*;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
#[benchmark]
|
||||
fn register_token() -> Result<(), BenchmarkError> {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@
|
|||
//!
|
||||
//! * [`Call::register_token`]: Register a token location as a wrapped ERC20 contract on Ethereum.
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
extern crate alloc;
|
||||
|
||||
#[cfg(test)]
|
||||
mod mock;
|
||||
|
||||
|
|
@ -29,6 +31,8 @@ pub mod api;
|
|||
pub mod weights;
|
||||
pub use weights::*;
|
||||
|
||||
use alloc::boxed::Box;
|
||||
use alloc::vec;
|
||||
use frame_support::{pallet_prelude::*, traits::EnsureOrigin};
|
||||
use frame_system::pallet_prelude::*;
|
||||
use snowbridge_core::{AgentIdOf as LocationHashOf, AssetMetadata, TokenId, TokenIdOf};
|
||||
|
|
@ -40,7 +44,6 @@ use snowbridge_pallet_system::{ForeignToNativeId, NativeToForeignId};
|
|||
use sp_core::{H160, H256};
|
||||
use sp_io::hashing::blake2_256;
|
||||
use sp_runtime::traits::MaybeEquivalence;
|
||||
use sp_std::prelude::*;
|
||||
use xcm::prelude::*;
|
||||
use xcm_executor::traits::ConvertLocation;
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ snowbridge-outbound-queue-primitives.workspace = true
|
|||
sp-core.workspace = true
|
||||
sp-io.workspace = true
|
||||
sp-runtime.workspace = true
|
||||
sp-std.workspace = true
|
||||
xcm.workspace = true
|
||||
xcm-executor.workspace = true
|
||||
|
||||
|
|
@ -63,7 +62,6 @@ std = [
|
|||
"sp-core/std",
|
||||
"sp-io/std",
|
||||
"sp-runtime/std",
|
||||
"sp-std/std",
|
||||
"xcm-executor/std",
|
||||
"xcm/std",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ exclude-from-umbrella = true
|
|||
codec = { features = ["derive"], workspace = true }
|
||||
snowbridge-core.workspace = true
|
||||
sp-api.workspace = true
|
||||
sp-std.workspace = true
|
||||
xcm.workspace = true
|
||||
|
||||
[features]
|
||||
|
|
@ -30,6 +29,5 @@ std = [
|
|||
"codec/std",
|
||||
"snowbridge-core/std",
|
||||
"sp-api/std",
|
||||
"sp-std/std",
|
||||
"xcm/std",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ use xcm::prelude::*;
|
|||
#[benchmarks]
|
||||
mod benchmarks {
|
||||
use super::*;
|
||||
use alloc::boxed::Box;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
#[benchmark]
|
||||
fn upgrade() -> Result<(), BenchmarkError> {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
//!
|
||||
//! * [`Call::register_token`]: Register a token location as a wrapped ERC20 contract on Ethereum.
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
extern crate alloc;
|
||||
|
||||
#[cfg(test)]
|
||||
mod mock;
|
||||
|
||||
|
|
@ -32,6 +34,7 @@ pub mod api;
|
|||
pub mod weights;
|
||||
pub use weights::*;
|
||||
|
||||
use alloc::boxed::Box;
|
||||
use frame_support::{
|
||||
pallet_prelude::*,
|
||||
traits::{
|
||||
|
|
@ -53,7 +56,6 @@ use snowbridge_outbound_queue_primitives::{
|
|||
use sp_core::{RuntimeDebug, H160, H256};
|
||||
use sp_io::hashing::blake2_256;
|
||||
use sp_runtime::{traits::MaybeEquivalence, DispatchError, SaturatedConversion};
|
||||
use sp_std::prelude::*;
|
||||
use xcm::prelude::*;
|
||||
use xcm_executor::traits::ConvertLocation;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
// SPDX-FileCopyrightText: 2023 Snowfork <hello@snowfork.com>
|
||||
//! Governance API for controlling the Ethereum side of the bridge
|
||||
use super::*;
|
||||
use alloc::vec::Vec;
|
||||
use core::marker::PhantomData;
|
||||
use frame_support::{
|
||||
migrations::VersionedMigration,
|
||||
pallet_prelude::*,
|
||||
|
|
@ -9,7 +11,6 @@ use frame_support::{
|
|||
weights::Weight,
|
||||
};
|
||||
use log;
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
use sp_runtime::TryRuntimeError;
|
||||
|
|
@ -22,6 +23,9 @@ pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(1);
|
|||
pub mod v0 {
|
||||
use super::*;
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
use alloc::vec;
|
||||
|
||||
pub struct InitializeOnUpgrade<T, BridgeHubParaId, AssetHubParaId>(
|
||||
PhantomData<(T, BridgeHubParaId, AssetHubParaId)>,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -49,7 +49,17 @@ mod pallet_xcm_origin {
|
|||
|
||||
// Insert this custom Origin into the aggregate RuntimeOrigin
|
||||
#[pallet::origin]
|
||||
#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)]
|
||||
#[derive(
|
||||
PartialEq,
|
||||
Eq,
|
||||
Clone,
|
||||
Encode,
|
||||
Decode,
|
||||
RuntimeDebug,
|
||||
TypeInfo,
|
||||
DecodeWithMemTracking,
|
||||
MaxEncodedLen,
|
||||
)]
|
||||
pub struct Origin(pub Location);
|
||||
|
||||
impl From<Location> for Origin {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ frame-system = { workspace = true }
|
|||
parity-scale-codec = { workspace = true, features = ["max-encoded-len"] }
|
||||
sp-core = { workspace = true }
|
||||
sp-io = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
|
||||
# Frontier
|
||||
evm = { workspace = true, features = ["with-codec"] }
|
||||
|
|
@ -42,5 +41,4 @@ std = [
|
|||
"precompile-utils/std",
|
||||
"sp-core/std",
|
||||
"sp-io/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -17,13 +17,16 @@
|
|||
//! Precompile to interact with pallet_balances instances using the ERC20 interface standard.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
extern crate alloc;
|
||||
|
||||
use alloc::vec;
|
||||
use alloc::vec::Vec;
|
||||
use core::{iter::repeat, marker::PhantomData};
|
||||
use evm::{ExitError, ExitReason};
|
||||
use fp_evm::{Context, Log, PrecompileFailure, PrecompileHandle, Transfer};
|
||||
use frame_support::traits::ConstU32;
|
||||
use precompile_utils::{evm::costs::call_cost, prelude::*};
|
||||
use sp_core::{H160, U256};
|
||||
use sp_std::{iter::repeat, marker::PhantomData, vec, vec::Vec};
|
||||
|
||||
#[cfg(test)]
|
||||
mod mock;
|
||||
|
|
|
|||
|
|
@ -142,6 +142,8 @@ impl pallet_evm::Config for Runtime {
|
|||
type GasWeightMapping = pallet_evm::FixedGasWeightMapping<Self>;
|
||||
type WeightPerGas = WeightPerGas;
|
||||
type CallOrigin = EnsureAddressRoot<AccountId>;
|
||||
type CreateOriginFilter = ();
|
||||
type CreateInnerOriginFilter = ();
|
||||
type WithdrawOrigin = EnsureAddressNever<AccountId>;
|
||||
type AddressMapping = AccountId;
|
||||
type Currency = Balances;
|
||||
|
|
@ -196,6 +198,7 @@ impl ExtBuilder {
|
|||
|
||||
pallet_balances::GenesisConfig::<Runtime> {
|
||||
balances: self.balances,
|
||||
dev_accounts: Default::default(),
|
||||
}
|
||||
.assimilate_storage(&mut t)
|
||||
.expect("Pallet balances storage can be assimilated");
|
||||
|
|
@ -206,6 +209,7 @@ impl ExtBuilder {
|
|||
pallet_evm::Pallet::<Runtime>::create_account(
|
||||
Revert.into(),
|
||||
hex_literal::hex!("1460006000fd").to_vec(),
|
||||
None,
|
||||
);
|
||||
});
|
||||
ext
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ fn evm_call(from: impl Into<H160>, input: Vec<u8>) -> EvmCall<Runtime> {
|
|||
max_priority_fee_per_gas: Some(U256::zero()),
|
||||
nonce: None, // Use the next nonce
|
||||
access_list: Vec::new(),
|
||||
authorization_list: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ parity-scale-codec = { workspace = true, features = [ "max-encoded-len" ] }
|
|||
sp-core = { workspace = true }
|
||||
sp-io = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
|
||||
# Frontier
|
||||
evm = { workspace = true, features = [ "with-codec" ] }
|
||||
|
|
@ -43,5 +42,4 @@ std = [
|
|||
"precompile-utils/std",
|
||||
"sp-core/std",
|
||||
"sp-io/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@
|
|||
// along with Moonbeam. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
extern crate alloc;
|
||||
|
||||
use alloc::vec::Vec;
|
||||
use core::marker::PhantomData;
|
||||
use evm::ExitReason;
|
||||
use fp_evm::{Context, ExitRevert, PrecompileFailure, PrecompileHandle, Transfer};
|
||||
|
|
@ -29,7 +31,6 @@ use precompile_utils::{evm::costs::call_cost, prelude::*};
|
|||
use sp_core::{H160, H256, U256};
|
||||
use sp_io::hashing::keccak_256;
|
||||
use sp_runtime::traits::UniqueSaturatedInto;
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
#[cfg(test)]
|
||||
mod mock;
|
||||
|
|
|
|||
|
|
@ -126,6 +126,8 @@ impl pallet_evm::Config for Runtime {
|
|||
type GasWeightMapping = pallet_evm::FixedGasWeightMapping<Self>;
|
||||
type WeightPerGas = WeightPerGas;
|
||||
type CallOrigin = EnsureAddressRoot<AccountId>;
|
||||
type CreateOriginFilter = ();
|
||||
type CreateInnerOriginFilter = ();
|
||||
type WithdrawOrigin = EnsureAddressNever<AccountId>;
|
||||
type AddressMapping = AccountId;
|
||||
type Currency = Balances;
|
||||
|
|
@ -180,6 +182,7 @@ impl ExtBuilder {
|
|||
|
||||
pallet_balances::GenesisConfig::<Runtime> {
|
||||
balances: self.balances,
|
||||
dev_accounts: Default::default(),
|
||||
}
|
||||
.assimilate_storage(&mut t)
|
||||
.expect("Pallet balances storage can be assimilated");
|
||||
|
|
@ -190,6 +193,7 @@ impl ExtBuilder {
|
|||
pallet_evm::Pallet::<Runtime>::create_account(
|
||||
Revert.into(),
|
||||
hex_literal::hex!("1460006000fd").to_vec(),
|
||||
None,
|
||||
);
|
||||
});
|
||||
ext
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ parity-scale-codec = { workspace = true, features = ["max-encoded-len"] }
|
|||
sp-core = { workspace = true }
|
||||
sp-io = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
|
||||
# Frontier
|
||||
evm = { workspace = true, features = ["with-codec"] }
|
||||
|
|
@ -46,6 +45,5 @@ std = [
|
|||
"precompile-utils/std",
|
||||
"sp-core/std",
|
||||
"sp-io/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
runtime-benchmarks = []
|
||||
|
|
|
|||
|
|
@ -17,7 +17,10 @@
|
|||
//! Precompile to interact with pallet_collective instances.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
extern crate alloc;
|
||||
|
||||
use alloc::boxed::Box;
|
||||
use alloc::vec::Vec;
|
||||
use core::marker::PhantomData;
|
||||
use fp_account::AccountId20;
|
||||
use fp_evm::Log;
|
||||
|
|
@ -32,7 +35,6 @@ use parity_scale_codec::{DecodeLimit as _, MaxEncodedLen};
|
|||
use precompile_utils::prelude::*;
|
||||
use sp_core::{Decode, Get, H160, H256};
|
||||
use sp_runtime::traits::Dispatchable;
|
||||
use sp_std::{boxed::Box, vec::Vec};
|
||||
|
||||
#[cfg(test)]
|
||||
mod mock;
|
||||
|
|
|
|||
|
|
@ -143,6 +143,8 @@ impl pallet_evm::Config for Runtime {
|
|||
type GasWeightMapping = pallet_evm::FixedGasWeightMapping<Self>;
|
||||
type WeightPerGas = WeightPerGas;
|
||||
type CallOrigin = EnsureAddressRoot<AccountId>;
|
||||
type CreateOriginFilter = ();
|
||||
type CreateInnerOriginFilter = ();
|
||||
type WithdrawOrigin = EnsureAddressNever<AccountId>;
|
||||
type AddressMapping = AccountId;
|
||||
type Currency = Balances;
|
||||
|
|
@ -298,6 +300,7 @@ impl ExtBuilder {
|
|||
|
||||
pallet_balances::GenesisConfig::<Runtime> {
|
||||
balances: self.balances.clone(),
|
||||
dev_accounts: Default::default(),
|
||||
}
|
||||
.assimilate_storage(&mut t)
|
||||
.expect("Pallet balances storage can be assimilated");
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ pallet-conviction-voting = { workspace = true }
|
|||
parity-scale-codec = { workspace = true, features = ["derive"] }
|
||||
sp-core = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
|
||||
# Frontier
|
||||
fp-evm = { workspace = true }
|
||||
|
|
@ -44,7 +43,6 @@ std = [
|
|||
"parity-scale-codec/std",
|
||||
"precompile-utils/std",
|
||||
"sp-runtime/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"frame-support/runtime-benchmarks",
|
||||
|
|
|
|||
|
|
@ -15,11 +15,13 @@
|
|||
// along with Moonbeam. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
extern crate alloc;
|
||||
|
||||
use alloc::vec::Vec;
|
||||
use core::marker::PhantomData;
|
||||
use fp_evm::PrecompileHandle;
|
||||
use frame_support::dispatch::{GetDispatchInfo, PostDispatchInfo};
|
||||
use frame_support::traits::{Currency, Polling};
|
||||
use frame_system::pallet_prelude::BlockNumberFor;
|
||||
use pallet_conviction_voting::Call as ConvictionVotingCall;
|
||||
use pallet_conviction_voting::{
|
||||
AccountVote, Casting, ClassLocksFor, Conviction, Delegating, Tally, TallyOf, Vote, Voting,
|
||||
|
|
@ -29,8 +31,6 @@ use pallet_evm::{AddressMapping, Log};
|
|||
use precompile_utils::prelude::*;
|
||||
use sp_core::{Get, MaxEncodedLen, H160, H256, U256};
|
||||
use sp_runtime::traits::{Dispatchable, StaticLookup};
|
||||
use sp_std::marker::PhantomData;
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
#[cfg(test)]
|
||||
mod mock;
|
||||
|
|
@ -56,10 +56,10 @@ type ClassOf<Runtime> = <<Runtime as pallet_conviction_voting::Config>::Polls as
|
|||
<Runtime as pallet_conviction_voting::Config>::MaxTurnout,
|
||||
>,
|
||||
>>::Class;
|
||||
type VotingOf<Runtime> = Voting<
|
||||
type VotingOf<Runtime, Instance = ()> = Voting<
|
||||
BalanceOf<Runtime>,
|
||||
<Runtime as frame_system::Config>::AccountId,
|
||||
BlockNumberFor<Runtime>,
|
||||
pallet_conviction_voting::BlockNumberFor<Runtime, Instance>,
|
||||
<<Runtime as pallet_conviction_voting::Config>::Polls as Polling<TallyOf<Runtime>>>::Index,
|
||||
<Runtime as pallet_conviction_voting::Config>::MaxVotes,
|
||||
>;
|
||||
|
|
@ -109,18 +109,16 @@ impl<Runtime> ConvictionVotingPrecompile<Runtime>
|
|||
where
|
||||
Runtime: pallet_conviction_voting::Config + pallet_evm::Config + frame_system::Config,
|
||||
BalanceOf<Runtime>: TryFrom<U256> + Into<U256>,
|
||||
<Runtime as frame_system::Config>::RuntimeCall:
|
||||
Dispatchable<PostInfo = PostDispatchInfo> + GetDispatchInfo,
|
||||
<<Runtime as frame_system::Config>::RuntimeCall as Dispatchable>::RuntimeOrigin:
|
||||
From<Option<Runtime::AccountId>>,
|
||||
Runtime::RuntimeCall: Dispatchable<PostInfo = PostDispatchInfo> + GetDispatchInfo,
|
||||
<Runtime::RuntimeCall as Dispatchable>::RuntimeOrigin: From<Option<Runtime::AccountId>>,
|
||||
Runtime::AccountId: Into<H160>,
|
||||
<Runtime as frame_system::Config>::RuntimeCall: From<ConvictionVotingCall<Runtime>>,
|
||||
Runtime::RuntimeCall: From<ConvictionVotingCall<Runtime>>,
|
||||
IndexOf<Runtime>: TryFrom<u32> + TryInto<u32>,
|
||||
ClassOf<Runtime>: TryFrom<u16> + TryInto<u16>,
|
||||
<Runtime as pallet_conviction_voting::Config>::Polls: Polling<
|
||||
Tally<
|
||||
<<Runtime as pallet_conviction_voting::Config>::Currency as Currency<
|
||||
<Runtime as frame_system::Config>::AccountId,
|
||||
Runtime::AccountId,
|
||||
>>::Balance,
|
||||
<Runtime as pallet_conviction_voting::Config>::MaxTurnout,
|
||||
>,
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
//! Test utilities
|
||||
use super::*;
|
||||
use alloc::collections::btree_map::BTreeMap;
|
||||
use frame_support::{
|
||||
construct_runtime, parameter_types,
|
||||
traits::{Everything, PollStatus, Polling, TotalIssuanceOf},
|
||||
|
|
@ -29,7 +30,6 @@ use sp_runtime::{
|
|||
traits::{BlakeTwo256, ConstU32, ConstU64, IdentityLookup},
|
||||
BuildStorage, DispatchError, Perbill,
|
||||
};
|
||||
use sp_std::collections::btree_map::BTreeMap;
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
use frame_support::traits::VoteTally;
|
||||
|
|
@ -133,6 +133,8 @@ impl pallet_evm::Config for Runtime {
|
|||
type GasWeightMapping = pallet_evm::FixedGasWeightMapping<Self>;
|
||||
type WeightPerGas = WeightPerGas;
|
||||
type CallOrigin = EnsureAddressRoot<AccountId>;
|
||||
type CreateOriginFilter = ();
|
||||
type CreateInnerOriginFilter = ();
|
||||
type WithdrawOrigin = EnsureAddressNever<AccountId>;
|
||||
type AddressMapping = AccountId;
|
||||
type Currency = Balances;
|
||||
|
|
@ -266,6 +268,8 @@ impl pallet_conviction_voting::Config for Runtime {
|
|||
type WeightInfo = ();
|
||||
type MaxTurnout = TotalIssuanceOf<Balances, Self::AccountId>;
|
||||
type Polls = TestPolls;
|
||||
type BlockNumberProvider = frame_system::Pallet<Runtime>;
|
||||
type VotingHooks = ();
|
||||
}
|
||||
|
||||
pub(crate) struct ExtBuilder {
|
||||
|
|
@ -294,6 +298,7 @@ impl ExtBuilder {
|
|||
|
||||
pallet_balances::GenesisConfig::<Runtime> {
|
||||
balances: self.balances.clone(),
|
||||
dev_accounts: Default::default(),
|
||||
}
|
||||
.assimilate_storage(&mut t)
|
||||
.expect("Pallet balances storage can be assimilated");
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ fn evm_call(input: Vec<u8>) -> EvmCall<Runtime> {
|
|||
max_priority_fee_per_gas: Some(U256::zero()),
|
||||
nonce: None,
|
||||
access_list: Vec::new(),
|
||||
authorization_list: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ parity-scale-codec = { workspace = true, features = ["max-encoded-len"] }
|
|||
sp-core = { workspace = true }
|
||||
sp-io = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
|
||||
# Frontier
|
||||
evm = { workspace = true, features = ["with-codec"] }
|
||||
|
|
@ -48,6 +47,5 @@ std = [
|
|||
"sp-core/std",
|
||||
"sp-io/std",
|
||||
"sp-runtime/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
use core::marker::PhantomData;
|
||||
use fp_evm::PrecompileHandle;
|
||||
use frame_support::dispatch::{GetDispatchInfo, PostDispatchInfo};
|
||||
use frame_support::traits::fungible::Inspect;
|
||||
|
|
@ -31,7 +32,6 @@ use pallet_evm::AddressMapping;
|
|||
use precompile_utils::prelude::*;
|
||||
use sp_core::{H160, U256};
|
||||
use sp_runtime::traits::Dispatchable;
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
/// Solidity selector for the TokensLocked event:
|
||||
/// keccak256("TokensLocked(address,uint256)")
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ use super::*;
|
|||
use frame_support::traits::Everything;
|
||||
use frame_support::{construct_runtime, parameter_types, weights::Weight};
|
||||
use pallet_evm::{EnsureAddressNever, EnsureAddressRoot, FrameSystemAccountProvider};
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode};
|
||||
use precompile_utils::{mock_account, precompile_set::*, testing::MockAccount};
|
||||
use snowbridge_core::TokenId;
|
||||
use snowbridge_outbound_queue_primitives::v1::Ticket;
|
||||
|
|
@ -146,6 +146,8 @@ impl pallet_evm::Config for Runtime {
|
|||
type GasWeightMapping = pallet_evm::FixedGasWeightMapping<Self>;
|
||||
type WeightPerGas = WeightPerGas;
|
||||
type CallOrigin = EnsureAddressRoot<AccountId>;
|
||||
type CreateOriginFilter = ();
|
||||
type CreateInnerOriginFilter = ();
|
||||
type WithdrawOrigin = EnsureAddressNever<AccountId>;
|
||||
type AddressMapping = AccountId;
|
||||
type Currency = Balances;
|
||||
|
|
@ -194,7 +196,7 @@ impl SendMessage for MockOutboundQueue {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Encode, Decode)]
|
||||
#[derive(Clone, Encode, Decode, DecodeWithMemTracking)]
|
||||
pub struct MockTicket;
|
||||
|
||||
impl Ticket for MockTicket {
|
||||
|
|
@ -272,6 +274,7 @@ impl ExtBuilder {
|
|||
|
||||
pallet_balances::GenesisConfig::<Runtime> {
|
||||
balances: self.balances,
|
||||
dev_accounts: Default::default(),
|
||||
}
|
||||
.assimilate_storage(&mut t)
|
||||
.expect("Pallet balances storage can be assimilated");
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ parity-scale-codec = { workspace = true, features = ["max-encoded-len"] }
|
|||
sp-core = { workspace = true }
|
||||
sp-io = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
|
||||
# Frontier
|
||||
fp-evm = { workspace = true }
|
||||
|
|
@ -46,5 +45,4 @@ std = [
|
|||
"precompile-utils/std",
|
||||
"sp-core/std",
|
||||
"sp-io/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
// along with Moonbeam. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use super::*;
|
||||
use alloc::vec::Vec;
|
||||
use frame_support::{
|
||||
ensure,
|
||||
traits::{Get, Time},
|
||||
|
|
@ -22,7 +23,6 @@ use frame_support::{
|
|||
use sp_core::H256;
|
||||
use sp_io::hashing::keccak_256;
|
||||
use sp_runtime::traits::UniqueSaturatedInto;
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
/// EIP2612 permit typehash.
|
||||
pub const PERMIT_TYPEHASH: [u8; 32] = keccak256!(
|
||||
|
|
@ -39,9 +39,11 @@ pub struct Eip2612<Runtime, Metadata, Instance = ()>(PhantomData<(Runtime, Metad
|
|||
impl<Runtime, Metadata, Instance> Eip2612<Runtime, Metadata, Instance>
|
||||
where
|
||||
Runtime: pallet_balances::Config<Instance> + pallet_evm::Config,
|
||||
Runtime::RuntimeCall: Dispatchable<PostInfo = PostDispatchInfo> + GetDispatchInfo,
|
||||
Runtime::RuntimeCall: From<pallet_balances::Call<Runtime, Instance>>,
|
||||
<Runtime::RuntimeCall as Dispatchable>::RuntimeOrigin: From<Option<Runtime::AccountId>>,
|
||||
<Runtime as frame_system::Config>::RuntimeCall:
|
||||
Dispatchable<PostInfo = PostDispatchInfo> + GetDispatchInfo,
|
||||
<Runtime as frame_system::Config>::RuntimeCall: From<pallet_balances::Call<Runtime, Instance>>,
|
||||
<<Runtime as frame_system::Config>::RuntimeCall as Dispatchable>::RuntimeOrigin:
|
||||
From<Option<Runtime::AccountId>>,
|
||||
BalanceOf<Runtime, Instance>: TryFrom<U256> + Into<U256>,
|
||||
Metadata: Erc20Metadata,
|
||||
Instance: InstanceToPrefix + 'static,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,10 @@
|
|||
//! Precompile to interact with pallet_balances instances using the ERC20 interface standard.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
extern crate alloc;
|
||||
|
||||
use core::convert::{TryFrom, TryInto};
|
||||
use core::marker::PhantomData;
|
||||
use fp_evm::PrecompileHandle;
|
||||
use frame_support::{
|
||||
dispatch::{GetDispatchInfo, PostDispatchInfo},
|
||||
|
|
@ -33,10 +36,6 @@ use pallet_balances::pallet::{
|
|||
use pallet_evm::AddressMapping;
|
||||
use precompile_utils::prelude::*;
|
||||
use sp_core::{H160, H256, U256};
|
||||
use sp_std::{
|
||||
convert::{TryFrom, TryInto},
|
||||
marker::PhantomData,
|
||||
};
|
||||
|
||||
mod eip2612;
|
||||
use eip2612::Eip2612;
|
||||
|
|
|
|||
|
|
@ -127,6 +127,8 @@ impl pallet_evm::Config for Runtime {
|
|||
type GasWeightMapping = pallet_evm::FixedGasWeightMapping<Self>;
|
||||
type WeightPerGas = WeightPerGas;
|
||||
type CallOrigin = EnsureAddressRoot<AccountId>;
|
||||
type CreateOriginFilter = ();
|
||||
type CreateInnerOriginFilter = ();
|
||||
type WithdrawOrigin = EnsureAddressNever<AccountId>;
|
||||
type AddressMapping = AccountId;
|
||||
type Currency = Balances;
|
||||
|
|
@ -207,6 +209,7 @@ impl ExtBuilder {
|
|||
|
||||
pallet_balances::GenesisConfig::<Runtime> {
|
||||
balances: self.balances,
|
||||
dev_accounts: Default::default(),
|
||||
}
|
||||
.assimilate_storage(&mut t)
|
||||
.expect("Pallet balances storage can be assimilated");
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ fn transfer() {
|
|||
value: 400.into(),
|
||||
},
|
||||
)
|
||||
.expect_cost(176106756) // 1 weight => 1 gas in mock
|
||||
.expect_cost(173835756) // 1 weight => 1 gas in mock
|
||||
.expect_log(log3(
|
||||
Precompile1,
|
||||
SELECTOR_LOG_TRANSFER,
|
||||
|
|
@ -370,7 +370,7 @@ fn transfer_from() {
|
|||
value: 400.into(),
|
||||
},
|
||||
)
|
||||
.expect_cost(176106756) // 1 weight => 1 gas in mock
|
||||
.expect_cost(173835756) // 1 weight => 1 gas in mock
|
||||
.expect_log(log3(
|
||||
Precompile1,
|
||||
SELECTOR_LOG_TRANSFER,
|
||||
|
|
@ -466,7 +466,7 @@ fn transfer_from_self() {
|
|||
value: 400.into(),
|
||||
},
|
||||
)
|
||||
.expect_cost(176106756) // 1 weight => 1 gas in mock
|
||||
.expect_cost(173835756) // 1 weight => 1 gas in mock
|
||||
.expect_log(log3(
|
||||
Precompile1,
|
||||
SELECTOR_LOG_TRANSFER,
|
||||
|
|
@ -576,6 +576,7 @@ fn deposit(data: Vec<u8>) {
|
|||
None, // max priority
|
||||
None, // nonce
|
||||
vec![], // access list
|
||||
vec![], // authorization list
|
||||
)
|
||||
.expect("it works");
|
||||
|
||||
|
|
@ -692,6 +693,7 @@ fn deposit_zero() {
|
|||
None, // max priority
|
||||
None, // nonce
|
||||
vec![], // access list
|
||||
vec![], // authorization list
|
||||
)
|
||||
.expect("it works");
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ parity-scale-codec = { workspace = true, features = [ "max-encoded-len" ] }
|
|||
sp-core = { workspace = true }
|
||||
sp-io = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
pallet-identity = { workspace = true }
|
||||
|
||||
# Frontier
|
||||
|
|
@ -22,6 +21,10 @@ fp-evm = { workspace = true }
|
|||
pallet-evm = { workspace = true, features = [ "forbid-evm-reentrancy" ] }
|
||||
precompile-utils = { workspace = true }
|
||||
|
||||
# Temp
|
||||
## TODO/ remove it once we move to 2506
|
||||
serde = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
pallet-balances = { workspace = true, features = [ "std" ] }
|
||||
|
|
@ -47,7 +50,6 @@ std = [
|
|||
"sp-core/std",
|
||||
"sp-io/std",
|
||||
"sp-runtime/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"frame-support/runtime-benchmarks",
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@
|
|||
|
||||
extern crate alloc;
|
||||
|
||||
use alloc::boxed::Box;
|
||||
use alloc::vec::Vec;
|
||||
use core::marker::PhantomData;
|
||||
use fp_evm::PrecompileHandle;
|
||||
use frame_support::dispatch::{GetDispatchInfo, PostDispatchInfo};
|
||||
use frame_support::sp_runtime::traits::StaticLookup;
|
||||
|
|
@ -30,9 +33,6 @@ use parity_scale_codec::MaxEncodedLen;
|
|||
use precompile_utils::prelude::*;
|
||||
use sp_core::{ConstU32, Get, H160, H256, U256};
|
||||
use sp_runtime::traits::Dispatchable;
|
||||
use sp_std::boxed::Box;
|
||||
use sp_std::marker::PhantomData;
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
#[cfg(test)]
|
||||
mod mock;
|
||||
|
|
@ -78,8 +78,10 @@ where
|
|||
>,
|
||||
Runtime::AccountId: Into<H160>,
|
||||
Runtime::Hash: From<H256>,
|
||||
Runtime::RuntimeCall: Dispatchable<PostInfo = PostDispatchInfo> + GetDispatchInfo,
|
||||
<Runtime::RuntimeCall as Dispatchable>::RuntimeOrigin: From<Option<Runtime::AccountId>>,
|
||||
<Runtime as frame_system::Config>::RuntimeCall:
|
||||
Dispatchable<PostInfo = PostDispatchInfo> + GetDispatchInfo,
|
||||
<<Runtime as frame_system::Config>::RuntimeCall as Dispatchable>::RuntimeOrigin:
|
||||
From<Option<Runtime::AccountId>>,
|
||||
Runtime::RuntimeCall: From<pallet_identity::Call<Runtime>>,
|
||||
BalanceOf<Runtime>: TryFrom<U256> + Into<U256> + solidity::Codec,
|
||||
<Runtime as pallet_evm::Config>::AddressMapping: AddressMapping<Runtime::AccountId>,
|
||||
|
|
|
|||
|
|
@ -25,10 +25,12 @@ use frame_system::{EnsureRoot, EnsureSignedBy};
|
|||
use pallet_evm::{EnsureAddressNever, EnsureAddressRoot, FrameSystemAccountProvider};
|
||||
use pallet_identity::legacy::IdentityInfo;
|
||||
use precompile_utils::mock_account;
|
||||
use precompile_utils::{
|
||||
precompile_set::*,
|
||||
testing::{MockAccount, MockSignature},
|
||||
};
|
||||
use precompile_utils::testing::MockSigner;
|
||||
use precompile_utils::{precompile_set::*, testing::MockAccount};
|
||||
use scale_info::TypeInfo;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sp_core::keccak_256;
|
||||
use sp_core::{Decode, DecodeWithMemTracking, Encode};
|
||||
use sp_core::{H256, U256};
|
||||
use sp_runtime::{
|
||||
traits::{BlakeTwo256, IdentityLookup},
|
||||
|
|
@ -40,6 +42,60 @@ pub type Balance = u128;
|
|||
|
||||
type Block = frame_system::mocking::MockBlockU32<Runtime>;
|
||||
|
||||
// TODO: remove this chunk once we moved to 2506. `MockSignature` was missing the `DecodeWithMemTracking` trait in frontier 2503.
|
||||
// We should be able to use the one from frontier when migrating to 2506
|
||||
#[derive(
|
||||
Eq,
|
||||
PartialEq,
|
||||
Clone,
|
||||
Encode,
|
||||
Decode,
|
||||
DecodeWithMemTracking,
|
||||
sp_core::RuntimeDebug,
|
||||
TypeInfo,
|
||||
Serialize,
|
||||
Deserialize,
|
||||
)]
|
||||
pub struct MockSignature(sp_core::ecdsa::Signature);
|
||||
|
||||
impl From<sp_core::ecdsa::Signature> for MockSignature {
|
||||
fn from(x: sp_core::ecdsa::Signature) -> Self {
|
||||
MockSignature(x)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<sp_runtime::MultiSignature> for MockSignature {
|
||||
fn from(signature: sp_runtime::MultiSignature) -> Self {
|
||||
match signature {
|
||||
sp_runtime::MultiSignature::Ed25519(_) => {
|
||||
panic!("Ed25519 not supported for MockSignature")
|
||||
}
|
||||
sp_runtime::MultiSignature::Sr25519(_) => {
|
||||
panic!("Sr25519 not supported for MockSignature")
|
||||
}
|
||||
sp_runtime::MultiSignature::Ecdsa(sig) => Self(sig),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl sp_runtime::traits::Verify for MockSignature {
|
||||
type Signer = MockSigner;
|
||||
fn verify<L: sp_runtime::traits::Lazy<[u8]>>(&self, mut msg: L, signer: &MockAccount) -> bool {
|
||||
let mut m = [0u8; 32];
|
||||
m.copy_from_slice(keccak_256(msg.get()).as_slice());
|
||||
match sp_io::crypto::secp256k1_ecdsa_recover(self.0.as_ref(), &m) {
|
||||
Ok(pubkey) => {
|
||||
MockAccount(sp_core::H160::from_slice(
|
||||
&keccak_256(&pubkey).as_slice()[12..32],
|
||||
)) == *signer
|
||||
}
|
||||
Err(sp_io::EcdsaVerifyError::BadRS) => false,
|
||||
Err(sp_io::EcdsaVerifyError::BadV) => false,
|
||||
Err(sp_io::EcdsaVerifyError::BadSignature) => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
construct_runtime!(
|
||||
pub enum Runtime {
|
||||
System: frame_system,
|
||||
|
|
@ -136,6 +192,8 @@ impl pallet_evm::Config for Runtime {
|
|||
type GasWeightMapping = pallet_evm::FixedGasWeightMapping<Self>;
|
||||
type WeightPerGas = WeightPerGas;
|
||||
type CallOrigin = EnsureAddressRoot<AccountId>;
|
||||
type CreateOriginFilter = ();
|
||||
type CreateInnerOriginFilter = ();
|
||||
type WithdrawOrigin = EnsureAddressNever<AccountId>;
|
||||
type AddressMapping = AccountId;
|
||||
type Currency = Balances;
|
||||
|
|
@ -240,6 +298,7 @@ impl ExtBuilder {
|
|||
|
||||
pallet_balances::GenesisConfig::<Runtime> {
|
||||
balances: self.balances.clone(),
|
||||
dev_accounts: Default::default(),
|
||||
}
|
||||
.assimilate_storage(&mut t)
|
||||
.expect("Pallet balances storage can be assimilated");
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ fn evm_call(source: impl Into<H160>, input: Vec<u8>) -> EvmCall<Runtime> {
|
|||
max_priority_fee_per_gas: Some(U256::zero()),
|
||||
nonce: None,
|
||||
access_list: Vec::new(),
|
||||
authorization_list: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ where
|
|||
// AccountCodes: Blake2128(16) + H160(20) + Vec(5)
|
||||
// We asume an existing precompile can hold at most 5 bytes worth of dummy code.
|
||||
handle.record_db_read::<Runtime>(41)?;
|
||||
pallet_evm::Pallet::<Runtime>::create_account(address.0, DUMMY_CODE.to_vec());
|
||||
let _ = pallet_evm::Pallet::<Runtime>::create_account(address.0, DUMMY_CODE.to_vec(), None);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,6 +127,8 @@ impl pallet_evm::Config for Runtime {
|
|||
type GasWeightMapping = pallet_evm::FixedGasWeightMapping<Self>;
|
||||
type WeightPerGas = WeightPerGas;
|
||||
type CallOrigin = EnsureAddressRoot<AccountId>;
|
||||
type CreateOriginFilter = ();
|
||||
type CreateInnerOriginFilter = ();
|
||||
type WithdrawOrigin = EnsureAddressNever<AccountId>;
|
||||
type AddressMapping = AccountId;
|
||||
type Currency = Balances;
|
||||
|
|
@ -181,6 +183,7 @@ impl ExtBuilder {
|
|||
|
||||
pallet_balances::GenesisConfig::<Runtime> {
|
||||
balances: self.balances,
|
||||
dev_accounts: Default::default(),
|
||||
}
|
||||
.assimilate_storage(&mut t)
|
||||
.expect("Pallet balances storage can be assimilated");
|
||||
|
|
@ -191,6 +194,7 @@ impl ExtBuilder {
|
|||
pallet_evm::Pallet::<Runtime>::create_account(
|
||||
SmartContract.into(),
|
||||
b"SmartContract".to_vec(),
|
||||
None,
|
||||
);
|
||||
});
|
||||
ext
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ pallet-preimage = { workspace = true }
|
|||
parity-scale-codec = { workspace = true, features = ["derive"] }
|
||||
sp-core = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
sp-std = { workspace = true }
|
||||
|
||||
# Frontier
|
||||
fp-evm = { workspace = true }
|
||||
|
|
@ -41,8 +40,6 @@ std = [
|
|||
"pallet-evm/std",
|
||||
"pallet-preimage/std",
|
||||
"parity-scale-codec/std",
|
||||
"parity-scale-codec/std",
|
||||
"precompile-utils/std",
|
||||
"sp-runtime/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -15,7 +15,10 @@
|
|||
// along with Moonbeam. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
extern crate alloc;
|
||||
|
||||
use alloc::vec::Vec;
|
||||
use core::marker::PhantomData;
|
||||
use fp_evm::PrecompileHandle;
|
||||
use frame_support::dispatch::{GetDispatchInfo, PostDispatchInfo};
|
||||
use frame_support::traits::ConstU32;
|
||||
|
|
@ -24,7 +27,6 @@ use pallet_preimage::Call as PreimageCall;
|
|||
use precompile_utils::prelude::*;
|
||||
use sp_core::{Hasher, H256};
|
||||
use sp_runtime::traits::Dispatchable;
|
||||
use sp_std::{marker::PhantomData, vec::Vec};
|
||||
|
||||
#[cfg(test)]
|
||||
mod mock;
|
||||
|
|
|
|||
|
|
@ -125,6 +125,8 @@ impl pallet_evm::Config for Runtime {
|
|||
type GasWeightMapping = pallet_evm::FixedGasWeightMapping<Self>;
|
||||
type WeightPerGas = WeightPerGas;
|
||||
type CallOrigin = EnsureAddressRoot<AccountId>;
|
||||
type CreateOriginFilter = ();
|
||||
type CreateInnerOriginFilter = ();
|
||||
type WithdrawOrigin = EnsureAddressNever<AccountId>;
|
||||
type AddressMapping = AccountId;
|
||||
type Currency = Balances;
|
||||
|
|
@ -187,6 +189,7 @@ impl ExtBuilder {
|
|||
|
||||
pallet_balances::GenesisConfig::<Runtime> {
|
||||
balances: self.balances,
|
||||
dev_accounts: Default::default(),
|
||||
}
|
||||
.assimilate_storage(&mut t)
|
||||
.expect("Pallet balances storage can be assimilated");
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue