diff --git a/.github/workflows/release-program.yaml b/.github/workflows/release-program.yaml index 02090c99..ba9b98ee 100644 --- a/.github/workflows/release-program.yaml +++ b/.github/workflows/release-program.yaml @@ -6,10 +6,10 @@ on: - "testest-program-*" env: - RUST_TOOLCHAIN: 1.71.0 - SOLANA_CLI_VERSION: 1.16.20 - ANCHOR_CLI_VERSION: 0.29.0 - ANCHOR_SHA: fc9fd6d24b9be84abb2f40e47ed3faf7b11864ae + RUST_TOOLCHAIN: 1.75.0 + SOLANA_CLI_VERSION: 1.18.15 + ANCHOR_CLI_VERSION: 0.30.1 + ANCHOR_SHA: e6d7dafe12da661a36ad1b4f3b5970e8986e5321 CARGO_TERM_COLOR: always jobs: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3cbe64cb..14b6db37 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -53,8 +53,8 @@ jobs: test-unit: name: Rust Unit Tests runs-on: ubuntu-latest - env: - RUSTUP_TOOLCHAIN: stable + # env: + # RUSTUP_TOOLCHAIN: stable steps: - uses: actions/checkout@v3 diff --git a/Cargo.lock b/Cargo.lock index bdfb5c7b..5d4f07ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4816,7 +4816,7 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58267dd2fbaa6dceecba9e3e106d2d90a2b02497c0e8b01b8759beccf5113938" dependencies = [ - "num 0.2.1", + "num 0.4.3", ] [[package]] @@ -6658,9 +6658,9 @@ dependencies = [ [[package]] name = "switchboard-on-demand" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25f9c5e5776ee0db744d4adf4d61711416677eb03b03a499d2d895e348ebc24" +checksum = "3852951c42f8876a443060b6882bda945f1621224236ead37959e80f5369cf81" dependencies = [ "arc-swap", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index ef40bf6b..7b107333 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ anchor-client = { git = "https://github.com/mrgnlabs/anchor.git", rev = "fdcf299 pyth-sdk-solana = "=0.10.1" pyth-solana-receiver-sdk = "0.3.0" switchboard-solana = "0.29.0" -switchboard-on-demand = "0.1.13" +switchboard-on-demand = "0.1.14" borsh = "0.10.3" [profile.release] diff --git a/programs/marginfi/src/constants.rs b/programs/marginfi/src/constants.rs index 71f9d4be..360f021d 100644 --- a/programs/marginfi/src/constants.rs +++ b/programs/marginfi/src/constants.rs @@ -25,6 +25,14 @@ cfg_if::cfg_if! { } } +cfg_if::cfg_if! { + if #[cfg(feature = "devnet")] { + pub const SWITCHBOARD_PULL_ID: Pubkey = pubkey!("Aio4gaXjXzJNVLtzwtNVmSqGKpANtXhybbkhtAC94ji2"); + } else { + pub const SWITCHBOARD_PULL_ID: Pubkey = pubkey!("SBondMDrcV3K4kxZR1HNVT7osZxAHVHgYXL5Ze1oMUv"); + } +} + /// TODO: Make these variable per bank pub const LIQUIDATION_LIQUIDATOR_FEE: I80F48 = I80F48!(0.025); pub const LIQUIDATION_INSURANCE_FEE: I80F48 = I80F48!(0.025); diff --git a/programs/marginfi/src/state/price.rs b/programs/marginfi/src/state/price.rs index 7ac1f8ec..12742cd7 100644 --- a/programs/marginfi/src/state/price.rs +++ b/programs/marginfi/src/state/price.rs @@ -16,7 +16,7 @@ use crate::{ check, constants::{ CONF_INTERVAL_MULTIPLE, EXP_10, EXP_10_I80F48, MAX_CONF_INTERVAL, - MIN_PYTH_PUSH_VERIFICATION_LEVEL, PYTH_ID, STD_DEV_MULTIPLE, + MIN_PYTH_PUSH_VERIFICATION_LEVEL, PYTH_ID, STD_DEV_MULTIPLE, SWITCHBOARD_PULL_ID, }, debug, math_error, prelude::*, @@ -320,7 +320,7 @@ impl SwitchboardPullPriceFeed { let ai_data = ai.data.borrow(); check!( - ai.owner.eq(&switchboard_on_demand::SWITCHBOARD_PROGRAM_ID), + ai.owner.eq(&SWITCHBOARD_PULL_ID), MarginfiError::InvalidOracleAccount ); @@ -342,7 +342,7 @@ impl SwitchboardPullPriceFeed { let ai_data = ai.data.borrow(); check!( - ai.owner.eq(&switchboard_on_demand::SWITCHBOARD_PROGRAM_ID), + ai.owner.eq(&SWITCHBOARD_PULL_ID), MarginfiError::InvalidOracleAccount ); @@ -1210,7 +1210,7 @@ mod tests { Account { lamports: 1_000_000, data, - owner: switchboard_on_demand::SWITCHBOARD_PROGRAM_ID, + owner: SWITCHBOARD_PULL_ID, executable: false, rent_epoch: 361, } diff --git a/test-utils/src/utils.rs b/test-utils/src/utils.rs index c95446b9..55fe248f 100644 --- a/test-utils/src/utils.rs +++ b/test-utils/src/utils.rs @@ -2,6 +2,7 @@ use anchor_lang::prelude::*; use anchor_lang_29::Discriminator; use anchor_spl::token_2022::spl_token_2022::extension::transfer_fee::MAX_FEE_BASIS_POINTS; use marginfi::constants::PYTH_ID; +use marginfi::constants::SWITCHBOARD_PULL_ID; use pyth_sdk_solana::state::{ AccountType, PriceInfo, PriceStatus, Rational, SolanaPriceAccount, MAGIC, VERSION_2, }; @@ -152,7 +153,7 @@ pub fn create_switch_pull_oracle_account_from_bytes(data: Vec) -> Account { Account { lamports: 1_000_000, data, - owner: switchboard_on_demand::SWITCHBOARD_PROGRAM_ID, + owner: SWITCHBOARD_PULL_ID, executable: false, rent_epoch: 361, }