feat: upgrade to polkadot SDK 2503 (#444)

## Polkadot upgrade 2503

In this PR, we upgrade form Polkadot SDK 2412 to Polkadot SDK 2503. In
order to upgrade the SDK we need to upgrade some dependencies :
StorageHub and frontier simultaneously.


## What changes 

### Trivial changes

* https://github.com/paritytech/polkadot-sdk/pull/7634 -> The new trait
is required in all the pallets using scale encoding.

* https://github.com/paritytech/polkadot-sdk/pull/7043 -> Remove
deprecated `sp-std` and replace with `alloc` or `core`.

* https://github.com/paritytech/polkadot-sdk/pull/6140 -> Accurate
weight reclaim with frame_system::WeightReclaim


### Breaking changes

* https://github.com/paritytech/polkadot-sdk/pull/2072 -> There is a
change in `pallet-referenda`. Now, the tracks are retrieved as a list of
`Track`s. Also, the names of the tracks might have some trailing null
values (`\0`). This means display representation of the tracks' names
must be sanitized.

* https://github.com/paritytech/polkadot-sdk/pull/5723 -> adds the
ability for these pallets to specify their source of the block number.
This is useful when these pallets are migrated from the relay chain to a
parachain and vice versa. (Not entirely sure it is breaking as it is
being marked as backward compatible).

* https://github.com/paritytech/polkadot-sdk/pull/6338 -> Update
Referenda to Support Block Number Provider

### Notable changes

* https://github.com/paritytech/polkadot-sdk/pull/5703 -> Not changes
required in the codebase but impact fastSync mode. Should improve
testing.

* https://github.com/paritytech/polkadot-sdk/pull/5842 -> Removes
`libp2p` types in authority-discovery, and replace them with network
backend agnostic types from `sc-network-types`. The `sc-network`
interface is therefore updated accordingly.

## What changes in Frontier 

* https://github.com/polkadot-evm/frontier/pull/1693 -> Add support for
EIP 7702 which has been enable with Pectra. This EIP add a new field
`AuthorizationList` in Ethereum transaction.

Changes example :

```rust
#[test]
fn validate_transaction_fails_on_filtered_call() {
...
            pallet_evm::Call::<Runtime>::call {
                source: H160::default(),
                target: H160::default(),
                input: Vec::new(),
                value: sp_core::U256::zero(),
                gas_limit: 21000,
                max_fee_per_gas: sp_core::U256::zero(),
                max_priority_fee_per_gas: Some(sp_core::U256::zero()),
                nonce: None,
                access_list: Vec::new(),
                authorization_list: Vec::new(),
            }
            .into(),
```

## ⚠️ Breaking Changes ⚠️

* Upgrade to Stirage hub v0.5.1
* Support for Ethereum latest upgrade (txs now have the
`authoriation_list` for support EIP 7702)

---------

Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
undercover-cactus 2026-03-26 10:04:57 +01:00 committed by GitHub
parent 6d323385d8
commit b8cc9eee4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
335 changed files with 3267 additions and 2868 deletions

3486
operator/Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -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.23.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

View file

@ -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>);

View file

@ -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));

View file

@ -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),
}
})
}

View file

@ -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(),

View file

@ -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,
)

View file

@ -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",

View file

@ -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::*;

View file

@ -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(|| {

View file

@ -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 = [

View file

@ -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",
]

View file

@ -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;

View file

@ -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;

View file

@ -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::{

View file

@ -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::*;

View file

@ -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,
}
};

View file

@ -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,
}
};
}

View file

@ -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!(

View file

@ -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]
);
});
}

View file

@ -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 {

View file

@ -171,6 +171,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! {

View file

@ -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",

View file

@ -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;

View file

@ -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.

View file

@ -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();

View file

@ -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]

View file

@ -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)]

View file

@ -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 {

View file

@ -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",

View file

@ -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;

View file

@ -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.

View file

@ -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,

View file

@ -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)]

View file

@ -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 {

View file

@ -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",

View file

@ -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",

View file

@ -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",
]

View file

@ -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;

View file

@ -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 {

View file

@ -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")]

View file

@ -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

View file

@ -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};

View file

@ -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 {

View file

@ -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",

View file

@ -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",
]

View file

@ -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) {

View file

@ -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 {

View file

@ -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::*;

View file

@ -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;

View file

@ -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;

View file

@ -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",

View file

@ -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;

View file

@ -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");

View file

@ -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",

View file

@ -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",
]

View file

@ -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",
]

View file

