Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: update solana to 1.16.14 #64

Merged
merged 3 commits into from
Sep 29, 2023
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
1,481 changes: 1,035 additions & 446 deletions Cargo.lock

Large diffs are not rendered by default.

30 changes: 12 additions & 18 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "solana-geyser-sqs"
version = "0.2.3+solana.1.14.17"
version = "0.3.0+solana.1.16.14"
edition = "2018"
publish = false

Expand All @@ -14,7 +14,7 @@ async-trait = "0.1"
base64 = "0.13.0"
bincode = "1.3"
chrono = "0.4"
clap = { version = "3.1.8", features = ["cargo", "derive"] }
clap = { version = "4.3.0", features = ["cargo", "derive"] }
derivative = "2"
enumflags2 = "0.6.4"
flate2 = "1"
Expand All @@ -38,28 +38,22 @@ safe-transmute = "0.11"
serde = { version = "1.0.132", features = ["derive"] }
serde_json = "1.0.73"
serum_dex = "0.5.4"
solana-geyser-plugin-interface = "=1.14.17"
solana-logger = "=1.14.17"
solana-sdk = "=1.14.17"
solana-transaction-status = "=1.14.17"
solana-geyser-plugin-interface = "=1.16.14"
solana-logger = "=1.16.14"
solana-sdk = "=1.16.14"
solana-transaction-status = "=1.16.14"
spl-token = "3.5.0"
thiserror = "1.0.30"
tokio = { version = "1.15.0", features = ["rt-multi-thread", "time", "macros", "io-util"] }
zstd = "0.11.1"

[build-dependencies]
anyhow = "1"
cargo-lock = "8"
git-version = "0.3"
vergen = "=7.2.1"
anyhow = "1.0.62"
cargo-lock = "9.0.0"
git-version = "0.3.5"
vergen = { version = "8.2.1", features = ["build", "rustc"] }

[profile.release]
codegen-units = 1
debug = true
lto = true

[patch.crates-io]
solana-geyser-plugin-interface = { git = "https://github.com/rpcpool/solana-public.git", tag = "v1.14.17-geyser-block-v2" }
solana-logger = { git = "https://github.com/rpcpool/solana-public.git", tag = "v1.14.17-geyser-block-v2" }
solana-program = { git = "https://github.com/rpcpool/solana-public.git", tag = "v1.14.17-geyser-block-v2" }
solana-sdk = { git = "https://github.com/rpcpool/solana-public.git", tag = "v1.14.17-geyser-block-v2" }
solana-transaction-status = { git = "https://github.com/rpcpool/solana-public.git", tag = "v1.14.17-geyser-block-v2" }
codegen-units = 1
34 changes: 18 additions & 16 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
use {
cargo_lock::Lockfile,
std::collections::HashSet,
vergen::{vergen, Config},
};
use {cargo_lock::Lockfile, std::collections::HashSet};

