Skip to content

Commit

Permalink
Ab/polkadot stable2409 3 (#392)
Browse files Browse the repository at this point in the history
* psvm and template comparisons

* fix runtime

* fixes

* bump crate versions, fmt

* fmt
  • Loading branch information
brenzi authored Jan 20, 2025
1 parent 80e46a0 commit 51adff3
Show file tree
Hide file tree
Showing 18 changed files with 481 additions and 536 deletions.
656 changes: 288 additions & 368 deletions Cargo.lock

Large diffs are not rendered by default.

190 changes: 95 additions & 95 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,127 +13,127 @@ panic = 'unwind'
[workspace.dependencies]
async-trait = "0.1.68"
clap = { version = "4.5.1", features = ["derive"] }
env_logger = "0.9.0"
env_logger = "0.10.2"
futures = { version = "0.3.30", features = ["thread-pool"] }
geojson = "0.22.2"
hex = "0.4.3"
log = "0.4.20"
maybe-async = { version = "0.2.7" }
parity-scale-codec = { version = "3.6.5", default-features = false, features = ["derive"] }
scale-info = { version = "2.11.0", default-features = false, features = ["derive", "serde"] }
serde = { version = "1.0.197", default-features = false, features = ["alloc", "derive"] }
parity-scale-codec = { version = "3.6.12", default-features = false, features = ["derive"] }
scale-info = { version = "2.11.3", default-features = false, features = ["derive", "serde"] }
serde = { version = "1.0.209", default-features = false, features = ["alloc", "derive"] }
serde_derive = { version = "1.0.117" }
serde_json = { version = "1.0.121", default-features = false, features = ["alloc"] }
serde_json = { version = "1.0.127", default-features = false, features = ["alloc"] }
tokio = { version = "1.37", features = ["rt-multi-thread", "macros", "time"] }

# encointer deps
encointer-balances-tx-payment = { default-features = false, version = "~13.1.0" }
encointer-balances-tx-payment-rpc = { version = "~13.1.0" }
encointer-balances-tx-payment-rpc-runtime-api = { default-features = false, version = "~13.1.0" }
encointer-ceremonies-assignment = { version = "~13.1.0" }
encointer-primitives = { default-features = false, version = "~13.3.0" }
pallet-encointer-balances = { default-features = false, version = "~13.1.0" }
pallet-encointer-bazaar = { default-features = false, version = "~13.1.0" }
pallet-encointer-bazaar-rpc = { version = "~13.1.0" }
pallet-encointer-bazaar-rpc-runtime-api = { default-features = false, version = "~13.1.0" }
pallet-encointer-ceremonies = { default-features = false, version = "~13.1.0" }
pallet-encointer-ceremonies-rpc = { version = "~13.1.0" }
pallet-encointer-ceremonies-rpc-runtime-api = { default-features = false, version = "~13.1.0" }
pallet-encointer-communities = { default-features = false, version = "~13.1.0" }
pallet-encointer-communities-rpc = { version = "~13.1.0" }
pallet-encointer-communities-rpc-runtime-api = { default-features = false, version = "~13.1.0" }
pallet-encointer-democracy = { default-features = false, version = "~13.3.1" }
pallet-encointer-faucet = { default-features = false, version = "~13.2.0" }
pallet-encointer-reputation-commitments = { default-features = false, version = "~13.1.0" }
pallet-encointer-scheduler = { default-features = false, version = "~13.1.0" }
pallet-encointer-treasuries = { default-features = false, version = "~13.3.0" }
pallet-encointer-treasuries-rpc = { version = "~13.3.0" }
pallet-encointer-treasuries-rpc-runtime-api = { default-features = false, version = "~13.3.0" }
encointer-balances-tx-payment = { default-features = false, version = "~14.1.0" }
encointer-balances-tx-payment-rpc = { version = "~14.1.0" }
encointer-balances-tx-payment-rpc-runtime-api = { default-features = false, version = "~14.1.0" }
encointer-ceremonies-assignment = { version = "~14.1.0" }
encointer-primitives = { default-features = false, version = "~14.4.0" }
pallet-encointer-balances = { default-features = false, version = "~14.2.0" }
pallet-encointer-bazaar = { default-features = false, version = "~14.1.0" }
pallet-encointer-bazaar-rpc = { version = "~14.1.0" }
pallet-encointer-bazaar-rpc-runtime-api = { default-features = false, version = "~14.1.0" }
pallet-encointer-ceremonies = { default-features = false, version = "~14.1.0" }
pallet-encointer-ceremonies-rpc = { version = "~14.1.0" }
pallet-encointer-ceremonies-rpc-runtime-api = { default-features = false, version = "~14.1.0" }
pallet-encointer-communities = { default-features = false, version = "~14.1.0" }
pallet-encointer-communities-rpc = { version = "~14.1.0" }
pallet-encointer-communities-rpc-runtime-api = { default-features = false, version = "~14.1.0" }
pallet-encointer-democracy = { default-features = false, version = "~14.4.0" }
pallet-encointer-faucet = { default-features = false, version = "~14.2.0" }
pallet-encointer-reputation-commitments = { default-features = false, version = "~14.1.0" }
pallet-encointer-scheduler = { default-features = false, version = "~14.1.0" }
pallet-encointer-treasuries = { default-features = false, version = "~14.4.1" }
pallet-encointer-treasuries-rpc = { version = "~14.3.0" }
pallet-encointer-treasuries-rpc-runtime-api = { default-features = false, version = "~14.3.0" }


# substrate deps
frame-benchmarking = { version = "36.0.0", default-features = false }
frame-benchmarking-cli = { version = "40.0.0" }
frame-executive = { version = "36.0.0", default-features = false }
frame-metadata-hash-extension = { version = "0.4.0", default-features = false }
frame-support = { version = "36.0.0", default-features = false }
frame-system = { version = "36.1.0", default-features = false }
frame-system-benchmarking = { version = "36.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "33.0.0", default-features = false }
frame-try-runtime = { version = "0.42.0", default-features = false }
frame-benchmarking = { version = "38.0.0", default-features = false }
frame-benchmarking-cli = { version = "43.0.0" }
frame-executive = { version = "38.0.0", default-features = false }
frame-metadata-hash-extension = { version = "0.6.0", default-features = false }
frame-support = { version = "38.2.0", default-features = false }
frame-system = { version = "38.0.0", default-features = false }
frame-system-benchmarking = { version = "38.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "34.0.0", default-features = false }
frame-try-runtime = { version = "0.44.0", default-features = false }
hex-literal = { version = "0.4.1" }
jsonrpsee = { version = "0.23", features = ["server"] }
pallet-asset-tx-payment = { version = "36.0.0", default-features = false }
pallet-aura = { version = "35.0.0", default-features = false }
pallet-balances = { version = "37.0.0", default-features = false }
pallet-grandpa = { version = "36.0.0", default-features = false }
pallet-insecure-randomness-collective-flip = { version = "24.0.0", default-features = false }
pallet-proxy = { version = "36.0.0", default-features = false }
pallet-scheduler = { version = "37.0.0", default-features = false }
pallet-sudo = { version = "36.0.0", default-features = false }
pallet-timestamp = { version = "35.0.0", default-features = false }
pallet-transaction-payment = { version = "36.0.0", default-features = false }
pallet-transaction-payment-rpc = { version = "38.0.0" }
pallet-transaction-payment-rpc-runtime-api = { version = "36.0.0", default-features = false }
pallet-treasury = { version = "35.0.0", default-features = false }
pallet-utility = { version = "36.0.0", default-features = false }
sc-basic-authorship = { version = "0.42.0" }
sc-chain-spec = "35.0.0"
sc-cli = { version = "0.44.0" }
sc-client-api = { version = "35.1.0" }
sc-consensus = { version = "0.41.0" }
sc-consensus-aura = { version = "0.42.0" }
sc-consensus-grandpa = { version = "0.27.0" }
sc-executor = { version = "0.39.0" }
sc-keystore = { version = "32.0.0" }
sc-network = { version = "0.42.0" }
sc-offchain = { version = "37.0.0" }
sc-rpc = "37.0.0"
sc-rpc-api = "0.41.0"
sc-service = { version = "0.43.0" }
sc-telemetry = { version = "22.0.0" }
sc-transaction-pool = { version = "35.0.0" }
sc-transaction-pool-api = { version = "35.0.0" }
sp-api = { version = "33.0.0", default-features = false }
sp-application-crypto = { version = "37.0.0", default-features = false }
jsonrpsee = { version = "0.24.7", features = ["server"] }
pallet-asset-tx-payment = { version = "38.0.0", default-features = false }
pallet-aura = { version = "37.0.0", default-features = false }
pallet-balances = { version = "39.0.0", default-features = false }
pallet-grandpa = { version = "38.0.0", default-features = false }
pallet-insecure-randomness-collective-flip = { version = "26.0.0", default-features = false }
pallet-proxy = { version = "38.0.0", default-features = false }
pallet-scheduler = { version = "39.0.0", default-features = false }
pallet-sudo = { version = "38.0.0", default-features = false }
pallet-timestamp = { version = "37.0.0", default-features = false }
pallet-transaction-payment = { version = "38.0.2", default-features = false }
pallet-transaction-payment-rpc = { version = "41.0.0" }
pallet-transaction-payment-rpc-runtime-api = { version = "38.0.0", default-features = false }
pallet-treasury = { version = "37.0.0", default-features = false }
pallet-utility = { version = "38.0.0", default-features = false }
sc-basic-authorship = { version = "0.45.0" }
sc-chain-spec = "38.0.0"
sc-cli = { version = "0.47.0" }
sc-client-api = { version = "37.0.0" }
sc-consensus = { version = "0.44.0" }
sc-consensus-aura = { version = "0.45.0" }
sc-consensus-grandpa = { version = "0.30.0" }
sc-executor = { version = "0.40.1" }
sc-keystore = { version = "33.0.0" }
sc-network = { version = "0.45.3" }
sc-offchain = { version = "40.0.0" }
sc-rpc = "40.0.0"
sc-rpc-api = "0.44.0"
sc-service = { version = "0.46.0" }
sc-telemetry = { version = "25.0.0" }
sc-transaction-pool = { version = "37.0.0" }
sc-transaction-pool-api = { version = "37.0.0" }
sp-api = { version = "34.0.0", default-features = false }
sp-application-crypto = { version = "38.0.0", default-features = false }
sp-arithmetic = { version = "26.0.0", default-features = false }
sp-block-builder = { version = "33.0.0", default-features = false }
sp-blockchain = { version = "35.1.0", default-features = false }
sp-consensus = { version = "0.39.1", default-features = false }
sp-consensus-aura = { version = "0.39.0", default-features = false, features = ["serde"] }
sp-consensus-grandpa = { version = "20.0.0", default-features = false, features = ["serde"] }
sp-block-builder = { version = "34.0.0", default-features = false }
sp-blockchain = { version = "37.0.1", default-features = false }
sp-consensus = { version = "0.40.0", default-features = false }
sp-consensus-aura = { version = "0.40.0", default-features = false, features = ["serde"] }
sp-consensus-grandpa = { version = "21.0.0", default-features = false, features = ["serde"] }
sp-core = { version = "34.0.0", default-features = false, features = ["serde"] }
sp-genesis-builder = { version = "0.14.0", default-features = false }
sp-inherents = { version = "33.0.0", default-features = false }
sp-io = { version = "37.0.0", default-features = false }
sp-keyring = { version = "38.0.0", default-features = false }
sp-genesis-builder = { version = "0.15.1", default-features = false }
sp-inherents = { version = "34.0.0", default-features = false }
sp-io = { version = "38.0.0", default-features = false }
sp-keyring = { version = "39.0.0", default-features = false }
sp-keystore = { version = "0.40.0", default-features = false }
sp-offchain = { version = "33.0.0", default-features = false }
sp-offchain = { version = "34.0.0", default-features = false }
sp-rpc = { version = "32.0.0", default-features = false }
sp-runtime = { version = "38.0.0", default-features = false, features = ["serde"] }
sp-session = { version = "34.0.0", default-features = false }
sp-staking = { version = "33.0.0", default-features = false }
sp-runtime = { version = "39.0.5", default-features = false, features = ["serde"] }
sp-session = { version = "36.0.0", default-features = false }
sp-staking = { version = "36.0.0", default-features = false }
sp-std = { version = "14.0.0", default-features = false }
sp-storage = { version = "21.0.0", default-features = false }
sp-timestamp = { version = "33.0.0", default-features = false }
sp-transaction-pool = { version = "33.0.0", default-features = false }
sp-version = { version = "36.0.0", default-features = false, features = ["serde"] }
substrate-frame-rpc-system = { version = "36.0.0", default-features = false }
sp-timestamp = { version = "34.0.0", default-features = false }
sp-transaction-pool = { version = "34.0.0", default-features = false }
sp-version = { version = "37.0.0", default-features = false, features = ["serde"] }
substrate-frame-rpc-system = { version = "39.0.0", default-features = false }

substrate-wasm-builder = "23.0.0"
substrate-wasm-builder = "24.0.1"
substrate-build-script-utils = "11.0.0"

substrate-api-client = { version = "0.18.0", features = ["jsonrpsee-client", "disable-metadata-hash-check"] }
ac-keystore = { version = "0.18.0" }
substrate-api-client = { version = "1.16.0", features = ["jsonrpsee-client", "disable-metadata-hash-check"] }
ac-keystore = { version = "1.16.0" }

[patch.crates-io]
## api client
# patch needed because release 0.18 isn't depending on sdk 1.14
ac-compose-macros = { git = "https://github.com/encointer/substrate-api-client.git", branch = "crates-io-v0.18.0-sdk-v1.14" }
ac-keystore = { git = "https://github.com/encointer/substrate-api-client.git", branch = "crates-io-v0.18.0-sdk-v1.14" }
ac-node-api = { git = "https://github.com/encointer/substrate-api-client.git", branch = "crates-io-v0.18.0-sdk-v1.14" }
ac-primitives = { git = "https://github.com/encointer/substrate-api-client.git", branch = "crates-io-v0.18.0-sdk-v1.14" }
substrate-api-client = { git = "https://github.com/encointer/substrate-api-client.git", branch = "crates-io-v0.18.0-sdk-v1.14" }
#ac-compose-macros = { git = "https://github.com/encointer/substrate-api-client.git", branch = "crates-io-v0.18.0-sdk-v1.14" }
#ac-keystore = { git = "https://github.com/encointer/substrate-api-client.git", branch = "crates-io-v0.18.0-sdk-v1.14" }
#ac-node-api = { git = "https://github.com/encointer/substrate-api-client.git", branch = "crates-io-v0.18.0-sdk-v1.14" }
#ac-primitives = { git = "https://github.com/encointer/substrate-api-client.git", branch = "crates-io-v0.18.0-sdk-v1.14" }
#substrate-api-client = { git = "https://github.com/encointer/substrate-api-client.git", branch = "crates-io-v0.18.0-sdk-v1.14" }
## local patching
#ac-compose-macros = { path = "../../substrate-api-client/compose-macros" }
#ac-node-api = { path = "../../substrate-api-client/node-api" }
Expand Down
2 changes: 1 addition & 1 deletion client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "encointer-client-notee"
authors = ["encointer.org <[email protected]>"]
edition = "2021"
#keep with node version. major, minor and patch
version = "1.14.5"
version = "1.16.0"

[dependencies]
# todo migrate to clap >=3 https://github.com/encointer/encointer-node/issues/107
Expand Down
2 changes: 1 addition & 1 deletion client/encointer-api-client-extension/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "encointer-api-client-extension"
# align with encointer pallet crates versions
version = "13.3.2"
version = "14.4.0"
edition = "2021"

[dependencies]
Expand Down
16 changes: 8 additions & 8 deletions client/encointer-api-client-extension/src/ceremonies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,13 @@ impl CeremoniesApi for Api {
};

if let Some(p_index) = index_query("BootstrapperIndex").await? {
return Ok(Registration::new(p_index, RegistrationType::Bootstrapper))
return Ok(Registration::new(p_index, RegistrationType::Bootstrapper));
} else if let Some(p_index) = index_query("ReputableIndex").await? {
return Ok(Registration::new(p_index, RegistrationType::Reputable))
return Ok(Registration::new(p_index, RegistrationType::Reputable));
} else if let Some(p_index) = index_query("EndorseeIndex").await? {
return Ok(Registration::new(p_index, RegistrationType::Endorsee))
return Ok(Registration::new(p_index, RegistrationType::Endorsee));
} else if let Some(p_index) = index_query("NewbieIndex").await? {
return Ok(Registration::new(p_index, RegistrationType::Newbie))
return Ok(Registration::new(p_index, RegistrationType::Newbie));
}

Err(ApiClientError::Other(
Expand Down Expand Up @@ -294,7 +294,7 @@ impl CeremoniesApi for Api {

if meetup_count == 0 {
warn!("Meetup Count is 0.");
return Ok(None)
return Ok(None);
}

let assignments = self.get_assignments(community_ceremony, maybe_at).await?;
Expand Down Expand Up @@ -355,7 +355,7 @@ impl CeremoniesApi for Api {
"Invalid meetup index > meetup count: {meetup_index_zero_based}, {meetup_count}"
)
.into(),
))
));
}

let params = self.get_assignments(community_ceremony, maybe_at).await?;
Expand Down Expand Up @@ -564,11 +564,11 @@ async fn get_bootstrapper_or_reputable(
maybe_at: Option<Hash>,
) -> Result<Option<AccountId>> {
if p_index < assigned.bootstrappers {
return api.get_bootstrapper(community_ceremony, &(p_index + 1), maybe_at).await
return api.get_bootstrapper(community_ceremony, &(p_index + 1), maybe_at).await;
} else if p_index < assigned.bootstrappers + assigned.reputables {
return api
.get_reputable(community_ceremony, &(p_index - assigned.bootstrappers + 1), maybe_at)
.await
.await;
}

Ok(None)
Expand Down
4 changes: 2 additions & 2 deletions client/encointer-api-client-extension/src/extrinsic_params.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{Api, CommunitiesApi, ExtrinsicAddress};
use encointer_node_notee_runtime::{Hash, Index, Signature};
use encointer_node_notee_runtime::{Hash, Nonce, Signature};
use encointer_primitives::communities::CommunityIdentifier;
use parity_scale_codec::{Decode, Encode};
use substrate_api_client::ac_primitives::{
Expand All @@ -18,7 +18,7 @@ pub type EncointerXt<Call> = UncheckedExtrinsicV4<
ExtrinsicAddress,
Call,
Signature,
GenericSignedExtra<CommunityCurrencyTip, Index>,
GenericSignedExtra<CommunityCurrencyTip, Nonce>,
>;

/// A tip payment made in the form of a specific asset.
Expand Down
4 changes: 2 additions & 2 deletions client/src/commands/encointer_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,12 @@ async fn listen(matches: &ArgMatches<'_>) {
if matches.is_present("events") &&
count >= value_t!(matches.value_of("events"), u32).unwrap()
{
return
return;
};
if matches.is_present("blocks") &&
blocks > value_t!(matches.value_of("blocks"), u32).unwrap()
{
return
return;
};
let event_results = subscription.next_events::<RuntimeEvent, Hash>().await.unwrap();
blocks += 1;
Expand Down
15 changes: 9 additions & 6 deletions client/src/commands/encointer_democracy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub fn submit_set_inactivity_timeout_proposal(
api,
"EncointerDemocracy",
"submit_proposal",
ProposalAction::<AccountId, Balance>::SetInactivityTimeout(inactivity_timeout)
ProposalAction::<AccountId, Balance, Moment>::SetInactivityTimeout(inactivity_timeout)
)
.unwrap();
ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await;
Expand Down Expand Up @@ -78,7 +78,7 @@ pub fn submit_update_nominal_income_proposal(
api,
"EncointerDemocracy",
"submit_proposal",
ProposalAction::<AccountId, Balance>::UpdateNominalIncome(cid, new_income)
ProposalAction::<AccountId, Balance, Moment>::UpdateNominalIncome(cid, new_income)
)
.unwrap();
ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await;
Expand Down Expand Up @@ -111,7 +111,10 @@ pub fn submit_update_demurrage_proposal(
api,
"EncointerDemocracy",
"submit_proposal",
ProposalAction::<AccountId, Balance>::UpdateDemurrage(cid, new_demurrage_per_block)
ProposalAction::<AccountId, Balance, Moment>::UpdateDemurrage(
cid,
new_demurrage_per_block
)
)
.unwrap();
ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await;
Expand Down Expand Up @@ -142,7 +145,7 @@ pub fn submit_petition(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap
api,
"EncointerDemocracy",
"submit_proposal",
ProposalAction::<AccountId, Balance>::Petition(maybecid, demand.clone())
ProposalAction::<AccountId, Balance, Moment>::Petition(maybecid, demand.clone())
)
.unwrap();
ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await;
Expand Down Expand Up @@ -180,7 +183,7 @@ pub fn submit_spend_native_proposal(
api,
"EncointerDemocracy",
"submit_proposal",
ProposalAction::<AccountId, Balance>::SpendNative(maybecid, to.clone(), amount)
ProposalAction::<AccountId, Balance, Moment>::SpendNative(maybecid, to.clone(), amount)
)
.unwrap();
ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await;
Expand Down Expand Up @@ -436,7 +439,7 @@ async fn get_relevant_electorate(
api.get_global_reputation_count(c, maybe_at).await.unwrap_or(0),
};
}
return count
return count;
} else {
panic!("couldn't fetch some values")
}
Expand Down
2 changes: 1 addition & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = "https://github.com/encointer/encointer-node"
# * Align major and minor version with polkadot-sdk major.minor.
# * Bump patch version for new releases, and make it the release tag.
# * The client should follow this version.
version = "1.14.5"
version = "1.16.0"

[[bin]]
name = "encointer-node-notee"
Expand Down
Loading

0 comments on commit 51adff3

Please sign in to comment.