From 2752fc6974a280b1517a2e77460d6f9254558b9a Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 10 Dec 2024 15:42:09 +0100 Subject: [PATCH] chore: bump versions 1.7.4 -> 1.7.5 --- Cargo.lock | 20 +++++----- api/bin/chainflip-broker-api/Cargo.toml | 2 +- api/bin/chainflip-cli/Cargo.toml | 2 +- api/bin/chainflip-lp-api/Cargo.toml | 2 +- api/lib/Cargo.toml | 2 +- engine-dylib/Cargo.toml | 4 +- engine-proc-macros/Cargo.toml | 2 +- engine-runner-bin/Cargo.toml | 6 +-- engine-runner-bin/src/main.rs | 2 +- engine-upgrade-utils/src/lib.rs | 2 +- engine/Cargo.toml | 2 +- state-chain/node/Cargo.toml | 2 +- state-chain/runtime/Cargo.toml | 2 +- state-chain/runtime/src/lib.rs | 2 +- .../runtime/src/migrations/housekeeping.rs | 40 ++++++++++++++++++- 15 files changed, 64 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9008023070..8b8d2e97b9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1327,7 +1327,7 @@ dependencies = [ [[package]] name = "cf-engine-dylib" -version = "1.7.4" +version = "1.7.5" dependencies = [ "chainflip-engine", "engine-proc-macros", @@ -1578,7 +1578,7 @@ dependencies = [ [[package]] name = "chainflip-api" -version = "1.7.4" +version = "1.7.5" dependencies = [ "anyhow", "async-trait", @@ -1625,7 +1625,7 @@ dependencies = [ [[package]] name = "chainflip-broker-api" -version = "1.7.4" +version = "1.7.5" dependencies = [ "anyhow", "cf-chains", @@ -1649,7 +1649,7 @@ dependencies = [ [[package]] name = "chainflip-cli" -version = "1.7.4" +version = "1.7.5" dependencies = [ "anyhow", "bigdecimal", @@ -1670,7 +1670,7 @@ dependencies = [ [[package]] name = "chainflip-engine" -version = "1.7.4" +version = "1.7.5" dependencies = [ "anyhow", "async-broadcast", @@ -1807,7 +1807,7 @@ dependencies = [ [[package]] name = "chainflip-lp-api" -version = "1.7.4" +version = "1.7.5" dependencies = [ "anyhow", "cf-primitives", @@ -1834,7 +1834,7 @@ dependencies = [ [[package]] name = "chainflip-node" -version = "1.7.4" +version = "1.7.5" dependencies = [ "cf-chains", "cf-primitives", @@ -3224,7 +3224,7 @@ checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" [[package]] name = "engine-proc-macros" -version = "1.7.4" +version = "1.7.5" dependencies = [ "engine-upgrade-utils", "proc-macro2", @@ -3234,7 +3234,7 @@ dependencies = [ [[package]] name = "engine-runner" -version = "1.7.4" +version = "1.7.5" dependencies = [ "anyhow", "assert_cmd", @@ -13058,7 +13058,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "state-chain-runtime" -version = "1.7.4" +version = "1.7.5" dependencies = [ "bitvec", "cf-amm", diff --git a/api/bin/chainflip-broker-api/Cargo.toml b/api/bin/chainflip-broker-api/Cargo.toml index dc5cd77029..9f5493d242 100644 --- a/api/bin/chainflip-broker-api/Cargo.toml +++ b/api/bin/chainflip-broker-api/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["Chainflip team "] name = "chainflip-broker-api" -version = "1.7.4" +version = "1.7.5" edition = "2021" [package.metadata.deb] diff --git a/api/bin/chainflip-cli/Cargo.toml b/api/bin/chainflip-cli/Cargo.toml index 3fac626647..d98eb06ea4 100644 --- a/api/bin/chainflip-cli/Cargo.toml +++ b/api/bin/chainflip-cli/Cargo.toml @@ -3,7 +3,7 @@ authors = ["Chainflip team "] edition = "2021" build = "build.rs" name = "chainflip-cli" -version = "1.7.4" +version = "1.7.5" [lints] workspace = true diff --git a/api/bin/chainflip-lp-api/Cargo.toml b/api/bin/chainflip-lp-api/Cargo.toml index d49534c1ac..e4556551dd 100644 --- a/api/bin/chainflip-lp-api/Cargo.toml +++ b/api/bin/chainflip-lp-api/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["Chainflip team "] name = "chainflip-lp-api" -version = "1.7.4" +version = "1.7.5" edition = "2021" [package.metadata.deb] diff --git a/api/lib/Cargo.toml b/api/lib/Cargo.toml index 7a14cc83f4..820de097ff 100644 --- a/api/lib/Cargo.toml +++ b/api/lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chainflip-api" -version = "1.7.4" +version = "1.7.5" edition = "2021" [lints] diff --git a/engine-dylib/Cargo.toml b/engine-dylib/Cargo.toml index 74f00a63c0..0317613044 100644 --- a/engine-dylib/Cargo.toml +++ b/engine-dylib/Cargo.toml @@ -3,11 +3,11 @@ authors = ["Chainflip team "] build = "build.rs" edition = "2021" name = "cf-engine-dylib" -version = "1.7.4" +version = "1.7.5" [lib] crate-type = ["cdylib"] -name = "chainflip_engine_v1_7_4" +name = "chainflip_engine_v1_7_5" path = "src/lib.rs" [dependencies] diff --git a/engine-proc-macros/Cargo.toml b/engine-proc-macros/Cargo.toml index 5715b78877..46e8afabc1 100644 --- a/engine-proc-macros/Cargo.toml +++ b/engine-proc-macros/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" name = "engine-proc-macros" # The version here is the version that will be used for the generated code, and therefore will be the # suffix of the generated engine entrypoint. TODO: Fix this. -version = "1.7.4" +version = "1.7.5" [lib] proc-macro = true diff --git a/engine-runner-bin/Cargo.toml b/engine-runner-bin/Cargo.toml index 086a40593f..aa8a7de8af 100644 --- a/engine-runner-bin/Cargo.toml +++ b/engine-runner-bin/Cargo.toml @@ -2,7 +2,7 @@ name = "engine-runner" description = "The central runner for the chainflip engine, it requires two shared library versions to run." # NB: When updating this version, you must update the debian assets appropriately too. -version = "1.7.4" +version = "1.7.5" authors = ["Chainflip team "] build = "build.rs" edition = "2021" @@ -22,10 +22,10 @@ assets = [ # to specify this. We do this in the `chainflip-engine.service` files, so the user does not need to set it # manually. [ - "target/release/libchainflip_engine_v1_7_4.so", + "target/release/libchainflip_engine_v1_7_5.so", # This is the path where the engine dylib is searched for on linux. # As set in the build.rs file. - "usr/lib/chainflip-engine/libchainflip_engine_v1_7_4.so", + "usr/lib/chainflip-engine/libchainflip_engine_v1_7_5.so", "755", ], # The old version gets put into target/release by the package github actions workflow. diff --git a/engine-runner-bin/src/main.rs b/engine-runner-bin/src/main.rs index 9f4b1d9a9b..019037c5e7 100644 --- a/engine-runner-bin/src/main.rs +++ b/engine-runner-bin/src/main.rs @@ -13,7 +13,7 @@ mod old { } mod new { - #[engine_proc_macros::link_engine_library_version("1.7.4")] + #[engine_proc_macros::link_engine_library_version("1.7.5")] extern "C" { fn cfe_entrypoint( c_args: engine_upgrade_utils::CStrArray, diff --git a/engine-upgrade-utils/src/lib.rs b/engine-upgrade-utils/src/lib.rs index f46b335b16..aec0562fa5 100644 --- a/engine-upgrade-utils/src/lib.rs +++ b/engine-upgrade-utils/src/lib.rs @@ -11,7 +11,7 @@ pub mod build_helpers; // relevant crates. // Should also check that the compatibility function below `args_compatible_with_old` is correct. pub const OLD_VERSION: &str = "1.6.8"; -pub const NEW_VERSION: &str = "1.7.4"; +pub const NEW_VERSION: &str = "1.7.5"; pub const ENGINE_LIB_PREFIX: &str = "chainflip_engine_v"; pub const ENGINE_ENTRYPOINT_PREFIX: &str = "cfe_entrypoint_v"; diff --git a/engine/Cargo.toml b/engine/Cargo.toml index e16e2dedde..ba24d4c06b 100644 --- a/engine/Cargo.toml +++ b/engine/Cargo.toml @@ -3,7 +3,7 @@ authors = ["Chainflip team "] build = "build.rs" edition = "2021" name = "chainflip-engine" -version = "1.7.4" +version = "1.7.5" [lib] crate-type = ["lib"] diff --git a/state-chain/node/Cargo.toml b/state-chain/node/Cargo.toml index c4f9916b91..0644e74cf2 100644 --- a/state-chain/node/Cargo.toml +++ b/state-chain/node/Cargo.toml @@ -8,7 +8,7 @@ license = "" name = "chainflip-node" publish = false repository = "https://github.com/chainflip-io/chainflip-backend" -version = "1.7.4" +version = "1.7.5" [[bin]] name = "chainflip-node" diff --git a/state-chain/runtime/Cargo.toml b/state-chain/runtime/Cargo.toml index 3684efbc68..778dea7df6 100644 --- a/state-chain/runtime/Cargo.toml +++ b/state-chain/runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "state-chain-runtime" -version = "1.7.4" +version = "1.7.5" authors = ["Chainflip Team "] edition = "2021" homepage = "https://chainflip.io" diff --git a/state-chain/runtime/src/lib.rs b/state-chain/runtime/src/lib.rs index 07d1e88247..df192228f5 100644 --- a/state-chain/runtime/src/lib.rs +++ b/state-chain/runtime/src/lib.rs @@ -206,7 +206,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("chainflip-node"), impl_name: create_runtime_str!("chainflip-node"), authoring_version: 1, - spec_version: 174, + spec_version: 175, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 12, diff --git a/state-chain/runtime/src/migrations/housekeeping.rs b/state-chain/runtime/src/migrations/housekeeping.rs index 8e8a296285..172b11fa37 100644 --- a/state-chain/runtime/src/migrations/housekeeping.rs +++ b/state-chain/runtime/src/migrations/housekeeping.rs @@ -1,5 +1,11 @@ -use crate::Runtime; -use cf_chains::instances::{ArbitrumInstance, EthereumInstance, PolkadotInstance}; +use core::str::FromStr as _; + +use crate::{Runtime, SolEnvironment}; +use cf_chains::{ + instances::{ArbitrumInstance, EthereumInstance, PolkadotInstance, SolanaInstance}, + sol::{api::SolanaApi, SolAddress, SolAsset}, + ForeignChain, Solana, TransferAssetParams, +}; use cf_runtime_upgrade_utilities::genesis_hashes; use frame_support::{traits::OnRuntimeUpgrade, weights::Weight}; use pallet_cf_broadcast::migrations::remove_aborted_broadcasts; @@ -21,6 +27,36 @@ impl OnRuntimeUpgrade for Migration { remove_aborted_broadcasts::remove_stale_and_all_older::( remove_aborted_broadcasts::ARBITRUM_MAX_ABORTED_BROADCAST_BERGHAIN, ); + if crate::VERSION.spec_version == 175 { + log::info!("🧹 Housekeeping, bumping Solana refund"); + if let Ok(to) = + SolAddress::from_str("9RbaLSDtScGDur9UGAiBQFYPiKK9xDZLuD39xkEqa5Zw") + { + if let Ok(mut calls) = + SolanaApi::::transfer(sp_std::vec![( + TransferAssetParams:: { + asset: SolAsset::SolUsdc, + amount: 162740593954, + to, + }, + (ForeignChain::Solana, 0) + )]) { + if calls.len() == 1 { + let _ = as cf_traits::Broadcaster< + Solana, + >>::threshold_sign_and_broadcast( + calls.pop().expect("Checked for 1 call.").0, + ); + } else { + log::error!("Expected 1 call, got {}", calls.len()); + } + } else { + log::error!("Failed to build Solana transaction"); + } + } else { + log::error!("Invalid Solana address"); + } + } }, genesis_hashes::PERSEVERANCE => { log::info!("🧹 Housekeeping, removing stale aborted broadcasts");