Skip to content

Commit

Permalink
Bump to polkadot-v1.3.0 (#598)
Browse files Browse the repository at this point in the history
* Get `entropy-shared` compiling with updated deps

* Fix `entropy-shared` build for `wasm-no-std`

* Make `pallet-staking-extension` compile

Starts introducing some of the changes brought in by
paritytech/polkadot-sdk#1484.

* Introduce staking changes from paritytech/substrate#12970

* Add RuntimeFreezeReason from paritytech/polkadot-sdk#1900

* Re-map errors in staking extension pallet

* Bump `pallet-programs`

* Missed a crate dep for staking extension

* Remove commented out code

* Get `pallet-relayer` compiling

* Fix relayer test compilation

* Fix `pallet-free-tx`'s tests

* Reorder config types

* Bump `pallet-propagation` dependencies

* Bump `pallet-slashing` dependencies

* Bump `pallet-transaction-pause`

This includes the deprecation of `Balances::transfer` from
paritytech/polkadot-sdk#1226.

* TaploFmt

* Use `StakingAccount` instead of `.into()`

* Import `vec` macro in `pallet-slashing`

* Import `vec` in other pallets

* Bump TOML dependencies for runtime

Haven't fixed the Rust code yet though

* Self define types instead of using `node-primitives`

* Update staking related configs

Values were mostly taken from the Polkadot runtime config

* Update `pallet-preimage` config

Changes introduced in paritytech/polkadot-sdk#1363

* Add `MaxNominators` to `pallet_babe`

Introduced in paritytech/substrate#14471

* Add `MaxNominators` to `pallet_grandpa`

Also introduced in paritytech/substrate#14471

* Add `RuntimeFreezeReason` to `pallet_nomination_pools`

* Add `MaxTipAmount` to `pallet_tips`

Introduced in paritytech/polkadot-sdk#1709

* Add `IdentityInformation` to `pallet_identity`

Introduced in paritytech/polkadot-sdk#1661

* finish runtime

* Use `crates.io` packages in `entropy` TOML

This doesn't compile yet

* Remove reference to `node_primitives`

* Move imports under correct dependency section

These shouldn't be built-deps, my bad

* Change `WarpSyncParams` import to come from `sc_network_sync`

Change introduced here: paritytech/polkadot-sdk#1912

* Add missing `sc-consensus-babe` package

* Remove second generic from `DefaultImportQueue`

This was removed in paritytech/substrate#14612

* Add temporary cursed RPC bounds

* Switch `sp-consensus-grandpa` to be from Crates

* Add Grandpa justification period to service

* Rename `justification_period to` `justification_generation_period`

* Add missing `block_relay` param

Introduced in paritytech/polkadot-sdk#1524

* Try to clean up runtime types

* Add `opaque` types to runtime

These match what was in `node-primitives`. In particular we're interested in the `Block` type which
we were using in a lot of places, and I incorrectly changed to be `Unchechecked` instead of
`Opaque`.

* Use opaque block type in service

* Add full session key impls

* Remove cursed trait bounds for RPC

* Convert some tabs to spaces

Sorry, I had to

* Import `Vec` from `sp_std` in benchmarks

Turns out the issue responsible for this change is this:
paritytech/polkadot-sdk#172

* Pull `TrackedStorageKey` from `sp_storage`

From here: paritytech/substrate#14787

* Add `BenchmarkHelper` to treasury pallet

* TaploFmt

* change max freezes

* Sort TOML imports in runtime manifest

* Move `version` field to be first in runtime manifest

* Organize imports in pallet manifests

* Sort and organize imports for client

* Address TODOs in `entropy-shared`

* Remove TODOs related to `node-primitives`

* Pull `substrate-wasm-builder` from crates.io

* TaploFmt

* Fix benchmarking import post-merge

* Fix another program import port-merge

* Import `Vec` to programs benches

* Wrong vec import 🙃

* Poke CI

* Bump node metadata

---------

Co-authored-by: Jesse Abramowitz <jesse@entropy.xyz>
  • Loading branch information
HCastano and JesseAbram committed Jan 23, 2024
1 parent 090eac6 commit 3511676
Show file tree
Hide file tree
Showing 46 changed files with 2,734 additions and 2,215 deletions.
2,964 changes: 1,756 additions & 1,208 deletions Cargo.lock

Large diffs are not rendered by default.

33 changes: 13 additions & 20 deletions crates/shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,18 @@ repository='https://github.com/entropyxyz/entropy-core'
edition ='2021'

[dependencies]
codec ={ package="parity-scale-codec", version="3.0.0", default-features=false }
scale-info ={ version='2.0.1', default-features=false, features=['derive'] }
serde ={ version="1.0", default-features=false, features=["derive"] }
serde_derive ="1.0.147"
sp-std ={ package="sp-std", git="https://github.com/paritytech/substrate", branch="polkadot-v1.0.0", default-features=false }
frame-support ={ package="frame-support", git="https://github.com/paritytech/substrate", branch="polkadot-v1.0.0", default-features=false, optional=true }
node-primitives={ version="2.0.0", default-features=false, git='https://github.com/paritytech/substrate.git', branch="polkadot-v1.0.0", optional=true }
strum ="0.25.0"
strum_macros ="0.25.3"
codec ={ package="parity-scale-codec", version="3.0.0", default-features=false }
scale-info ={ version='2.0.1', default-features=false, features=['derive'] }
serde ={ version="1.0", default-features=false, features=["derive"] }
serde_derive="1.0.147"
strum ="0.25.0"
strum_macros="0.25.3"

sp-runtime={ version="28.0.0", default-features=false, optional=true }
sp-std ={ version="12.0.0", default-features=false }

[features]
default=["std"]
std=[
"codec/std",
"scale-info/std",
"serde/std",
"sp-std/std",
"frame-support/std",
"dep:node-primitives",
]
wasm=["codec/std", "scale-info/std", "serde/std", "sp-std/std"]
wasm-no-std=["frame-support", "dep:node-primitives"]
default =["std"]
std =["codec/std", "scale-info/std", "serde/std", "sp-runtime/std", "sp-std/std"]
wasm =["codec/std", "scale-info/std", "serde/std", "sp-std/std"]
wasm-no-std=["sp-runtime"]
19 changes: 10 additions & 9 deletions crates/shared/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Copyright (C) 2023 Entropy Cryptography Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
Expand All @@ -17,20 +16,22 @@
#[cfg(not(feature = "wasm"))]
use codec::alloc::vec::Vec;
use codec::{Decode, Encode, MaxEncodedLen};
#[cfg(feature = "wasm-no-std")]
use frame_support::RuntimeDebug;
#[cfg(not(feature = "wasm"))]
use node_primitives::BlockNumber;
use scale_info::TypeInfo;
#[cfg(feature = "std")]
use serde::{Deserialize, Serialize};
#[cfg(feature = "wasm-no-std")]
use sp_runtime::RuntimeDebug;
#[cfg(feature = "std")]
use strum_macros::EnumIter;

/// X25519 public key used by the client in non-interactive ECDH to authenticate/encrypt
/// interactions with the threshold server (eg distributing threshold shares).
pub type X25519PublicKey = [u8; 32];

/// This should match the type found in `entropy-runtime`. We define it ourselves manually here
/// since we don't want to pull that whole crate it just for a `u32`.
type BlockNumber = u32;

/// Defines an application's accessibility
/// Public -> Anyone can request a signature
/// Permissioned -> Only permissioned users can request a signature
Expand All @@ -55,8 +56,8 @@ pub enum KeyVisibility {
Eq,
PartialEq,
TypeInfo,
frame_support::Serialize,
frame_support::Deserialize,
sp_runtime::Serialize,
sp_runtime::Deserialize,
)]
pub struct ValidatorInfo {
pub x25519_public_key: X25519PublicKey,
Expand Down Expand Up @@ -84,8 +85,8 @@ pub struct OcwMessageDkg {
Eq,
PartialEq,
TypeInfo,
frame_support::Serialize,
frame_support::Deserialize,
sp_runtime::Serialize,
sp_runtime::Deserialize,
)]
pub struct OcwMessageProactiveRefresh {
pub validators_info: Vec<ValidatorInfo>,
Expand Down
2 changes: 1 addition & 1 deletion crates/test-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ tokio ={ version="1.16", features=["macros", "rt-multi-thread", "
hex ="0.4.3"
bincode ="1.3.3"
x25519-dalek ="2.0.0"
sp-runtime ={ version="24.0.0", default-features=false, git="https://github.com/paritytech/substrate", branch="polkadot-v1.0.0" }
sp-runtime ={ version="24.0.0", default-features=false }
Binary file modified crates/threshold-signature-server/entropy_metadata.scale
Binary file not shown.
279 changes: 90 additions & 189 deletions node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,207 +16,108 @@ targets=['x86_64-unknown-linux-gnu']
name='entropy'

[dependencies]
jsonrpc-core ='18.0.0'
serde_json ='1.0.0'
log ="0.4.17"
lazy_static ={ version="1.4.0", features=["spin_no_std"] }
clap ={ version="4.0.9", features=["derive"], optional=true }
codec ={ package="parity-scale-codec", version="3.0.0" }
structopt ='0.3.8'
grandpa-primitives ={ version="4.0.0-dev", package="sp-consensus-grandpa", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
hex-literal ="0.3.1"
pallet-im-online ={ version="4.0.0-dev", default-features=false, git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
sc-chain-spec ={ version="4.0.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
serde ={ version="1.0.126", features=["derive"] }
sp-authority-discovery ={ version="4.0.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
sp-consensus-babe ={ version="0.10.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
node-primitives ={ version="2.0.0", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
rand ="0.7.2"
sc-sync-state-rpc ={ version="0.10.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
futures ="0.3.16"
sc-consensus-babe ={ version="0.10.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
sc-network ={ version="0.10.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
sc-network-common ={ version="0.10.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
sc-consensus-slots ={ version="0.10.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
grandpa ={ version="0.10.0-dev", package="sc-consensus-grandpa", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
sc-consensus-grandpa-rpc ={ version="0.10.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
sp-transaction-storage-proof ={ version="4.0.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
sc-authority-discovery ={ version="0.10.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
sc-consensus-babe-rpc ={ version="0.10.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
sc-consensus-epochs ={ version="0.10.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
sp-keystore ={ version="0.27.0", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
jsonrpsee ={ version="0.16.2", features=["server"] }
sp-inherents ={ version="4.0.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
sp-keyring ={ version="24.0.0", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
frame-system ={ version="4.0.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
frame-system-rpc-runtime-api ={ version="4.0.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
pallet-transaction-payment ={ version="4.0.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
pallet-staking-extension ={ version="0.0.9", path="../../pallets/staking" }
pallet-asset-conversion-tx-payment={ version="4.0.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
pallet-free-tx ={ version="0.0.9", path="../../pallets/free-tx" }
pallet-relayer ={ version="0.0.9", path="../../pallets/relayer" }
node-inspect ={ version="0.9.0-dev", optional=true, git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
substrate-frame-cli ={ version="4.0.0-dev", optional=true, git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
sc-sysinfo ={ version="6.0.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
substrate-state-trie-migration-rpc={ version="4.0.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
sc-cli ={ version="0.10.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0", optional=true }
sc-network-sync ={ version="0.10.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
sc-storage-monitor ={ version="0.1.0", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
pallet-asset-tx-payment ={ version="4.0.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
sc-offchain ={ version="4.0.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
entropy-shared ={ path="../../crates/shared", default-features=false, features=["wasm-no-std"] }

# Third-party dependencies
clap ={ version="4.0.9", features=["derive"], optional=true }
codec ={ package="parity-scale-codec", version="3.0.0" }
futures ="0.3.16"
hex-literal ="0.3.1"
jsonrpc-core ='18.0.0'
jsonrpsee ={ version="0.16.2", features=["server"] }
lazy_static ={ version="1.4.0", features=["spin_no_std"] }
log ="0.4.17"
pallet-im-online={ version="24.0.0" }
rand ="0.7.2"
serde ={ version="1.0.126", features=["derive"] }
serde_json ='1.0.0'
structopt ='0.3.8'

# Substrate Client

grandpa ={ version="0.16.0", package="sc-consensus-grandpa" }
node-inspect ={ version="0.9.0", package="staging-node-inspect", optional=true }
sc-authority-discovery ={ version="0.31.0" }
sc-basic-authorship ={ version="0.31.0" }
sc-chain-spec ={ version="24.0.0" }
sc-cli ={ version="0.33.0", optional=true }
sc-client-api ={ version="25.0.0" }
sc-consensus ={ version="0.30.0" }
sc-consensus-babe ={ version="0.31.0" }
sc-consensus-babe-rpc ={ version="0.31.0" }
sc-consensus-epochs ={ version="0.30.0" }
sc-consensus-grandpa-rpc={ version="0.16.0" }
sc-consensus-slots ={ version="0.30.0" }
sc-executor ={ version="0.29.0" }
sc-network ={ version="0.31.0" }
sc-network-common ={ version="0.30.0" }
sc-network-sync ={ version="0.30.0" }
sc-offchain ={ version="26.0.0" }
sc-rpc ={ version="26.0.0" }
sc-rpc-api ={ version="0.30.0" }
sc-service ={ version="0.32.0" }
sc-storage-monitor ={ version="0.13.0" }
sc-sync-state-rpc ={ version="0.31.0" }
sc-sysinfo ={ version="24.0.0" }
sc-telemetry ={ version="12.0.0" }
sc-transaction-pool ={ version="25.0.0" }
sc-transaction-pool-api ={ version="25.0.0" }

# Substrate Primitives
grandpa-primitives ={ version="10.0.0", package="sp-consensus-grandpa" }
sp-api ={ version="23.0.0" }
sp-authority-discovery ={ version="23.0.0" }
sp-block-builder ={ version="23.0.0" }
sp-blockchain ={ version="25.0.0" }
sp-consensus ={ version="0.29.0" }
sp-consensus-babe ={ version="0.29.0" }
sp-core ={ version="25.0.0" }
sp-inherents ={ version="23.0.0" }
sp-keyring ={ version="28.0.0" }
sp-keystore ={ version="0.31.0" }
sp-runtime ={ version="28.0.0" }
sp-timestamp ={ version="23.0.0" }
sp-transaction-storage-proof={ version="23.0.0" }
substrate-frame-rpc-system ={ version="25.0.0" }

# FRAME Dependencies
frame-benchmarking ={ version="25.0.0" }
frame-benchmarking-cli ={ version="29.0.0", optional=true }
frame-system ={ version="25.0.0" }
frame-system-rpc-runtime-api={ version="23.0.0" }

# Substrate Pallets
pallet-asset-conversion-tx-payment={ version="7.0.0" }
pallet-transaction-payment ={ version="25.0.0" }
pallet-transaction-payment-rpc ={ version="27.0.0" }

# Entropy Dependencies
entropy-runtime ={ version="0.0.9", path="../../runtime" }
entropy-shared ={ path="../../crates/shared", default-features=false, features=["wasm-no-std"] }
pallet-free-tx ={ version="0.0.9", path="../../pallets/free-tx" }
pallet-relayer ={ version="0.0.9", path="../../pallets/relayer" }
pallet-staking-extension={ version="0.0.9", path="../../pallets/staking" }

[build-dependencies]
clap ={ version="4.2.5", optional=true }
clap_complete ={ version="3.0", optional=true }
node-inspect ={ version="0.9.0-dev", optional=true, git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
substrate-build-script-utils={ version="3.0.0", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0", optional=true }
substrate-frame-cli ={ version="4.0.0-dev", optional=true, git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
try-runtime-cli ={ version="0.10.0-dev", optional=true, git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
sc-cli ={ version="0.10.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0", optional=true }
pallet-balances ={ version="4.0.0-dev", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }
clap ={ version="4.2.5", optional=true }
clap_complete={ version="3.0", optional=true }

pallet-balances ={ version="25.0.0" }
substrate-build-script-utils={ version="9.0.0" }
try-runtime-cli ={ version="0.35.0" }

[dev-dependencies]
tempfile ="3.1.0"
sp-tracing={ version="10.0.0", git='https://github.com/paritytech/substrate', branch="polkadot-v1.0.0" }

[dependencies.entropy-runtime]
path ='../../runtime'
version='0.0.9'

[dependencies.frame-benchmarking]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='4.0.0-dev'

[dependencies.frame-benchmarking-cli]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version ='4.0.0-dev'
optional=true

[dependencies.pallet-transaction-payment-rpc]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='4.0.0-dev'

[dependencies.sc-basic-authorship]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='0.10.0-dev'

[dependencies.sc-client-api]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='4.0.0-dev'

[dependencies.sc-consensus]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='0.10.0-dev'

[dependencies.sc-consensus-aura]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='0.10.0-dev'

[dependencies.sc-executor]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='0.10.0-dev'

[dependencies.sc-keystore]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='4.0.0-dev'

[dependencies.sc-rpc]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='4.0.0-dev'

[dependencies.sc-rpc-api]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='0.10.0-dev'

[dependencies.sc-service]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='0.10.0-dev'

[dependencies.sc-telemetry]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='4.0.0-dev'

[dependencies.sc-transaction-pool]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='4.0.0-dev'

[dependencies.sc-transaction-pool-api]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='4.0.0-dev'

[dependencies.sp-api]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='4.0.0-dev'

[dependencies.sp-block-builder]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='4.0.0-dev'

[dependencies.sp-blockchain]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='4.0.0-dev'

[dependencies.sp-consensus]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='0.10.0-dev'

[dependencies.sp-consensus-aura]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='0.10.0-dev'

[dependencies.sp-core]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='21.0.0'

[dependencies.sp-runtime]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='24.0.0'

[dependencies.sp-timestamp]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='4.0.0-dev'

[dependencies.substrate-frame-rpc-system]
git ='https://github.com/paritytech/substrate'
branch ="polkadot-v1.0.0"
version='4.0.0-dev'
sp-tracing={ version="14.0.0" }

[features]
default=["cli"]
cli=[
"clap",
"clap_complete",
"frame-benchmarking-cli",
"node-inspect",
"sc-cli",
"frame-benchmarking-cli",
"substrate-frame-cli",
"sc-service/rocksdb",
"clap",
"clap_complete",
"substrate-build-script-utils",
"try-runtime-cli",
]
runtime-benchmarks=[
"entropy-runtime/runtime-benchmarks",
Expand Down
Loading

0 comments on commit 3511676

Please sign in to comment.