Upgrade to solana ~1.14.9
- Update anchor submodule - Fork and submodule switchboard-v2 package to update dep
This commit is contained in:
parent
c77c3585ad
commit
0ed7175341
|
@ -21,7 +21,7 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
SOLANA_VERSION: '1.13.3'
|
SOLANA_VERSION: '1.14.9'
|
||||||
RUST_TOOLCHAIN: '1.60.0'
|
RUST_TOOLCHAIN: '1.60.0'
|
||||||
LOG_PROGRAM: 'm43thNJ58XCjL798ZSq6JGAG1BnWskhdq5or6kcnfsD'
|
LOG_PROGRAM: 'm43thNJ58XCjL798ZSq6JGAG1BnWskhdq5or6kcnfsD'
|
||||||
|
|
||||||
|
|
|
@ -2,3 +2,6 @@
|
||||||
path = anchor
|
path = anchor
|
||||||
url = https://github.com/blockworks-foundation/anchor.git
|
url = https://github.com/blockworks-foundation/anchor.git
|
||||||
branch = v0.25.0-mangov4
|
branch = v0.25.0-mangov4
|
||||||
|
[submodule "switchboard-v2"]
|
||||||
|
path = switchboard-v2
|
||||||
|
url = https://github.com/blockworks-foundation/sbv2-solana.git
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -12,7 +12,8 @@ members = [
|
||||||
[patch.crates-io]
|
[patch.crates-io]
|
||||||
# for gzip encoded responses
|
# for gzip encoded responses
|
||||||
jsonrpc-core-client = { git = "https://github.com/ckamm/jsonrpc.git", branch = "ckamm/http-with-gzip" }
|
jsonrpc-core-client = { git = "https://github.com/ckamm/jsonrpc.git", branch = "ckamm/http-with-gzip" }
|
||||||
# these patch anchor to use solana 1.10.35 in order to fix dependency conflicts in switchboard-v2
|
# these patch anchor to use solana 1.14.9 in order to fix dependency conflicts in switchboard-v2
|
||||||
# downstream applications may need to copy these patches to their own workspace
|
# downstream applications may need to copy these patches to their own workspace
|
||||||
anchor-spl = { path = "./anchor/spl/" }
|
anchor-spl = { path = "./anchor/spl/" }
|
||||||
anchor-lang = { path = "./anchor/lang/" }
|
anchor-lang = { path = "./anchor/lang/" }
|
||||||
|
switchboard-v2 = { path = "./switchboard-v2/rust/switchboard-v2/" }
|
||||||
|
|
2
anchor
2
anchor
|
@ -1 +1 @@
|
||||||
Subproject commit 3f8373770c51e105730b0bfd65208d3ba704c9ec
|
Subproject commit 309c2c2f4cce7c0a13d307fab3c7e2985bff3fa5
|
|
@ -21,6 +21,6 @@ log = "0.4.0"
|
||||||
mango-v4 = { path = "../programs/mango-v4", features = ["no-entrypoint", "client"] }
|
mango-v4 = { path = "../programs/mango-v4", features = ["no-entrypoint", "client"] }
|
||||||
pyth-sdk-solana = "0.1.0"
|
pyth-sdk-solana = "0.1.0"
|
||||||
serum_dex = { version = "0.5.6", git = "https://github.com/blockworks-foundation/serum-dex.git", default-features=false,features = ["no-entrypoint", "program"], branch = "ckamm/find_by_key" }
|
serum_dex = { version = "0.5.6", git = "https://github.com/blockworks-foundation/serum-dex.git", default-features=false,features = ["no-entrypoint", "program"], branch = "ckamm/find_by_key" }
|
||||||
solana-client = "~1.10.35"
|
solana-client = "~1.14.9"
|
||||||
solana-sdk = "~1.10.35"
|
solana-sdk = "~1.14.9"
|
||||||
tokio = { version = "1.14.1", features = ["rt-multi-thread", "time", "macros", "sync"] }
|
tokio = { version = "1.14.1", features = ["rt-multi-thread", "time", "macros", "sync"] }
|
||||||
|
|
|
@ -18,9 +18,9 @@ mango-v4 = { path = "../programs/mango-v4", features = ["no-entrypoint", "client
|
||||||
pyth-sdk-solana = "0.1.0"
|
pyth-sdk-solana = "0.1.0"
|
||||||
serum_dex = { version = "0.5.6", git = "https://github.com/blockworks-foundation/serum-dex.git", default-features=false,features = ["no-entrypoint", "program"], branch = "ckamm/find_by_key" }
|
serum_dex = { version = "0.5.6", git = "https://github.com/blockworks-foundation/serum-dex.git", default-features=false,features = ["no-entrypoint", "program"], branch = "ckamm/find_by_key" }
|
||||||
shellexpand = "2.1.0"
|
shellexpand = "2.1.0"
|
||||||
solana-account-decoder = "~1.10.35"
|
solana-account-decoder = "~1.14.9"
|
||||||
solana-client = "~1.10.35"
|
solana-client = "~1.14.9"
|
||||||
solana-sdk = "~1.10.35"
|
solana-sdk = "~1.14.9"
|
||||||
spl-associated-token-account = "1.0.3"
|
spl-associated-token-account = "1.0.3"
|
||||||
thiserror = "1.0.31"
|
thiserror = "1.0.31"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
|
|
@ -65,15 +65,12 @@ impl AccountFetcher for RpcAccountFetcher {
|
||||||
) -> anyhow::Result<Vec<(Pubkey, AccountSharedData)>> {
|
) -> anyhow::Result<Vec<(Pubkey, AccountSharedData)>> {
|
||||||
use solana_account_decoder::UiAccountEncoding;
|
use solana_account_decoder::UiAccountEncoding;
|
||||||
use solana_client::rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig};
|
use solana_client::rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig};
|
||||||
use solana_client::rpc_filter::{
|
use solana_client::rpc_filter::{Memcmp, RpcFilterType};
|
||||||
Memcmp, MemcmpEncodedBytes, MemcmpEncoding, RpcFilterType,
|
|
||||||
};
|
|
||||||
let config = RpcProgramAccountsConfig {
|
let config = RpcProgramAccountsConfig {
|
||||||
filters: Some(vec![RpcFilterType::Memcmp(Memcmp {
|
filters: Some(vec![RpcFilterType::Memcmp(Memcmp::new_raw_bytes(
|
||||||
offset: 0,
|
0,
|
||||||
bytes: MemcmpEncodedBytes::Bytes(discriminator.to_vec()),
|
discriminator.to_vec(),
|
||||||
encoding: Some(MemcmpEncoding::Binary),
|
))]),
|
||||||
})]),
|
|
||||||
account_config: RpcAccountInfoConfig {
|
account_config: RpcAccountInfoConfig {
|
||||||
encoding: Some(UiAccountEncoding::Base64),
|
encoding: Some(UiAccountEncoding::Base64),
|
||||||
commitment: Some(self.rpc.commitment()),
|
commitment: Some(self.rpc.commitment()),
|
||||||
|
|
|
@ -5,7 +5,7 @@ use mango_v4::state::{Bank, MangoAccount, MangoAccountValue, MintInfo, PerpMarke
|
||||||
|
|
||||||
use solana_account_decoder::UiAccountEncoding;
|
use solana_account_decoder::UiAccountEncoding;
|
||||||
use solana_client::rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig};
|
use solana_client::rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig};
|
||||||
use solana_client::rpc_filter::{Memcmp, MemcmpEncodedBytes, RpcFilterType};
|
use solana_client::rpc_filter::{Memcmp, RpcFilterType};
|
||||||
use solana_sdk::pubkey::Pubkey;
|
use solana_sdk::pubkey::Pubkey;
|
||||||
|
|
||||||
pub fn fetch_mango_accounts(
|
pub fn fetch_mango_accounts(
|
||||||
|
@ -15,21 +15,12 @@ pub fn fetch_mango_accounts(
|
||||||
) -> Result<Vec<(Pubkey, MangoAccountValue)>, ClientError> {
|
) -> Result<Vec<(Pubkey, MangoAccountValue)>, ClientError> {
|
||||||
let config = RpcProgramAccountsConfig {
|
let config = RpcProgramAccountsConfig {
|
||||||
filters: Some(vec![
|
filters: Some(vec![
|
||||||
RpcFilterType::Memcmp(Memcmp {
|
RpcFilterType::Memcmp(Memcmp::new_base58_encoded(
|
||||||
offset: 0,
|
0,
|
||||||
bytes: MemcmpEncodedBytes::Bytes(MangoAccount::discriminator().to_vec()),
|
&MangoAccount::discriminator(),
|
||||||
encoding: None,
|
)),
|
||||||
}),
|
RpcFilterType::Memcmp(Memcmp::new_base58_encoded(8, &group.to_bytes())),
|
||||||
RpcFilterType::Memcmp(Memcmp {
|
RpcFilterType::Memcmp(Memcmp::new_base58_encoded(40, &owner.to_bytes())),
|
||||||
offset: 8,
|
|
||||||
bytes: MemcmpEncodedBytes::Base58(group.to_string()),
|
|
||||||
encoding: None,
|
|
||||||
}),
|
|
||||||
RpcFilterType::Memcmp(Memcmp {
|
|
||||||
offset: 40,
|
|
||||||
bytes: MemcmpEncodedBytes::Base58(owner.to_string()),
|
|
||||||
encoding: None,
|
|
||||||
}),
|
|
||||||
]),
|
]),
|
||||||
account_config: RpcAccountInfoConfig {
|
account_config: RpcAccountInfoConfig {
|
||||||
encoding: Some(UiAccountEncoding::Base64),
|
encoding: Some(UiAccountEncoding::Base64),
|
||||||
|
@ -46,42 +37,38 @@ pub fn fetch_mango_accounts(
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fetch_banks(program: &Program, group: Pubkey) -> Result<Vec<(Pubkey, Bank)>, ClientError> {
|
pub fn fetch_banks(program: &Program, group: Pubkey) -> Result<Vec<(Pubkey, Bank)>, ClientError> {
|
||||||
program.accounts::<Bank>(vec![RpcFilterType::Memcmp(Memcmp {
|
program.accounts::<Bank>(vec![RpcFilterType::Memcmp(Memcmp::new_base58_encoded(
|
||||||
offset: 8,
|
8,
|
||||||
bytes: MemcmpEncodedBytes::Base58(group.to_string()),
|
&group.to_bytes(),
|
||||||
encoding: None,
|
))])
|
||||||
})])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fetch_mint_infos(
|
pub fn fetch_mint_infos(
|
||||||
program: &Program,
|
program: &Program,
|
||||||
group: Pubkey,
|
group: Pubkey,
|
||||||
) -> Result<Vec<(Pubkey, MintInfo)>, ClientError> {
|
) -> Result<Vec<(Pubkey, MintInfo)>, ClientError> {
|
||||||
program.accounts::<MintInfo>(vec![RpcFilterType::Memcmp(Memcmp {
|
program.accounts::<MintInfo>(vec![RpcFilterType::Memcmp(Memcmp::new_base58_encoded(
|
||||||
offset: 8,
|
8,
|
||||||
bytes: MemcmpEncodedBytes::Base58(group.to_string()),
|
&group.to_bytes(),
|
||||||
encoding: None,
|
))])
|
||||||
})])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fetch_serum3_markets(
|
pub fn fetch_serum3_markets(
|
||||||
program: &Program,
|
program: &Program,
|
||||||
group: Pubkey,
|
group: Pubkey,
|
||||||
) -> Result<Vec<(Pubkey, Serum3Market)>, ClientError> {
|
) -> Result<Vec<(Pubkey, Serum3Market)>, ClientError> {
|
||||||
program.accounts::<Serum3Market>(vec![RpcFilterType::Memcmp(Memcmp {
|
program.accounts::<Serum3Market>(vec![RpcFilterType::Memcmp(Memcmp::new_base58_encoded(
|
||||||
offset: 8,
|
8,
|
||||||
bytes: MemcmpEncodedBytes::Base58(group.to_string()),
|
&group.to_bytes(),
|
||||||
encoding: None,
|
))])
|
||||||
})])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fetch_perp_markets(
|
pub fn fetch_perp_markets(
|
||||||
program: &Program,
|
program: &Program,
|
||||||
group: Pubkey,
|
group: Pubkey,
|
||||||
) -> Result<Vec<(Pubkey, PerpMarket)>, ClientError> {
|
) -> Result<Vec<(Pubkey, PerpMarket)>, ClientError> {
|
||||||
program.accounts::<PerpMarket>(vec![RpcFilterType::Memcmp(Memcmp {
|
program.accounts::<PerpMarket>(vec![RpcFilterType::Memcmp(Memcmp::new_base58_encoded(
|
||||||
offset: 8,
|
8,
|
||||||
bytes: MemcmpEncodedBytes::Base58(group.to_string()),
|
&group.to_bytes(),
|
||||||
encoding: None,
|
))])
|
||||||
})])
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,6 @@ log = "0.4.0"
|
||||||
mango-v4 = { path = "../programs/mango-v4", features = ["no-entrypoint", "client"] }
|
mango-v4 = { path = "../programs/mango-v4", features = ["no-entrypoint", "client"] }
|
||||||
pyth-sdk-solana = "0.1.0"
|
pyth-sdk-solana = "0.1.0"
|
||||||
serum_dex = { version = "0.5.6", git = "https://github.com/blockworks-foundation/serum-dex.git", default-features=false,features = ["no-entrypoint", "program"], branch = "ckamm/find_by_key" }
|
serum_dex = { version = "0.5.6", git = "https://github.com/blockworks-foundation/serum-dex.git", default-features=false,features = ["no-entrypoint", "program"], branch = "ckamm/find_by_key" }
|
||||||
solana-client = "~1.10.35"
|
solana-client = "~1.14.9"
|
||||||
solana-sdk = "~1.10.35"
|
solana-sdk = "~1.14.9"
|
||||||
tokio = { version = "1.14.1", features = ["rt-multi-thread", "time", "macros", "sync"] }
|
tokio = { version = "1.14.1", features = ["rt-multi-thread", "time", "macros", "sync"] }
|
||||||
|
|
|
@ -36,11 +36,11 @@ serde_derive = "1.0.130"
|
||||||
serde_json = "1.0.68"
|
serde_json = "1.0.68"
|
||||||
serum_dex = { version = "0.5.6", git = "https://github.com/blockworks-foundation/serum-dex.git", default-features=false,features = ["no-entrypoint", "program"], branch = "ckamm/find_by_key" }
|
serum_dex = { version = "0.5.6", git = "https://github.com/blockworks-foundation/serum-dex.git", default-features=false,features = ["no-entrypoint", "program"], branch = "ckamm/find_by_key" }
|
||||||
shellexpand = "2.1.0"
|
shellexpand = "2.1.0"
|
||||||
solana-account-decoder = "~1.10.35"
|
solana-account-decoder = "~1.14.9"
|
||||||
solana-client = "~1.10.35"
|
solana-client = "~1.14.9"
|
||||||
solana-logger = "~1.10.35"
|
solana-logger = "~1.14.9"
|
||||||
solana-rpc = "~1.10.35"
|
solana-rpc = "~1.14.9"
|
||||||
solana-sdk = "~1.10.35"
|
solana-sdk = "~1.14.9"
|
||||||
tokio = { version = "1", features = ["full"] }
|
tokio = { version = "1", features = ["full"] }
|
||||||
tokio-stream = { version = "0.1.9"}
|
tokio-stream = { version = "0.1.9"}
|
||||||
tokio-tungstenite = "0.16.1"
|
tokio-tungstenite = "0.16.1"
|
||||||
|
|
|
@ -3,12 +3,9 @@ use jsonrpc_core_client::transports::http;
|
||||||
use solana_account_decoder::{UiAccount, UiAccountEncoding};
|
use solana_account_decoder::{UiAccount, UiAccountEncoding};
|
||||||
use solana_client::{
|
use solana_client::{
|
||||||
rpc_config::{RpcAccountInfoConfig, RpcContextConfig, RpcProgramAccountsConfig},
|
rpc_config::{RpcAccountInfoConfig, RpcContextConfig, RpcProgramAccountsConfig},
|
||||||
rpc_response::{Response, RpcKeyedAccount},
|
rpc_response::{OptionalContext, Response, RpcKeyedAccount},
|
||||||
};
|
|
||||||
use solana_rpc::{
|
|
||||||
rpc::OptionalContext,
|
|
||||||
rpc::{rpc_accounts::AccountsDataClient, rpc_minimal::MinimalClient},
|
|
||||||
};
|
};
|
||||||
|
use solana_rpc::rpc::{rpc_accounts::AccountsDataClient, rpc_minimal::MinimalClient};
|
||||||
use solana_sdk::{account::AccountSharedData, commitment_config::CommitmentConfig, pubkey::Pubkey};
|
use solana_sdk::{account::AccountSharedData, commitment_config::CommitmentConfig, pubkey::Pubkey};
|
||||||
|
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
|
|
|
@ -4,7 +4,7 @@ use jsonrpc_core_client::transports::ws;
|
||||||
use solana_account_decoder::UiAccountEncoding;
|
use solana_account_decoder::UiAccountEncoding;
|
||||||
use solana_client::{
|
use solana_client::{
|
||||||
rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig},
|
rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig},
|
||||||
rpc_filter::{Memcmp, MemcmpEncodedBytes, RpcFilterType},
|
rpc_filter::{Memcmp, RpcFilterType},
|
||||||
rpc_response::{Response, RpcKeyedAccount, RpcResponseContext},
|
rpc_response::{Response, RpcKeyedAccount, RpcResponseContext},
|
||||||
};
|
};
|
||||||
use solana_rpc::rpc_pubsub::RpcSolPubSubClient;
|
use solana_rpc::rpc_pubsub::RpcSolPubSubClient;
|
||||||
|
@ -78,17 +78,16 @@ async fn feed_data(
|
||||||
// filter for only OpenOrders with v4 authority
|
// filter for only OpenOrders with v4 authority
|
||||||
filters: Some(vec![
|
filters: Some(vec![
|
||||||
RpcFilterType::DataSize(3228), // open orders size
|
RpcFilterType::DataSize(3228), // open orders size
|
||||||
RpcFilterType::Memcmp(Memcmp {
|
// "serum" + u64 that is Initialized (1) + OpenOrders (4)
|
||||||
offset: 0,
|
RpcFilterType::Memcmp(Memcmp::new_raw_bytes(
|
||||||
// "serum" + u64 that is Initialized (1) + OpenOrders (4)
|
// new_base58_encoded() does not work with old RPC nodes
|
||||||
bytes: MemcmpEncodedBytes::Base58("AcUQf4PGf6fCHGwmpB".into()),
|
0,
|
||||||
encoding: None,
|
[0x73, 0x65, 0x72, 0x75, 0x6d, 5, 0, 0, 0, 0, 0, 0, 0].to_vec(),
|
||||||
}),
|
)),
|
||||||
RpcFilterType::Memcmp(Memcmp {
|
RpcFilterType::Memcmp(Memcmp::new_raw_bytes(
|
||||||
offset: 45, // owner is the 4th field, after "serum" (header), account_flags: u64 and market: Pubkey
|
45,
|
||||||
bytes: MemcmpEncodedBytes::Bytes(config.open_orders_authority.to_bytes().into()),
|
config.open_orders_authority.to_bytes().to_vec(),
|
||||||
encoding: None,
|
)),
|
||||||
}),
|
|
||||||
]),
|
]),
|
||||||
with_context: Some(true),
|
with_context: Some(true),
|
||||||
account_config: account_info_config.clone(),
|
account_config: account_info_config.clone(),
|
||||||
|
|
|
@ -35,18 +35,17 @@ num_enum = "0.5.1"
|
||||||
pyth-sdk-solana = "0.1.0"
|
pyth-sdk-solana = "0.1.0"
|
||||||
serde = "^1.0"
|
serde = "^1.0"
|
||||||
serum_dex = { version = "0.5.6", git = "https://github.com/blockworks-foundation/serum-dex.git", default-features=false,features = ["no-entrypoint", "program"], branch = "ckamm/find_by_key" }
|
serum_dex = { version = "0.5.6", git = "https://github.com/blockworks-foundation/serum-dex.git", default-features=false,features = ["no-entrypoint", "program"], branch = "ckamm/find_by_key" }
|
||||||
solana-address-lookup-table-program = "~1.10.35"
|
solana-address-lookup-table-program = "~1.14.9"
|
||||||
solana-program = "~1.10.35"
|
solana-program = "~1.14.9"
|
||||||
solana-sdk = { version = "~1.10.35", default-features = false, optional = true }
|
solana-sdk = { version = "~1.14.9", default-features = false, optional = true }
|
||||||
static_assertions = "1.1"
|
static_assertions = "1.1"
|
||||||
switchboard-program = ">=0.2.0"
|
switchboard-program = ">=0.2.0"
|
||||||
switchboard-utils = ">=0.1.36"
|
switchboard-v2 = "0.1.17"
|
||||||
switchboard-v2 = "0.1.12"
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
solana-sdk = { version = "~1.10.35", default-features = false }
|
solana-sdk = { version = "~1.14.9", default-features = false }
|
||||||
solana-program-test = "~1.10.35"
|
solana-program-test = "~1.14.9"
|
||||||
solana-logger = "~1.10.35"
|
solana-logger = "~1.14.9"
|
||||||
spl-token = { version = "^3.0.0", features = ["no-entrypoint"] }
|
spl-token = { version = "^3.0.0", features = ["no-entrypoint"] }
|
||||||
spl-associated-token-account = { version = "^1.0.3", features = ["no-entrypoint"] }
|
spl-associated-token-account = { version = "^1.0.3", features = ["no-entrypoint"] }
|
||||||
bincode = "^1.3.1"
|
bincode = "^1.3.1"
|
||||||
|
|
|
@ -20,4 +20,4 @@ test-bpf = []
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anchor-lang = { path = "../../anchor/lang" }
|
anchor-lang = { path = "../../anchor/lang" }
|
||||||
anchor-spl = { path = "../../anchor/spl" }
|
anchor-spl = { path = "../../anchor/spl" }
|
||||||
solana-program = "~1.10.35"
|
solana-program = "~1.14.9"
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 97ed7b12de198f9dca2637af0ce8f5823cc3a0e3
|
Loading…
Reference in New Issue