Skip to content
Merged
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
3 changes: 3 additions & 0 deletions crates/core/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ use {
},
async_trait::async_trait,
solana_pubkey::Pubkey,
solana_signature::Signature,
std::sync::Arc,
};

Expand All @@ -70,10 +71,12 @@ use {
///
/// - `slot`: The Solana slot number where the account was updated.
/// - `pubkey`: The public key of the account.
/// - `transaction_signature`: Signature of the transaction that caused the update.
#[derive(Debug, Clone)]
pub struct AccountMetadata {
pub slot: u64,
pub pubkey: Pubkey,
pub transaction_signature: Option<Signature>,
}

/// Represents the decoded data of a Solana account, including account-specific
Expand Down
4 changes: 4 additions & 0 deletions crates/core/src/datasource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,13 @@ pub enum UpdateType {
/// - `pubkey`: The public key of the account being updated.
/// - `account`: The new state of the account.
/// - `slot`: The slot number in which this account update was recorded.
/// - `transaction_signature`: Signature of the transaction that caused the update.
#[derive(Debug, Clone)]
pub struct AccountUpdate {
pub pubkey: Pubkey,
pub account: Account,
pub slot: u64,
pub transaction_signature: Option<Signature>,
}

/// Represents the details of a Solana block, including its slot, hashes, rewards, and timing information.
Expand Down Expand Up @@ -274,10 +276,12 @@ pub struct BlockDetails {
///
/// - `pubkey`: The public key of the deleted account.
/// - `slot`: The slot number in which the account was deleted.
/// - `transaction_signature`: Signature of the transaction that caused the update.
#[derive(Debug, Clone)]
pub struct AccountDeletion {
pub pubkey: Pubkey,
pub slot: u64,
pub transaction_signature: Option<Signature>,
}

/// Represents a transaction update in the Solana network, including transaction
Expand Down
1 change: 1 addition & 0 deletions crates/core/src/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ impl Pipeline {
let account_metadata = AccountMetadata {
slot: account_update.slot,
pubkey: account_update.pubkey,
transaction_signature: account_update.transaction_signature,
};

for pipe in self.account_pipes.iter_mut() {
Expand Down
2 changes: 2 additions & 0 deletions datasources/helius-atlas-ws-datasource/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ impl Datasource for HeliusWebsocket {
let account_deletion = AccountDeletion {
pubkey: account,
slot: acc_event.context.slot,
transaction_signature: None,
};

metrics.record_histogram("helius_atlas_ws_account_deletion_process_time_nanoseconds", start_time.elapsed().as_nanos() as f64).await.unwrap_or_else(|value| log::error!("Error recording metric: {}", value));
Expand All @@ -338,6 +339,7 @@ impl Datasource for HeliusWebsocket {
pubkey: account,
account: decoded_account,
slot: acc_event.context.slot,
transaction_signature: None,
});

metrics.record_histogram("helius_atlas_ws_account_process_time_nanoseconds", start_time.elapsed().as_nanos() as f64).await.unwrap_or_else(|value| log::error!("Error recording metric: {}", value));
Expand Down
1 change: 1 addition & 0 deletions datasources/rpc-program-subscribe-datasource/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ impl Datasource for RpcProgramSubscribe {
pubkey: account_pubkey,
account: decoded_account,
slot: acc_event.context.slot,
transaction_signature: None,
});

metrics
Expand Down
6 changes: 6 additions & 0 deletions datasources/yellowstone-grpc-datasource/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ async fn send_subscribe_account_update_info(
let account_deletion = AccountDeletion {
pubkey: account_pubkey,
slot,
transaction_signature: account_info
.txn_signature
.and_then(|sig| Signature::try_from(sig).ok()),
};
if let Err(e) = sender.try_send((Update::AccountDeletion(account_deletion), id)) {
log::error!(
Expand All @@ -271,6 +274,9 @@ async fn send_subscribe_account_update_info(
pubkey: account_pubkey,
account,
slot,
transaction_signature: account_info
.txn_signature
.and_then(|sig| Signature::try_from(sig).ok()),
});

if let Err(e) = sender.try_send((update, id)) {
Expand Down
1 change: 1 addition & 0 deletions examples/filtering/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ impl Datasource for GpaRpcDatasource {
pubkey,
account,
slot,
transaction_signature: None,
}),
id_for_loop.clone(),
)) {
Expand Down
1 change: 1 addition & 0 deletions examples/sharky-offers/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ impl Datasource for GpaBackfillDatasource {
pubkey,
account,
slot,
transaction_signature: None,
}),
id_for_loop.clone(),
)) {
Expand Down
Loading