update to solana 1.18.15, v1.13.0+solana.1.18.9

This commit is contained in:
GroovieGermanikus 2024-06-12 18:49:21 +02:00
parent 193a1b6878
commit bb6aa57f0f
No known key found for this signature in database
GPG Key ID: 5B6EB831A5CD2015
5 changed files with 620 additions and 355 deletions

888
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -9,11 +9,13 @@ authors = ["GroovieGermanikus <groovie@mango.markets>"]
repository = "https://github.com/blockworks-foundation/geyser-grpc-connector" repository = "https://github.com/blockworks-foundation/geyser-grpc-connector"
[dependencies] [dependencies]
yellowstone-grpc-client = "~1.14.0" # 1.14.0+solana.1.18.9
yellowstone-grpc-proto = "~1.13.0" yellowstone-grpc-client = { git = "https://github.com/rpcpool/yellowstone-grpc.git", tag = "v1.13.0+solana.1.18.9" }
# 1.13.0+solana.1.18.9
yellowstone-grpc-proto = { git = "https://github.com/rpcpool/yellowstone-grpc.git", tag = "v1.13.0+solana.1.18.9" }
# required for CommitmentConfig # required for CommitmentConfig
solana-sdk = "1" solana-sdk = "1.18.9"
url = "2.5.0" url = "2.5.0"
async-stream = "0.3.5" async-stream = "0.3.5"

View File

@ -7,9 +7,8 @@ use std::pin::pin;
use base64::Engine; use base64::Engine;
use itertools::Itertools; use itertools::Itertools;
use solana_sdk::borsh0_10::try_from_slice_unchecked;
/// This file mocks the core model of the RPC server. /// This file mocks the core model of the RPC server.
use solana_sdk::compute_budget; use solana_sdk::{compute_budget};
use solana_sdk::compute_budget::ComputeBudgetInstruction; use solana_sdk::compute_budget::ComputeBudgetInstruction;
use solana_sdk::hash::Hash; use solana_sdk::hash::Hash;
use solana_sdk::instruction::CompiledInstruction; use solana_sdk::instruction::CompiledInstruction;
@ -298,32 +297,6 @@ pub fn map_produced_block(
.collect(), .collect(),
}); });
let legacy_compute_budget: Option<(u32, Option<u64>)> =
message.instructions().iter().find_map(|i| {
if i.program_id(message.static_account_keys())
.eq(&compute_budget::id())
{
if let Ok(ComputeBudgetInstruction::RequestUnitsDeprecated {
units,
additional_fee,
}) = try_from_slice_unchecked(i.data.as_slice())
{
if additional_fee > 0 {
return Some((
units,
Some(((units * 1000) / additional_fee) as u64),
));
} else {
return Some((units, None));
}
}
}
None
});
let legacy_cu_requested = legacy_compute_budget.map(|x| x.0);
let legacy_prioritization_fees = legacy_compute_budget.map(|x| x.1).unwrap_or(None);
let cu_requested = message let cu_requested = message
.instructions() .instructions()
.iter() .iter()
@ -332,14 +305,13 @@ pub fn map_produced_block(
.eq(&compute_budget::id()) .eq(&compute_budget::id())
{ {
if let Ok(ComputeBudgetInstruction::SetComputeUnitLimit(limit)) = if let Ok(ComputeBudgetInstruction::SetComputeUnitLimit(limit)) =
try_from_slice_unchecked(i.data.as_slice()) solana_sdk::borsh1::try_from_slice_unchecked(i.data.as_slice())
{ {
return Some(limit); return Some(limit);
} }
} }
None None
}) });
.or(legacy_cu_requested);
let prioritization_fees = message let prioritization_fees = message
.instructions() .instructions()
@ -349,15 +321,14 @@ pub fn map_produced_block(
.eq(&compute_budget::id()) .eq(&compute_budget::id())
{ {
if let Ok(ComputeBudgetInstruction::SetComputeUnitPrice(price)) = if let Ok(ComputeBudgetInstruction::SetComputeUnitPrice(price)) =
try_from_slice_unchecked(i.data.as_slice()) solana_sdk::borsh1::try_from_slice_unchecked(i.data.as_slice())
{ {
return Some(price); return Some(price);
} }
} }
None None
}) });
.or(legacy_prioritization_fees);
Some(TransactionInfo { Some(TransactionInfo {
signature: signature.to_string(), signature: signature.to_string(),

View File

@ -7,7 +7,7 @@ use base64::Engine;
use itertools::Itertools; use itertools::Itertools;
use solana_sdk::borsh0_10::try_from_slice_unchecked; use solana_sdk::borsh0_10::try_from_slice_unchecked;
/// This file mocks the core model of the RPC server. /// This file mocks the core model of the RPC server.
use solana_sdk::compute_budget; use solana_sdk::{borsh0_10, borsh0_9, compute_budget};
use solana_sdk::compute_budget::ComputeBudgetInstruction; use solana_sdk::compute_budget::ComputeBudgetInstruction;
use solana_sdk::hash::Hash; use solana_sdk::hash::Hash;
use solana_sdk::instruction::CompiledInstruction; use solana_sdk::instruction::CompiledInstruction;
@ -266,32 +266,6 @@ pub fn map_produced_block(
.collect(), .collect(),
}); });
let legacy_compute_budget: Option<(u32, Option<u64>)> =
message.instructions().iter().find_map(|i| {
if i.program_id(message.static_account_keys())
.eq(&compute_budget::id())
{
if let Ok(ComputeBudgetInstruction::RequestUnitsDeprecated {
units,
additional_fee,
}) = try_from_slice_unchecked(i.data.as_slice())
{
if additional_fee > 0 {
return Some((
units,
Some(((units * 1000) / additional_fee) as u64),
));
} else {
return Some((units, None));
}
}
}
None
});
let legacy_cu_requested = legacy_compute_budget.map(|x| x.0);
let legacy_prioritization_fees = legacy_compute_budget.map(|x| x.1).unwrap_or(None);
let cu_requested = message let cu_requested = message
.instructions() .instructions()
.iter() .iter()
@ -300,14 +274,13 @@ pub fn map_produced_block(
.eq(&compute_budget::id()) .eq(&compute_budget::id())
{ {
if let Ok(ComputeBudgetInstruction::SetComputeUnitLimit(limit)) = if let Ok(ComputeBudgetInstruction::SetComputeUnitLimit(limit)) =
try_from_slice_unchecked(i.data.as_slice()) solana_sdk::borsh1::try_from_slice_unchecked(i.data.as_slice())
{ {
return Some(limit); return Some(limit);
} }
} }
None None
}) });
.or(legacy_cu_requested);
let prioritization_fees = message let prioritization_fees = message
.instructions() .instructions()
@ -317,15 +290,14 @@ pub fn map_produced_block(
.eq(&compute_budget::id()) .eq(&compute_budget::id())
{ {
if let Ok(ComputeBudgetInstruction::SetComputeUnitPrice(price)) = if let Ok(ComputeBudgetInstruction::SetComputeUnitPrice(price)) =
try_from_slice_unchecked(i.data.as_slice()) solana_sdk::borsh1::try_from_slice_unchecked(i.data.as_slice())
{ {
return Some(price); return Some(price);
} }
} }
None None
}) });
.or(legacy_prioritization_fees);
Some(TransactionInfo { Some(TransactionInfo {
signature: signature.to_string(), signature: signature.to_string(),

View File

@ -1,2 +1,2 @@
[toolchain] [toolchain]
channel = "1.73.0" channel = "1.75.0"