add MAX_RECENT_BLOCKHASSHES and some logs (#49)
This commit is contained in:
parent
1e60c090ea
commit
c92ce5074d
|
@ -2,6 +2,7 @@ use std::sync::Arc;
|
|||
|
||||
use dashmap::DashMap;
|
||||
|
||||
use log::info;
|
||||
use solana_rpc_client::nonblocking::rpc_client::RpcClient;
|
||||
use solana_sdk::commitment_config::CommitmentConfig;
|
||||
use tokio::sync::RwLock;
|
||||
|
@ -92,6 +93,7 @@ impl BlockStore {
|
|||
block_info: BlockInformation,
|
||||
commitment_config: CommitmentConfig,
|
||||
) {
|
||||
info!("ab {blockhash} {block_info:?}");
|
||||
// Write to block store first in order to prevent
|
||||
// any race condition i.e prevent some one to
|
||||
// ask the map what it doesn't have rn
|
||||
|
|
|
@ -34,6 +34,7 @@ use tokio::{
|
|||
sync::mpsc::{self, UnboundedSender},
|
||||
task::JoinHandle,
|
||||
};
|
||||
use solana_sdk::clock::MAX_RECENT_BLOCKHASHES;
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
static ref RPC_SEND_TX: Counter =
|
||||
|
@ -247,6 +248,8 @@ impl LiteRpcServer for LiteBridge {
|
|||
.get_latest_block_info(commitment_config)
|
||||
.await;
|
||||
|
||||
info!("glb {blockhash} {slot} {block_height}");
|
||||
|
||||
Ok(RpcResponse {
|
||||
context: RpcResponseContext {
|
||||
slot,
|
||||
|
@ -254,7 +257,7 @@ impl LiteRpcServer for LiteBridge {
|
|||
},
|
||||
value: RpcBlockhash {
|
||||
blockhash,
|
||||
last_valid_block_height: block_height,
|
||||
last_valid_block_height: block_height + (MAX_RECENT_BLOCKHASHES as u64),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue