merging main with production (#290)

* remove block_debug_listen (#286)

* remove block_debug_listen

caused a panic - need more time to investigate

2024-01-17T20:31:42.913 app[683d392fd45368] ams [info] thread 'tokio-runtime-worker' panicked at cluster-endpoints/src/grpc_inspect.rs:59:21:
2024-01-17T20:31:42.913 app[683d392fd45368] ams [info] Error receiving block: Closed
2024-01-17T20:31:42.922 app[683d392fd45368] ams [info] 2024-01-17T20:31:42.912597Z ERROR lite_rpc: Services quit unexpectedly Err(cluster endpoint failure (Err(JoinError::Panic(Id(20), ...)), 1, [JoinHandle { id: Id(19) }, JoinHandle { id: Id(23) }])

* clippy

* Fixing message too long and overflow panics (#288)

* Update geyser grpc connector commit (#289)

---------

Co-authored-by: Groovie | Mango <95291500+grooviegermanikus@users.noreply.github.com>
This commit is contained in:
galactus 2024-01-18 16:05:07 +01:00 committed by GitHub
parent c828a35602
commit 392ffe3103
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 2 deletions

2
Cargo.lock generated
View File

@ -1767,7 +1767,7 @@ dependencies = [
[[package]]
name = "geyser-grpc-connector"
version = "0.7.1+yellowstone.1.11"
source = "git+https://github.com/blockworks-foundation/geyser-grpc-connector.git?tag=v1.17.15#a3e8e89af71632f31895a688e82c1ab091b11c2f"
source = "git+https://github.com/blockworks-foundation/geyser-grpc-connector.git?tag=v1.17.15#4d737e7c2e8a7bb85b1580da094370dafba3eb8e"
dependencies = [
"anyhow",
"async-stream",

View File

@ -63,7 +63,10 @@ impl TxStore {
let length_before = self.store.len();
self.store
.retain(|_k, v| v.last_valid_blockheight >= current_finalized_blockheight);
log::info!("Cleaned {} transactions", length_before - self.store.len());
log::info!(
"Cleaned {} transactions",
length_before.saturating_sub(self.store.len())
);
}
pub fn is_transaction_confirmed(&self, signature: &String) -> bool {

View File

@ -14,6 +14,7 @@ use anyhow::Context;
use jsonrpsee::{core::SubscriptionResult, server::ServerBuilder, PendingSubscriptionSink};
use prometheus::{opts, register_int_counter, IntCounter};
use solana_lite_rpc_core::{
encoding,
stores::{block_information_store::BlockInformation, data_cache::DataCache, tx_store::TxProps},
AnyhowJoinHandle,
};
@ -314,11 +315,27 @@ impl LiteRpcServer for LiteBridge {
) -> crate::rpc::Result<String> {
RPC_SEND_TX.inc();
// Copied these constants from solana labs code
const MAX_BASE58_SIZE: usize = 1683;
const MAX_BASE64_SIZE: usize = 1644;
let SendTransactionConfig {
encoding,
max_retries,
} = send_transaction_config.unwrap_or_default();
let expected_size = match encoding {
encoding::BinaryEncoding::Base58 => MAX_BASE58_SIZE,
encoding::BinaryEncoding::Base64 => MAX_BASE64_SIZE,
};
if tx.len() > expected_size {
return Err(jsonrpsee::core::Error::Custom(format!(
"Transaction too large, expected : {} transaction len {}",
expected_size,
tx.len()
)));
}
let raw_tx = match encoding.decode(tx) {
Ok(raw_tx) => raw_tx,
Err(err) => {