@ -15,6 +15,7 @@ use xcm::prelude::*;
#[benchmarks]
mod benchmarks {
use super::*;
use alloc::vec::Vec;
#[benchmark]
fn register_token() -> Result<(), BenchmarkError> {

View file

@ -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;

View file

@ -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",
]

View file

@ -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",
]

View file

@ -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> {

View file

@ -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;

View file

@ -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)>,
);

View file

@ -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 {

View file

@ -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",
]

View file

@ -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;

View file

@ -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

View file

@ -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(),
}
}

View file

@ -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",
]

View file

@ -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;

View file

@ -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

View file

@ -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 = []

View file

@ -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;

View file

@ -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");

View file

@ -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",

View file

@ -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,
>,

View file

@ -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");

View file

@ -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(),
}
}

View file

@ -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",
]

View file

@ -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)")

View file

@ -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");

View file

@ -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",
]

View file

@ -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,

View file

@ -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;

View file

@ -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");

View file

@ -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");

View file

@ -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",

View file

@ -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>,

View file

@ -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");

View file

@ -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(),
}
}

View file

@ -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(())
}

View file

@ -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

View file

@ -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",
]

View file

@ -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;

View file

@ -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");

View file

@ -34,6 +34,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(),
}
}

View file

@ -15,7 +15,6 @@ pallet-proxy = { workspace = true }
parity-scale-codec = { workspace = true, features = ["derive"] }
sp-core = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }
# Frontier
evm = { workspace = true, features = ["with-codec"] }
@ -47,5 +46,4 @@ std = [
"precompile-utils/std",
"sp-core/std",
"sp-runtime/std",
"sp-std/std",
]

View file

