Skip to content

Commit

Permalink
upgrade node
Browse files Browse the repository at this point in the history
  • Loading branch information
gianfra-t committed Nov 27, 2024
1 parent 8875c79 commit 586ba8b
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 101 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,17 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.RUSTUP_NIGHTLY_VERSION }}

# - name: Run Tests for Pallets
# run: |
# bash ./scripts/cmd-pallets test "+${{ env.RUSTUP_NIGHTLY_VERSION }} test" "--release"
- name: Run Tests for Pallets
run: |
bash ./scripts/cmd-pallets test "+${{ env.RUSTUP_NIGHTLY_VERSION }} test" "--release"
- name: Run Tests for Other Libraries
run: |
bash ./scripts/cmd-pallets test "+${{ env.RUSTUP_NIGHTLY_VERSION }} test" "--release"
# - name: Run Tests for Clients
# run: |
# bash ./scripts/cmd-clients test "+${{ env.RUSTUP_NIGHTLY_VERSION }} test" "--release"
- name: Run Tests for Clients
run: |
bash ./scripts/cmd-clients test "+${{ env.RUSTUP_NIGHTLY_VERSION }} test" "--release"
cargo-test-vault:
name: Run Tests for Vault
Expand Down
13 changes: 7 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk", branch = "r
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.6.0", default-features = false }
sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.6.0", default-features = false }
sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.6.0", default-features = false }
sc-chain-spec = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.6.0", default-features = false }
sp-consensus = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.6.0", default-features = false }
sc-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.6.0", default-features = false }
sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.6.0", default-features = false }
Expand All @@ -172,10 +173,10 @@ substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk


# Orml dependencies
orml-currencies = { package = "orml-currencies", git = "https://github.com/gianfra-t/open-runtime-module-library.git", default-features = false, branch = "polkadot-v1.6.0" }
orml-tokens = { package = "orml-tokens", git = "https://github.com/gianfra-t/open-runtime-module-library.git", default-features = false, branch = "polkadot-v1.6.0" }
orml-traits = { package = "orml-traits", git = "https://github.com/gianfra-t/open-runtime-module-library.git", default-features = false, branch = "polkadot-v1.6.0" }
orml-oracle = { package = "orml-oracle", git = "https://github.com/gianfra-t/open-runtime-module-library.git", default-features = false, branch = "polkadot-v1.6.0" }
orml-currencies = { package = "orml-currencies", git = "https://github.com/pendulum-chain/open-runtime-module-library.git", default-features = false, branch = "polkadot-v1.6.0" }
orml-tokens = { package = "orml-tokens", git = "https://github.com/pendulum-chain/open-runtime-module-library.git", default-features = false, branch = "polkadot-v1.6.0" }
orml-traits = { package = "orml-traits", git = "https://github.com/pendulum-chain/open-runtime-module-library.git", default-features = false, branch = "polkadot-v1.6.0" }
orml-oracle = { package = "orml-oracle", git = "https://github.com/pendulum-chain/open-runtime-module-library.git", default-features = false, branch = "polkadot-v1.6.0" }


