Compare commits

...

2 Commits

Author SHA1 Message Date
Godmode Galactus 72c4f79911
removing correctly the transactions from the map while confirming 2023-06-20 15:19:18 +02:00
Godmode Galactus 92a0db9cc3
removing unused dependecies and using lite-rpc tag instead of branch 2023-06-20 15:14:46 +02:00
3 changed files with 10 additions and 125 deletions

117
Cargo.lock generated
View File

@ -1397,12 +1397,6 @@ dependencies = [
"cfg-if 1.0.0",
]
[[package]]
name = "crossbeam"
version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd66663db5a988098a89599d4857919b3acf7f61402e61365acfd3919857b9be"
[[package]]
name = "crossbeam-channel"
version = "0.5.8"
@ -3015,12 +3009,6 @@ dependencies = [
"vcpkg",
]
[[package]]
name = "linked-hash-map"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
[[package]]
name = "linux-raw-sys"
version = "0.3.8"
@ -3201,14 +3189,12 @@ dependencies = [
"mango",
"mango-common",
"mango-feeds-connector",
"multiqueue",
"rand 0.8.5",
"rayon",
"regex",
"serde",
"serde_derive",
"serde_json",
"serde_yaml 0.8.26",
"solana-account-decoder",
"solana-clap-utils",
"solana-cli-config",
@ -3430,19 +3416,6 @@ version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a"
[[package]]
name = "multiqueue"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4059673f3516669cbf7ebb448cb37171559ed22e6d8bc79cf0cf9394cf9e73fd"
dependencies = [
"crossbeam",
"futures 0.1.31",
"parking_lot 0.3.8",
"smallvec 0.3.4",
"time 0.1.45",
]
[[package]]
name = "native-tls"
version = "0.2.11"
@ -3766,29 +3739,12 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "owning_ref"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d52571ddcb42e9c900c901a18d8d67e393df723fcd51dd59c5b1a85d0acb6cc"
[[package]]
name = "parking"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e"
[[package]]
name = "parking_lot"
version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa12d706797d42551663426a45e2db2e0364bd1dbf6aeada87e89c5f981f43e9"
dependencies = [
"owning_ref",
"parking_lot_core 0.2.14",
"thread-id",
]
[[package]]
name = "parking_lot"
version = "0.9.0"
@ -3821,18 +3777,6 @@ dependencies = [
"parking_lot_core 0.9.8",
]
[[package]]
name = "parking_lot_core"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa"
dependencies = [
"libc",
"rand 0.4.6",
"smallvec 0.6.14",
"winapi 0.3.9",
]
[[package]]
name = "parking_lot_core"
version = "0.6.3"
@ -4333,19 +4277,6 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
[[package]]
name = "rand"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293"
dependencies = [
"fuchsia-cprng",
"libc",
"rand_core 0.3.1",
"rdrand",
"winapi 0.3.9",
]
[[package]]
name = "rand"
version = "0.6.5"
@ -5097,18 +5028,6 @@ dependencies = [
"syn 2.0.18",
]
[[package]]
name = "serde_yaml"
version = "0.8.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b"
dependencies = [
"indexmap",
"ryu",
"serde",
"yaml-rust",
]
[[package]]
name = "serde_yaml"
version = "0.9.21"
@ -5299,12 +5218,6 @@ dependencies = [
"autocfg 1.1.0",
]
[[package]]
name = "smallvec"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e143aeee11cc8ece23c8336394de5138e598b84f5720fb8e895e2c6096322d88"
[[package]]
name = "smallvec"
version = "0.6.14"
@ -5489,7 +5402,7 @@ dependencies = [
"lazy_static",
"serde",
"serde_derive",
"serde_yaml 0.9.21",
"serde_yaml",
"solana-clap-utils",
"solana-sdk",
"url 2.4.0",
@ -5776,8 +5689,8 @@ dependencies = [
[[package]]
name = "solana-lite-rpc-core"
version = "0.2.0"
source = "git+https://github.com/blockworks-foundation/lite-rpc.git?branch=mango_simulation_test#ddd9f95a4d23972a4a49ea4db0086030bb7d6a72"
version = "0.2.1"
source = "git+https://github.com/blockworks-foundation/lite-rpc.git?tag=v0.2.1#c1eed987f29417f8a3b8d147f43a112388f02e4f"
dependencies = [
"anyhow",
"async-trait",
@ -5808,8 +5721,8 @@ dependencies = [
[[package]]
name = "solana-lite-rpc-services"
version = "0.2.0"
source = "git+https://github.com/blockworks-foundation/lite-rpc.git?branch=mango_simulation_test#ddd9f95a4d23972a4a49ea4db0086030bb7d6a72"
version = "0.2.1"
source = "git+https://github.com/blockworks-foundation/lite-rpc.git?tag=v0.2.1#c1eed987f29417f8a3b8d147f43a112388f02e4f"
dependencies = [
"anyhow",
"async-channel",
@ -7009,17 +6922,6 @@ dependencies = [
"syn 2.0.18",
]
[[package]]
name = "thread-id"
version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1"
dependencies = [
"libc",
"redox_syscall 0.1.57",
"winapi 0.3.9",
]
[[package]]
name = "time"
version = "0.1.45"
@ -8205,15 +8107,6 @@ dependencies = [
"libc",
]
[[package]]
name = "yaml-rust"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
dependencies = [
"linked-hash-map",
]
[[package]]
name = "yasna"
version = "0.5.2"

View File

@ -25,13 +25,11 @@ fixed-macro = "^1.1.1"
futures = "0.3.28"
iter_tools = "0.1.4"
log = "0.4.14"
multiqueue = "^0.3.2"
rand = ">=0.8.5"
rayon = "1.5.1"
serde = "1.0.136"
serde_derive = "1.0.103"
serde_json = "1.0.79"
serde_yaml = "0.8.23"
thiserror = "1.0"
tokio = { version = "1.14.1", features = ["full"] }
regex = "1.7.3"
@ -49,8 +47,8 @@ solana-logger = "1.15.2"
solana-transaction-status = "1.15.2"
solana-account-decoder = "1.15.2"
solana-lite-rpc-core = { git = "https://github.com/blockworks-foundation/lite-rpc.git", branch = "mango_simulation_test" }
solana-lite-rpc-services = { git = "https://github.com/blockworks-foundation/lite-rpc.git", branch = "mango_simulation_test" }
solana-lite-rpc-core = { git = "https://github.com/blockworks-foundation/lite-rpc.git", tag = "v0.2.1" }
solana-lite-rpc-services = { git = "https://github.com/blockworks-foundation/lite-rpc.git", tag = "v0.2.1" }
# pin program to mango-v3 version of solana sdk

View File

@ -171,8 +171,6 @@ pub fn confirmation_by_lite_rpc_notification_stream(
let mut tx_record_rx = tx_record_rx;
let mut notification_stream = notification_stream;
#[allow(unused_assignments)]
let mut remove_tx = None;
while !transaction_map.is_empty() || !exit_signal.load(Ordering::Relaxed) {
tokio::select! {
transaction_record = tx_record_rx.recv() => {
@ -184,7 +182,6 @@ pub fn confirmation_by_lite_rpc_notification_stream(
},
notification = notification_stream.recv() => {
if let Some(notification) = notification {
remove_tx = None;
match notification {
NotificationMsg::BlockNotificationMsg(block_notification) => {
@ -209,9 +206,8 @@ pub fn confirmation_by_lite_rpc_notification_stream(
},
_ => None
};
remove_tx = Some(tx_notification.signature.clone());
let _ = tx_confirm_records.send(TransactionConfirmRecord {
signature: tx_notification.signature,
signature: tx_notification.signature.clone(),
confirmed_slot: Some(tx_notification.slot),
confirmed_at: Some(Utc::now().to_string()),
sent_at: tx_sent_record.sent_at.to_string(),
@ -228,16 +224,14 @@ pub fn confirmation_by_lite_rpc_notification_stream(
priority_fees: tx_sent_record.priority_fees,
});
}
transaction_map.remove(&tx_notification.signature);
}
},
_ => {
// others do nothing
}
}
if let Some(signature) = &remove_tx {
transaction_map.remove(signature);
}
}
},
_ = tokio::time::sleep(Duration::from_secs(1)) => {