@ -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 evm::ExitReason;
use fp_evm::{
Context, PrecompileFailure, PrecompileHandle, Transfer, ACCOUNT_CODES_METADATA_PROOF_SIZE,
@ -33,7 +36,6 @@ use sp_runtime::{
traits::{ConstU32, Dispatchable, StaticLookup, Zero},
SaturatedConversion,
};
use sp_std::marker::PhantomData;
/// System account size in bytes = Pallet_Name_Hash (16) + Storage_name_hash (16) +
/// Blake2_128Concat (16) + AccountId (20) + AccountInfo (4 + 12 + AccountData (4* 16)) = 148
@ -57,11 +59,12 @@ where
<Runtime as frame_system::Config>::RuntimeCall:
Dispatchable<PostInfo = PostDispatchInfo> + GetDispatchInfo,
<<Runtime as frame_system::Config>::RuntimeCall as Dispatchable>::RuntimeOrigin:
From<Option<Runtime::AccountId>>,
From<Option<<Runtime as frame_system::Config>::AccountId>>,
<Runtime as frame_system::Config>::RuntimeCall:
From<ProxyCall<Runtime>> + From<BalancesCall<Runtime>>,
<Runtime as pallet_balances::Config<()>>::Balance: TryFrom<U256> + Into<U256>,
<Runtime as pallet_evm::Config>::AddressMapping: AddressMapping<Runtime::AccountId>,
<Runtime as pallet_evm::Config>::AddressMapping:
AddressMapping<<Runtime as frame_system::Config>::AccountId>,
{
fn is_allowed(_caller: H160, selector: Option<u32>) -> bool {
match selector {
@ -85,16 +88,17 @@ where
Runtime:
pallet_proxy::Config + pallet_evm::Config + frame_system::Config + pallet_balances::Config,
<<Runtime as pallet_proxy::Config>::RuntimeCall as Dispatchable>::RuntimeOrigin:
From<Option<Runtime::AccountId>>,
From<Option<<Runtime as frame_system::Config>::AccountId>>,
<Runtime as pallet_proxy::Config>::ProxyType: Decode + EvmProxyCallFilter,
<Runtime as frame_system::Config>::RuntimeCall:
Dispatchable<PostInfo = PostDispatchInfo> + GetDispatchInfo,
<<Runtime as frame_system::Config>::RuntimeCall as Dispatchable>::RuntimeOrigin:
From<Option<Runtime::AccountId>>,
From<Option<<Runtime as frame_system::Config>::AccountId>>,
<Runtime as frame_system::Config>::RuntimeCall:
From<ProxyCall<Runtime>> + From<BalancesCall<Runtime>>,
<Runtime as pallet_balances::Config<()>>::Balance: TryFrom<U256> + Into<U256>,
<Runtime as pallet_evm::Config>::AddressMapping: AddressMapping<Runtime::AccountId>,
<Runtime as pallet_evm::Config>::AddressMapping:
AddressMapping<<Runtime as frame_system::Config>::AccountId>,
{
fn is_allowed(_caller: H160, selector: Option<u32>) -> bool {
match selector {
@ -147,16 +151,17 @@ where
Runtime:
pallet_proxy::Config + pallet_evm::Config + frame_system::Config + pallet_balances::Config,
<<Runtime as pallet_proxy::Config>::RuntimeCall as Dispatchable>::RuntimeOrigin:
From<Option<Runtime::AccountId>>,
From<Option<<Runtime as frame_system::Config>::AccountId>>,
<Runtime as pallet_proxy::Config>::ProxyType: Decode + EvmProxyCallFilter,
<Runtime as frame_system::Config>::RuntimeCall:
Dispatchable<PostInfo = PostDispatchInfo> + GetDispatchInfo,
<<Runtime as frame_system::Config>::RuntimeCall as Dispatchable>::RuntimeOrigin:
From<Option<Runtime::AccountId>>,
From<Option<<Runtime as frame_system::Config>::AccountId>>,
<Runtime as frame_system::Config>::RuntimeCall:
From<ProxyCall<Runtime>> + From<BalancesCall<Runtime>>,
<Runtime as pallet_balances::Config<()>>::Balance: TryFrom<U256> + Into<U256>,
<Runtime as pallet_evm::Config>::AddressMapping: AddressMapping<Runtime::AccountId>,
<Runtime as pallet_evm::Config>::AddressMapping:
AddressMapping<<Runtime as frame_system::Config>::AccountId>,
{
/// Register a proxy account for the sender that is able to make calls on its behalf.
/// The dispatch origin for this call must be Signed.
@ -198,8 +203,8 @@ where
return Err(revert("Cannot add more than one proxy"));
}
let delegate: <Runtime::Lookup as StaticLookup>::Source =
Runtime::Lookup::unlookup(delegate.clone());
let delegate: <<Runtime as frame_system::Config>::Lookup as StaticLookup>::Source =
<Runtime as frame_system::Config>::Lookup::unlookup(delegate.clone());
let call: ProxyCall<Runtime> = ProxyCall::<Runtime>::add_proxy {
delegate,
proxy_type,
@ -233,8 +238,8 @@ where
})?;
let delay = delay.into();
let delegate: <Runtime::Lookup as StaticLookup>::Source =
Runtime::Lookup::unlookup(delegate.clone());
let delegate: <<Runtime as frame_system::Config>::Lookup as StaticLookup>::Source =
<Runtime as frame_system::Config>::Lookup::unlookup(delegate.clone());
let origin = Runtime::AddressMapping::into_account_id(handle.context().caller);
let call: ProxyCall<Runtime> = ProxyCall::<Runtime>::remove_proxy {
delegate,
@ -413,7 +418,7 @@ where
let transfer = if value.is_zero() {
None
} else {
let contract_address: Runtime::AccountId =
let contract_address: <Runtime as frame_system::Config>::AccountId =
Runtime::AddressMapping::into_account_id(handle.context().address);
// Send back funds received by the precompile.
@ -421,12 +426,12 @@ where
handle,
Some(contract_address).into(),
pallet_balances::Call::<Runtime>::transfer_allow_death {
dest: Runtime::Lookup::unlookup(who),
dest: <Runtime as frame_system::Config>::Lookup::unlookup(who),
value: {
let balance: <Runtime as pallet_balances::Config<()>>::Balance =
value.try_into().map_err(|_| PrecompileFailure::Revert {
exit_status: fp_evm::ExitRevert::Reverted,
output: sp_std::vec::Vec::new(),
output: Vec::new(),
})?;
balance
},

View file

@ -168,6 +168,8 @@ impl pallet_evm::Config for Runtime {
type GasWeightMapping = pallet_evm::FixedGasWeightMapping<Self>;
type WeightPerGas = WeightPerGas;
type CallOrigin = EnsureAddressAlways;
type CreateOriginFilter = ();
type CreateInnerOriginFilter = ();
type WithdrawOrigin = EnsureAddressNever<AccountId>;
type AddressMapping = AccountId;
type Currency = Balances;
@ -269,6 +271,7 @@ impl pallet_proxy::Config for Runtime {
type CallHasher = BlakeTwo256;
type AnnouncementDepositBase = ();
type AnnouncementDepositFactor = ();
type BlockNumberProvider = ();
}
/// Build test externalities, prepopulated with data for testing democracy precompiles
@ -298,6 +301,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");

Some files were not shown because too many files have changed in this diff Show more