Skip to content

Commit 00368fc

Browse files
committed
Support validator 1.17.2
1 parent 68a4471 commit 00368fc

File tree

7 files changed

+31
-25
lines changed

7 files changed

+31
-25
lines changed

Cargo.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ authors = ["Solana Maintainers <maintainers@solana.foundation>"]
33
edition = "2021"
44
name = "solana-geyser-plugin-postgres"
55
description = "The Solana AccountsDb plugin for PostgreSQL database."
6-
version = "1.16.17"
6+
version = "1.17.2"
77
repository = "https://github.com/solana-labs/solana-accountsdb-plugin-postgres"
88
license = "Apache-2.0"
99
homepage = "https://solana.com/"
@@ -25,13 +25,13 @@ postgres-openssl = { version = "0.5.0"}
2525
serde = "1.0.145"
2626
serde_derive = "1.0.145"
2727
serde_json = "1.0.85"
28-
solana-geyser-plugin-interface = { version = "=1.16.17" }
29-
solana-logger = { version = "1.16.17" }
30-
solana-measure = { version = "1.16.17" }
31-
solana-metrics = { version = "1.16.17" }
32-
solana-runtime = { version = "1.16.17" }
33-
solana-sdk = { version = "1.16.17" }
34-
solana-transaction-status = { version = "1.16.17" }
28+
solana-geyser-plugin-interface = { version = "=1.17.2" }
29+
solana-logger = { version = "1.17.2" }
30+
solana-measure = { version = "1.17.2" }
31+
solana-metrics = { version = "1.17.2" }
32+
solana-runtime = { version = "1.17.2" }
33+
solana-sdk = { version = "1.17.2" }
34+
solana-transaction-status = { version = "1.17.2" }
3535
thiserror = "1.0.37"
3636
tokio-postgres = "0.7.7"
3737

@@ -41,11 +41,11 @@ libloading = "0.7.3"
4141
serial_test = "0.9.0"
4242
socket2 = { version = "0.4.7", features = ["all"] }
4343

44-
solana-account-decoder = { version = "1.16.17" }
45-
solana-core = { version = "1.16.17" }
46-
solana-local-cluster = { version = "1.16.17" }
47-
solana-net-utils = { version = "1.16.17" }
48-
solana-streamer = { version = "1.16.17" }
44+
solana-account-decoder = { version = "1.17.2" }
45+
solana-core = { version = "1.17.2" }
46+
solana-local-cluster = { version = "1.17.2" }
47+
solana-net-utils = { version = "1.17.2" }
48+
solana-streamer = { version = "1.17.2" }
4949
tempfile = "3.3.0"
5050

5151
[package.metadata.docs.rs]

ci/rust-version.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
if [[ -n $RUST_STABLE_VERSION ]]; then
1919
stable_version="$RUST_STABLE_VERSION"
2020
else
21-
stable_version=1.69.0
21+
stable_version=1.73.0
2222
fi
2323

2424
if [[ -n $RUST_NIGHTLY_VERSION ]]; then
2525
nightly_version="$RUST_NIGHTLY_VERSION"
2626
else
27-
nightly_version=2023-04-19
27+
nightly_version=2023-10-05
2828
fi
2929

3030

scripts/create_schema.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ Create TYPE "TransactionErrorCode" AS ENUM (
6868
'MaxLoadedAccountsDataSizeExceeded',
6969
'InvalidLoadedAccountsDataSizeLimit',
7070
'ResanitizationNeeded',
71-
'UnbalancedTransaction'
71+
'UnbalancedTransaction',
72+
'ProgramExecutionTemporarilyRestricted'
7273
);
7374