fn main() -> anyhow::Result<()> {
vergen(Config::default())?;
let mut envs = vergen::EmitBuilder::builder();
envs.all_build().all_rustc();
envs.emit()?;

// vergen git version does not looks cool
println!(
Expand All @@ -14,19 +12,23 @@ fn main() -> anyhow::Result<()> {
);

// Extract Solana version
let lockfile = Lockfile::load("./Cargo.lock")?;
let lockfile = Lockfile::load("Cargo.lock")?;
println!(
"cargo:rustc-env=SOLANA_SDK_VERSION={}",
lockfile
.packages
.iter()
.filter(|pkg| pkg.name.as_str() == "solana-sdk")
.map(|pkg| pkg.version.to_string())
.collect::<HashSet<_>>()
.into_iter()
.collect::<Vec<_>>()
.join(",")
get_pkg_version(&lockfile, "solana-sdk")
);

Ok(())
}

fn get_pkg_version(lockfile: &Lockfile, pkg_name: &str) -> String {
lockfile
.packages
.iter()
.filter(|pkg| pkg.name.as_str() == pkg_name)
.map(|pkg| pkg.version.to_string())
.collect::<HashSet<_>>()
.into_iter()
.collect::<Vec<_>>()
.join(",")
}
2 changes: 1 addition & 1 deletion ci/rust-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
if [[ -n $RUST_STABLE_VERSION ]]; then
stable_version="$RUST_STABLE_VERSION"
else
stable_version=1.60.0
stable_version=1.69.0
fi

if [[ -n $RUST_NIGHTLY_VERSION ]]; then
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "1.60.0"
channel = "1.69.0"
components = ["clippy", "rustfmt"]
targets = []
profile = "minimal"
4 changes: 2 additions & 2 deletions src/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ pub enum ConfigMgmtMsgFilterAccounts {
}

impl ConfigMgmtMsgFilterAccounts {
pub fn as_str(&self) -> &str {
pub const fn as_str(&self) -> &str {
match *self {
Self::Account => "account",
Self::Owner => "owner",
Expand All @@ -268,7 +268,7 @@ pub enum ConfigMgmtMsgFilterTransactions {
}

impl ConfigMgmtMsgFilterTransactions {
pub fn as_str(&self) -> &str {
pub const fn as_str(&self) -> &str {
match *self {
Self::AccountsInclude => "accounts.include",
Self::AccountsExclude => "accounts.exclude",
Expand Down
3 changes: 2 additions & 1 deletion src/aws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ impl SqsMessageAttributes {
.map(|s| s.as_str())
}

#[allow(clippy::missing_const_for_fn)]
pub fn into_inner(self) -> HashMap<String, MessageAttributeValue> {
self.map
}
Expand Down Expand Up @@ -199,7 +200,7 @@ impl SqsClient {
.map(|_| ())
}

pub fn is_typed(&self) -> bool {
pub const fn is_typed(&self) -> bool {
matches!(self.queue_url, SqsClientQueueUrl::Typed { .. })
}

Expand Down
10 changes: 5 additions & 5 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ pub enum AccountsDataCompression {
}

impl AccountsDataCompression {
fn zstd_default_level() -> i32 {
const fn zstd_default_level() -> i32 {
zstd::DEFAULT_COMPRESSION_LEVEL
}

Expand All @@ -269,7 +269,7 @@ impl AccountsDataCompression {
})
}

pub fn as_str(&self) -> &'static str {
pub const fn as_str(&self) -> &'static str {
match *self {
AccountsDataCompression::None => "none",
AccountsDataCompression::Zstd { .. } => "zstd",
Expand Down Expand Up @@ -441,7 +441,7 @@ impl PartialEq<PubkeyWithSource> for PubkeyWithSource {
}
}

#[allow(clippy::derive_hash_xor_eq)]
#[allow(clippy::derived_hash_with_manual_eq)]
impl Hash for PubkeyWithSource {
fn hash<H: Hasher>(&self, state: &mut H) {
match self {
Expand Down Expand Up @@ -491,10 +491,10 @@ impl PubkeyWithSource {
if let Self::Redis { set, keys } = self {
match keys {
Some(keys) => {
pipe.del(&set);
pipe.del(set);
let keys = keys.iter().map(|k| k.to_string()).collect::<Vec<_>>();
if !keys.is_empty() {
pipe.sadd(&set, &keys);
pipe.sadd(set, &keys);
}
}
None => return Err(PubkeyWithSourceError::ExpectedLoadedPubkeys),
Expand Down
10 changes: 5 additions & 5 deletions src/filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ struct AccountsFilterExistence {
}

impl AccountsFilterExistence {
fn is_empty(&self) -> bool {
const fn is_empty(&self) -> bool {
!(self.account
|| self.owner
|| self.data_size
Expand Down Expand Up @@ -596,7 +596,7 @@ impl AccountsFilter {
let value = map_required.entry(name.clone()).or_default();
*value += 1;
*existence_field = true;
logs.then(|| "added to")
logs.then_some("added to")
}
ConfigMgmtMsgAction::Remove => {
let set = match map.get_mut(&pubkey) {
Expand Down Expand Up @@ -626,7 +626,7 @@ impl AccountsFilter {
map_required.remove(&name);
}

logs.then(|| "removed from")
logs.then_some("removed from")
}
} {
info!(
Expand Down Expand Up @@ -924,7 +924,7 @@ impl TransactionsFilter {
target.as_str()
));
}
logs.then(|| "added to")
logs.then_some("added to")
}
ConfigMgmtMsgAction::Remove => {
if !set.remove(&pubkey) {
Expand All @@ -935,7 +935,7 @@ impl TransactionsFilter {
target.as_str()
));
}
logs.then(|| "removed from")
logs.then_some("removed from")
}
} {
info!(
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#![deny(clippy::clone_on_ref_ptr)]
#![deny(clippy::missing_const_for_fn)]
#![deny(clippy::trivially_copy_pass_by_ref)]

pub mod admin;
pub mod aws;
pub mod config;
Expand Down
18 changes: 9 additions & 9 deletions src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ pub struct Plugin {
}

impl Plugin {
fn with_client<F>(&mut self, f: F) -> PluginResult<()>
fn with_client<F>(&self, f: F) -> PluginResult<()>
where
F: FnOnce(&mut AwsSqsClient) -> SqsClientResult,
F: FnOnce(&AwsSqsClient) -> SqsClientResult,
{
let inner = self.inner.as_mut().expect("initialized");
f(&mut inner.client).map_err(|error| GeyserPluginError::Custom(Box::new(error)))
let inner = self.inner.as_ref().expect("initialized");
f(&inner.client).map_err(|error| GeyserPluginError::Custom(Box::new(error)))
}
}

Expand Down Expand Up @@ -69,20 +69,20 @@ impl GeyserPlugin for Plugin {
}

fn update_account(
&mut self,
&self,
account: ReplicaAccountInfoVersions,
slot: u64,
_is_startup: bool,
) -> PluginResult<()> {
self.with_client(|sqs| sqs.update_account(account, slot))
}

fn notify_end_of_startup(&mut self) -> PluginResult<()> {
fn notify_end_of_startup(&self) -> PluginResult<()> {
self.with_client(|sqs| sqs.startup_finished())
}

fn update_slot_status(
&mut self,
&self,
slot: u64,
_parent: Option<u64>,
status: SlotStatus,
Expand All @@ -91,14 +91,14 @@ impl GeyserPlugin for Plugin {
}

fn notify_transaction(
&mut self,
&self,
transaction: ReplicaTransactionInfoVersions,
slot: u64,
) -> PluginResult<()> {
self.with_client(|sqs| sqs.notify_transaction(transaction, slot))
}

fn notify_block_metadata(&mut self, blockinfo: ReplicaBlockInfoVersions) -> PluginResult<()> {
fn notify_block_metadata(&self, blockinfo: ReplicaBlockInfoVersions) -> PluginResult<()> {
self.with_client(|sqs| sqs.notify_block_metadata(blockinfo))
}

Expand Down
6 changes: 3 additions & 3 deletions src/prom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub mod health {
}

impl HealthInfoType {
pub fn as_str(self) -> &'static str {
pub const fn as_str(self) -> &'static str {
match self {
Self::SendLoop => "send_loop",
Self::RedisAdmin => "redis_admin",
Expand All @@ -100,7 +100,7 @@ pub enum UploadMessagesStatus {
}

impl UploadMessagesStatus {
pub fn as_str(self) -> &'static str {
pub const fn as_str(self) -> &'static str {
match self {
Self::Success => "success",
Self::Failed => "failed",
Expand All @@ -116,7 +116,7 @@ pub enum UploadAwsStatus {
}

impl UploadAwsStatus {
pub fn as_str(self) -> &'static str {
pub const fn as_str(self) -> &'static str {
match self {
Self::Success => "success",
Self::Failed => "failed",
Expand Down
2 changes: 1 addition & 1 deletion src/serum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl FromStr for EventFlag {
}

impl EventFlag {
pub fn as_str(self) -> &'static str {
pub const fn as_str(self) -> &'static str {
match self {
EventFlag::Fill => "Fill",
EventFlag::Out => "Out",
Expand Down
Loading
Loading