# Git dependency from Pendulum Chain
Expand Down
2 changes: 1 addition & 1 deletion clients/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ primitives = { path = "../../primitives", package = "spacewalk-primitives" }
# Dependencies for the testing utils for integration tests
oracle = { path = "../../pallets/oracle", optional = true }
rand = { workspace = true, default-features = true, optional = true }
tempdir = { workspace = true, default-features = true, optional = true }
tempdir = { workspace = true, optional = true }
testchain = { package = "spacewalk-standalone", path = "../../testchain/node", optional = true }
testchain-runtime = { package = "spacewalk-runtime-standalone-testnet", path = "../../testchain/runtime/testnet", optional = true }
mainnet-runtime = { package = "spacewalk-runtime-standalone-mainnet", path = "../../testchain/runtime/mainnet", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion clients/runtime/src/integration/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub async fn default_provider_client(
role: Role::Authority(key),
telemetry: None,
wasm_method: WasmExecutionMethod::Compiled {
instantiation_strategy: WasmtimeInstantiationStrategy::LegacyInstanceReuse,
instantiation_strategy: WasmtimeInstantiationStrategy::PoolingCopyOnWrite,
},
tokio_handle: tokio::runtime::Handle::current(),
};
Expand Down
3 changes: 2 additions & 1 deletion testchain/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ name = "spacewalk-standalone"
substrate-build-script-utils = { workspace = true }

[dependencies]
clap = { workspace = true, features = ["derive"] }
clap = { version = "4.5.3", features = [ "derive" ] }
codec = { workspace = true, default-features = true, version = "3.0.0" }
hex-literal = { workspace = true, default-features = true }
log = { workspace = true, default-features = true }
Expand All @@ -38,6 +38,7 @@ sc-consensus = { workspace = true, default-features = true }
sc-consensus-aura = { workspace = true, default-features = true }
sc-consensus-manual-seal = { workspace = true, default-features = true }
sc-executor = { workspace = true, default-features = true }
sc-chain-spec = { workspace = true, default-features = true}
sc-consensus-grandpa = { workspace = true, default-features = true }
sc-keystore = { workspace = true, default-features = true }
sc-network = { workspace = true, default-features = true }
Expand Down
138 changes: 59 additions & 79 deletions testchain/node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,77 +78,62 @@ fn get_properties() -> Map<String, Value> {
}

pub fn mainnet_config() -> ChainSpec {
ChainSpec::from_genesis(
"spacewalk",
"dev_mainnet",
ChainType::Development,
move || {
genesis(
get_account_id_from_seed::<sr25519::Public>("Alice"),
vec![authority_keys_from_seed("Alice")],
vec![
get_account_id_from_seed::<sr25519::Public>("Alice"),
get_account_id_from_seed::<sr25519::Public>("Bob"),
get_account_id_from_seed::<sr25519::Public>("Charlie"),
get_account_id_from_seed::<sr25519::Public>("Dave"),
get_account_id_from_seed::<sr25519::Public>("Eve"),
get_account_id_from_seed::<sr25519::Public>("Ferdie"),
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
vec![get_account_id_from_seed::<sr25519::Public>("Bob")],
false,
true,
)
},
Vec::new(),
None,
None,
None,
Some(get_properties()),
None,
)
ChainSpec::builder(spacewalk_runtime_mainnet::WASM_BINARY.expect("WASM binary was not built, please build it!"), Default::default())
.with_name("spacewalk")
.with_id("dev_mainnet")
.with_chain_type(ChainType::Development)
.with_properties(get_properties())
.with_genesis_config(genesis(
get_account_id_from_seed::<sr25519::Public>("Alice"),
vec![authority_keys_from_seed("Alice")],
vec![
get_account_id_from_seed::<sr25519::Public>("Alice"),
get_account_id_from_seed::<sr25519::Public>("Bob"),
get_account_id_from_seed::<sr25519::Public>("Charlie"),
get_account_id_from_seed::<sr25519::Public>("Dave"),
get_account_id_from_seed::<sr25519::Public>("Eve"),
get_account_id_from_seed::<sr25519::Public>("Ferdie"),
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
vec![get_account_id_from_seed::<sr25519::Public>("Bob")],
false,
true,
))
.build()
}

pub fn testnet_config() -> ChainSpec {
ChainSpec::from_genesis(
"spacewalk",
"dev_testnet",
ChainType::Development,
move || {
genesis(
ChainSpec::builder(spacewalk_runtime_mainnet::WASM_BINARY.expect("WASM binary was not built, please build it!"), Default::default())
.with_name("spacewalk")
.with_id("dev_mainnet")
.with_chain_type(ChainType::Development)
.with_properties(get_properties())
.with_genesis_config(genesis(
get_account_id_from_seed::<sr25519::Public>("Alice"),
vec![authority_keys_from_seed("Alice")],
vec![
get_account_id_from_seed::<sr25519::Public>("Alice"),
vec![authority_keys_from_seed("Alice")],
vec![
get_account_id_from_seed::<sr25519::Public>("Alice"),
get_account_id_from_seed::<sr25519::Public>("Bob"),
get_account_id_from_seed::<sr25519::Public>("Charlie"),
get_account_id_from_seed::<sr25519::Public>("Dave"),
get_account_id_from_seed::<sr25519::Public>("Eve"),
get_account_id_from_seed::<sr25519::Public>("Ferdie"),
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
vec![get_account_id_from_seed::<sr25519::Public>("Bob")],
false,
false,
)
},
Vec::new(),
None,
None,
None,
Some(get_properties()),
None,
)
get_account_id_from_seed::<sr25519::Public>("Bob"),
get_account_id_from_seed::<sr25519::Public>("Charlie"),
get_account_id_from_seed::<sr25519::Public>("Dave"),
get_account_id_from_seed::<sr25519::Public>("Eve"),
get_account_id_from_seed::<sr25519::Public>("Ferdie"),
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
vec![get_account_id_from_seed::<sr25519::Public>("Bob")],
false,
false,
))
.build()
}

fn default_pair(currency_id: CurrencyId, is_public_network: bool) -> VaultCurrencyPair<CurrencyId> {
Expand Down Expand Up @@ -176,23 +161,15 @@ fn genesis(
authorized_oracles: Vec<AccountId>,
start_shutdown: bool,
is_public_network: bool,
) -> RuntimeGenesisConfig {
) -> serde_json::Value {
let default_wrapped_currency = if is_public_network {
WRAPPED_CURRENCY_ID_STELLAR_MAINNET
} else {
WRAPPED_CURRENCY_ID_STELLAR_TESTNET
};

// It's very important that we use the correct wasm binary
let wasm_binary = if is_public_network {
spacewalk_runtime_mainnet::WASM_BINARY
} else {
spacewalk_runtime_testnet::WASM_BINARY
};

RuntimeGenesisConfig {
let genesis_config = RuntimeGenesisConfig {
system: SystemConfig {
code: wasm_binary.expect("WASM binary was not build, please build it!").to_vec(),
..Default::default()
},
aura: AuraConfig {
Expand Down Expand Up @@ -384,9 +361,12 @@ fn genesis(
batching_api: b"https://dia-00.pendulumchain.tech:8070/currencies".to_vec(),
coin_infos_map: vec![],
},
}
};

serde_json::to_value(genesis_config).expect("Serialization of genesis config should work")
}


fn create_stellar_testnet_config() -> StellarRelayConfig {
let old_validators = Vec::new();
let old_organizations = Vec::new();
Expand Down
1 change: 1 addition & 0 deletions testchain/node/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use sc_cli::RunCmd;
use clap::Parser;

#[derive(Debug, clap::Parser)]
pub struct Cli {
Expand Down
10 changes: 7 additions & 3 deletions testchain/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,9 @@ pub fn new_full(config: Configuration) -> Result<(TaskManager, RpcHandlers), Ser

let mut net_config = sc_network::config::FullNetworkConfiguration::new(&config.network);

net_config.add_notification_protocol(sc_consensus_grandpa::grandpa_peers_set_config(
grandpa_protocol_name.clone(),
));
let (grandpa_protocol_config, grandpa_notification_service) =
sc_consensus_grandpa::grandpa_peers_set_config(grandpa_protocol_name.clone());
net_config.add_notification_protocol(grandpa_protocol_config);

let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) =
sc_service::build_network(sc_service::BuildNetworkParams {
Expand All @@ -363,6 +363,7 @@ pub fn new_full(config: Configuration) -> Result<(TaskManager, RpcHandlers), Ser
import_queue,
block_announce_validator_builder: None,
warp_sync_params: None,
block_relay: None
})?;

if config.offchain_worker.enabled {
Expand Down Expand Up @@ -514,6 +515,7 @@ pub fn new_full(config: Configuration) -> Result<(TaskManager, RpcHandlers), Ser
shared_voter_state: SharedVoterState::empty(),
telemetry: telemetry.as_ref().map(|x| x.handle()),
offchain_tx_pool_factory: OffchainTransactionPoolFactory::new(transaction_pool),
notification_service: grandpa_notification_service
};

// the GRANDPA voter task is considered infallible, i.e.
Expand Down Expand Up @@ -556,6 +558,7 @@ pub async fn start_instant_mainnet(
import_queue,
block_announce_validator_builder: None,
warp_sync_params: None,
block_relay: None,
})?;

if config.offchain_worker.enabled {
Expand Down Expand Up @@ -693,6 +696,7 @@ pub async fn start_instant_testnet(
import_queue,
block_announce_validator_builder: None,
warp_sync_params: None,
block_relay: None
})?;

if config.offchain_worker.enabled {
Expand Down
4 changes: 4 additions & 0 deletions testchain/runtime/mainnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
#![recursion_limit = "256"]

// // Make the WASM binary available.
// #[cfg(feature = "std")]
// include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));

#[cfg(feature = "runtime-benchmarks")]
#[macro_use]
extern crate frame_benchmarking;
Expand Down
4 changes: 4 additions & 0 deletions testchain/runtime/testnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
#![recursion_limit = "256"]

// // Make the WASM binary available.
// #[cfg(feature = "std")]
// include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));

#[cfg(feature = "runtime-benchmarks")]
#[macro_use]
extern crate frame_benchmarking;
Expand Down

0 comments on commit 586ba8b

Please sign in to comment.