Skip to content

Commit 15833ed

Browse files
authored
Merge pull request #12 from sonicfromnewyoke/sonic/rename-pubkey-to-address
refactor: replace `pubkey` with `address`
2 parents 62ad06d + 1bd6db0 commit 15833ed

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ protobuf-src = "1"
5353
serde = { version = "1", default-features = false }
5454
serde_cbor = "0"
5555
agave-geyser-plugin-interface = "3"
56+
solana-address = "1"
5657
solana-hash = "3"
5758
solana-logger = "3"
58-
solana-pubkey = "3"
5959
solana-signature = { version = "3", default-features = false }
6060
solana-accounts-db = "3"
6161
solana-entry = "3"

jetstreamer-firehose/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ solana-runtime.workspace = true
2525
solana-hash.workspace = true
2626
solana-geyser-plugin-manager.workspace = true
2727
solana-storage-proto.workspace = true
28-
solana-pubkey.workspace = true
28+
solana-address.workspace = true
2929
solana-transaction.workspace = true
3030
solana-transaction-status.workspace = true
3131
solana-ledger.workspace = true

jetstreamer-firehose/src/firehose.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ use crossbeam_channel::{Receiver, Sender, unbounded};
33
use futures_util::FutureExt;
44
use futures_util::future::BoxFuture;
55
use reqwest::{Client, Url};
6+
use solana_address::Address;
67
use solana_geyser_plugin_manager::{
78
block_metadata_notifier_interface::BlockMetadataNotifier,
89
geyser_plugin_service::GeyserPluginServiceError,
910
};
1011
use solana_hash::Hash;
1112
use solana_ledger::entry_notifier_interface::EntryNotifier;
12-
use solana_pubkey::Pubkey;
1313
use solana_reward_info::RewardInfo;
1414
use solana_rpc::{
1515
optimistically_confirmed_bank_tracker::SlotNotification,
@@ -374,7 +374,7 @@ pub struct RewardsData {
374374
/// Slot the rewards correspond to.
375375
pub slot: u64,
376376
/// Reward recipients and their associated reward information.
377-
pub rewards: Vec<(Pubkey, RewardInfo)>,
377+
pub rewards: Vec<(Address, RewardInfo)>,
378378
}
379379

380380
/// Block-level data streamed to block handlers.
@@ -748,7 +748,7 @@ where
748748
let mut entry_index: usize = 0;
749749
let mut this_block_executed_transaction_count: u64 = 0;
750750
let mut this_block_entry_count: u64 = 0;
751-
let mut this_block_rewards: Vec<(Pubkey, RewardInfo)> = Vec::new();
751+
let mut this_block_rewards: Vec<(Address, RewardInfo)> = Vec::new();
752752

753753
for node_with_cid in &nodes.0 {
754754
item_index += 1;
@@ -1643,7 +1643,7 @@ async fn firehose_geyser_thread(
16431643
let mut entry_index: usize = 0;
16441644
let mut this_block_executed_transaction_count: u64 = 0;
16451645
let mut this_block_entry_count: u64 = 0;
1646-
let mut this_block_rewards: Vec<(Pubkey, RewardInfo)> = Vec::new();
1646+
let mut this_block_rewards: Vec<(Address, RewardInfo)> = Vec::new();
16471647

16481648
nodes.each(|node_with_cid| -> Result<(), Box<dyn std::error::Error>> {
16491649
item_index += 1;
@@ -1904,7 +1904,7 @@ fn is_simple_vote_transaction(versioned_tx: &VersionedTransaction) -> bool {
19041904
#[inline(always)]
19051905
fn convert_proto_rewards(
19061906
proto_rewards: &solana_storage_proto::convert::generated::Rewards,
1907-
) -> Result<Vec<(Pubkey, RewardInfo)>, Box<dyn std::error::Error>> {
1907+
) -> Result<Vec<(Address, RewardInfo)>, Box<dyn std::error::Error>> {
19081908
let mut keyed_rewards = Vec::with_capacity(proto_rewards.rewards.len());
19091909
for proto_reward in proto_rewards.rewards.iter() {
19101910
let reward = RewardInfo {
@@ -1926,7 +1926,7 @@ fn convert_proto_rewards(
19261926
};
19271927
let pubkey = proto_reward
19281928
.pubkey
1929-
.parse::<Pubkey>()
1929+
.parse::<Address>()
19301930
.map_err(|err| Box::new(err) as Box<dyn std::error::Error>)?;
19311931
keyed_rewards.push((pubkey, reward));
19321932
}

jetstreamer-plugin/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jetstreamer-firehose.workspace = true
1414

1515
serde.workspace = true
1616
solana-message.workspace = true
17-
solana-pubkey.workspace = true
17+
solana-address.workspace = true
1818
tokio.workspace = true
1919
log.workspace = true
2020
clickhouse.workspace = true

jetstreamer-plugin/src/plugins/program_tracking.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use clickhouse::{Client, Row};
44
use futures_util::FutureExt;
55
use log::error;
66
use serde::{Deserialize, Serialize};
7+
use solana_address::Address;
78
use solana_message::VersionedMessage;
8-
use solana_pubkey::Pubkey;
99

1010
use crate::{Plugin, PluginFuture};
1111
use jetstreamer_firehose::firehose::{BlockData, TransactionData};
@@ -14,7 +14,7 @@ const DB_WRITE_INTERVAL_SLOTS: u64 = 1000;
1414

1515
#[derive(Default)]
1616
struct ThreadLocalData {
17-
slot_stats: HashMap<u64, HashMap<Pubkey, ProgramStats>>,
17+
slot_stats: HashMap<u64, HashMap<Address, ProgramStats>>,
1818
pending_rows: Vec<ProgramEvent>,
1919
slots_since_flush: u64,
2020
}
@@ -28,7 +28,7 @@ struct ProgramEvent {
2828
pub slot: u32,
2929
// Stored as ClickHouse DateTime('UTC') -> UInt32 seconds; we clamp Solana i64.
3030
pub timestamp: u32,
31-
pub program_id: Pubkey,
31+
pub program_id: Address,
3232
pub count: u32,
3333
pub error_count: u32,
3434
pub min_cus: u32,
@@ -245,7 +245,7 @@ async fn write_program_events(
245245
fn events_from_slot(
246246
slot: u64,
247247
block_time: Option<i64>,
248-
slot_data: &HashMap<Pubkey, ProgramStats>,
248+
slot_data: &HashMap<Address, ProgramStats>,
249249
) -> Vec<ProgramEvent> {
250250
let raw_ts = block_time.unwrap_or(0);
251251
let timestamp: u32 = if raw_ts < 0 {

0 commit comments

Comments
 (0)