7475
CREATE TYPE "TransactionError" AS (

src/geyser_plugin_postgres.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ impl GeyserPlugin for GeyserPluginPostgres {
414414
)));
415415
}
416416
Some(client) => match block_info {
417-
ReplicaBlockInfoVersions::V0_0_2(block_info) => {
417+
ReplicaBlockInfoVersions::V0_0_3(block_info) => {
418418
let result = client.update_block_metadata(block_info);
419419

420420
if let Err(err) = result {
@@ -423,6 +423,11 @@ impl GeyserPlugin for GeyserPluginPostgres {
423423
});
424424
}
425425
}
426+
ReplicaBlockInfoVersions::V0_0_2(_block_info) => {
427+
return Err(GeyserPluginError::SlotStatusUpdateError{
428+
msg: "Failed to persist the transaction info to the PostgreSQL database. Unsupported format.".to_string()
429+
});
430+
}
426431
ReplicaBlockInfoVersions::V0_0_1(_) => {
427432
return Err(GeyserPluginError::SlotStatusUpdateError{
428433
msg: "Failed to persist the transaction info to the PostgreSQL database. Unsupported format.".to_string()

src/postgres_client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use {
1919
postgres_client_transaction::LogTransactionRequest,
2020
postgres_openssl::MakeTlsConnector,
2121
solana_geyser_plugin_interface::geyser_plugin_interface::{
22-
GeyserPluginError, ReplicaAccountInfoV3, ReplicaBlockInfoV2, SlotStatus,
22+
GeyserPluginError, ReplicaAccountInfoV3, ReplicaBlockInfoV3, SlotStatus,
2323
},
2424
solana_measure::measure::Measure,
2525
solana_metrics::*,
@@ -1232,7 +1232,7 @@ impl ParallelPostgresClient {
12321232

12331233
pub fn update_block_metadata(
12341234
&self,
1235-
block_info: &ReplicaBlockInfoV2,
1235+
block_info: &ReplicaBlockInfoV3,
12361236
) -> Result<(), GeyserPluginError> {
12371237
if let Err(err) = self.sender.send(DbWorkItem::UpdateBlockMetadata(Box::new(
12381238
UpdateBlockMetadataRequest {

src/postgres_client/postgres_client_block_metadata.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use {
99
log::*,
1010
postgres::{Client, Statement},
1111
solana_geyser_plugin_interface::geyser_plugin_interface::{
12-
GeyserPluginError, ReplicaBlockInfoV2,
12+
GeyserPluginError, ReplicaBlockInfoV3,
1313
},
1414
};
1515

@@ -22,8 +22,8 @@ pub struct DbBlockInfo {
2222
pub block_height: Option<i64>,
2323
}
2424

25-
impl<'a> From<&ReplicaBlockInfoV2<'a>> for DbBlockInfo {
26-
fn from(block_info: &ReplicaBlockInfoV2) -> Self {
25+
impl<'a> From<&ReplicaBlockInfoV3<'a>> for DbBlockInfo {
26+
fn from(block_info: &ReplicaBlockInfoV3) -> Self {
2727
Self {
2828
slot: block_info.slot as i64,
2929
blockhash: block_info.blockhash.to_string(),

src/postgres_client/postgres_client_transaction.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ pub enum DbTransactionErrorCode {
352352
InvalidLoadedAccountsDataSizeLimit,
353353
ResanitizationNeeded,
354354
UnbalancedTransaction,
355+
ProgramExecutionTemporarilyRestricted,
355356
}
356357

357358
impl From<&TransactionError> for DbTransactionErrorCode {
@@ -409,6 +410,7 @@ impl From<&TransactionError> for DbTransactionErrorCode {
409410
}
410411
TransactionError::ResanitizationNeeded => Self::ResanitizationNeeded,
411412
TransactionError::UnbalancedTransaction => Self::UnbalancedTransaction,
413+
TransactionError::ProgramExecutionTemporarilyRestricted {account_index: _} => Self::ProgramExecutionTemporarilyRestricted,
412414
}
413415
}
414416
}
@@ -1388,7 +1390,6 @@ pub(crate) mod tests {
13881390
message_hash,
13891391
Some(true),
13901392
SimpleAddressLoader::Disabled,
1391-
false,
13921393
)
13931394
.unwrap();
13941395

@@ -1424,7 +1425,7 @@ pub(crate) mod tests {
14241425
let message_hash = Hash::new_unique();
14251426
let transaction = build_test_transaction_v0();
14261427

1427-
transaction.sanitize(false).unwrap();
1428+
transaction.sanitize().unwrap();
14281429

14291430
let transaction = SanitizedTransaction::try_create(
14301431
transaction,
@@ -1434,7 +1435,6 @@ pub(crate) mod tests {
14341435
writable: vec![Pubkey::new_unique(), Pubkey::new_unique()],
14351436
readonly: vec![Pubkey::new_unique(), Pubkey::new_unique()],
14361437
}),
1437-
false,
14381438
)
14391439
.unwrap();
14401440

0 commit comments

Comments
 (0)