Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # required for commit & rebase in shared action
fetch-depth: 0
submodules: recursive

- name: Force fetch submodules
run: git submodule update --init --recursive

- name: Run shared Rust checks
uses: tcrypt25519/ci/.github/actions/check-rust@main
Expand Down
13 changes: 7 additions & 6 deletions crates/bulkmail/src/adapter/solana.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
//!
//! [`Sender<Sol>`]: crate::Sender

use crate::Error;
use crate::adapter::{
BlockReceiver, ChainAdapter, ChainClient, FeeManager, PendingTransaction, ReplayProtection,
RetryDecision, RetryStrategy, SendOutcome, TransactionStatus,
use crate::{
Error,
adapter::{
BlockReceiver, ChainAdapter, ChainClient, FeeManager, PendingTransaction, ReplayProtection,
RetryDecision, RetryStrategy, SendOutcome, TransactionStatus,
},
};
use async_trait::async_trait;
use solana_client::{nonblocking::rpc_client::RpcClient, pubsub_client::PubsubClient};
Expand All @@ -17,8 +19,7 @@ use solana_sdk::{
signature::Signature, transaction::VersionedTransaction,
};
use solana_transaction_status::TransactionConfirmationStatus;
use std::sync::Arc;
use std::time::Duration;
use std::{sync::Arc, time::Duration};
use tokio::sync::Mutex;

/// Solana fee parameters (placeholder).
Expand Down
28 changes: 19 additions & 9 deletions crates/mempooloracle/examples/cli_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use alloy::providers::{WebSocketConfig, WsConnect};
use crossterm::event::{self, Event, KeyCode, KeyEventKind, KeyModifiers};
use mempooloracle::{
Address, AlloyTrackerRuntime, AlloyTrackerTelemetry, AlloyTrackerTelemetrySnapshot,
BlockUpdate, ConsensusTransportConfig, ConsensusTransportImplementation, MempoolEvent,
MempoolHandle, MempoolTracker, P2pBlockTransport, P2pTransportConfig, PendingTx,
TrackerConfig, TrackerTransport, TxId, TrackerPrune, Slot, BlockNumber, ExecutionHash,
BlockNumber, BlockUpdate, ConsensusTransportConfig, ConsensusTransportImplementation,
ExecutionHash, MempoolEvent, MempoolHandle, MempoolTracker, P2pBlockTransport,
P2pTransportConfig, PendingTx, Slot, TrackerConfig, TrackerTransport,
};
use ratatui::{
DefaultTerminal, Frame,
Expand All @@ -13,7 +13,6 @@ use ratatui::{
text::{Line, Span},
widgets::{Bar, BarChart, BarGroup, Block, Borders, Gauge, List, ListItem, Paragraph, Wrap},
};
use alloy::primitives::B256;
use std::{
env, io,
path::PathBuf,
Expand Down Expand Up @@ -118,7 +117,7 @@ async fn main() -> io::Result<()> {

let handle = runtime.handle();

let result = run_plaintext(handle, args.duration_secs, stop.clone(), telemetry);
let result = run_plaintext(handle, args.duration_secs, stop.clone(), telemetry, false);

stop.store(true, Ordering::Relaxed);
runtime.shutdown();
Expand Down Expand Up @@ -271,11 +270,17 @@ fn run_plaintext(

if ttfpt && snapshot.pending_seen > 0 {
println!("\nSUCCESS: First pending transaction observed!");
println!("Time to first pending transaction: {:?}", started_at.elapsed());
println!(
"Time to first pending transaction: {:?}",
started_at.elapsed()
);
process::exit(0);
}

let unfinalized_depth = snapshot.last_block_number.0.saturating_sub(snapshot.consensus_finalized_number.0);
let unfinalized_depth = snapshot
.last_block_number
.0
.saturating_sub(snapshot.consensus_finalized_number.0);
println!(
"base_fee={} expected_txs={} depth={} blocks={} pending_seen={} finalized_block={} peers(el={}, cl={})",
snapshot.base_fee,
Expand Down Expand Up @@ -417,7 +422,10 @@ fn render_gauges(frame: &mut Frame, area: Rect, app: &App) {
.label(format!("{} tracked", snapshot.marketable_count));
frame.render_widget(marketable, chunks[2]);

let unfinalized_depth = snapshot.last_block_number.0.saturating_sub(snapshot.consensus_finalized_number.0);
let unfinalized_depth = snapshot
.last_block_number
.0
.saturating_sub(snapshot.consensus_finalized_number.0);
let depth_percent = (unfinalized_depth.min(128) as f64 / 128.0 * 100.0) as u16;
let depth_gauge = Gauge::default()
.block(
Expand Down Expand Up @@ -1223,7 +1231,9 @@ fn simulate_blockchain(
let block = BlockUpdate {
number: BlockNumber(block_number),
hash: mempooloracle::ExecutionHash::from([block_number as u8; 32]),
parent_hash: mempooloracle::ExecutionHash::from([block_number.saturating_sub(1) as u8; 32]),
parent_hash: mempooloracle::ExecutionHash::from(
[block_number.saturating_sub(1) as u8; 32],
),
included_txs,
new_base_fee: 10 + (block_number % 5) as u128,
gas_used: 21000 * block_tx_count,
Expand Down
Loading