From 34c595028885858d725df18f35abff14c3e307bb Mon Sep 17 00:00:00 2001 From: Lijun Wang <83639177+lijunwangs@users.noreply.github.com> Date: Wed, 18 Oct 2023 09:28:05 -0700 Subject: [PATCH 1/2] support validator v1.16 --- Cargo.toml | 26 +++++++++---------- scripts/create_schema.sql | 3 ++- .../postgres_client_transaction.rs | 12 +++++---- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 018e7f6..362129c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ authors = ["Solana Maintainers "] edition = "2021" name = "solana-geyser-plugin-postgres" description = "The Solana AccountsDb plugin for PostgreSQL database." -version = "1.15.2" +version = "1.16.17" repository = "https://github.com/solana-labs/solana-accountsdb-plugin-postgres" license = "Apache-2.0" homepage = "https://solana.com/" @@ -25,13 +25,13 @@ postgres-openssl = { version = "0.5.0"} serde = "1.0.145" serde_derive = "1.0.145" serde_json = "1.0.85" -solana-geyser-plugin-interface = { version = "1.16.0" } -solana-logger = { version = "1.16.0" } -solana-measure = { version = "1.16.0" } -solana-metrics = { version = "1.16.0" } -solana-runtime = { version = "1.16.0" } -solana-sdk = { version = "1.16.0" } -solana-transaction-status = { version = "1.16.0" } +solana-geyser-plugin-interface = { version = "=1.16.17" } +solana-logger = { version = "1.16.17" } +solana-measure = { version = "1.16.17" } +solana-metrics = { version = "1.16.17" } +solana-runtime = { version = "1.16.17" } +solana-sdk = { version = "1.16.17" } +solana-transaction-status = { version = "1.16.17" } thiserror = "1.0.37" tokio-postgres = "0.7.7" @@ -41,11 +41,11 @@ libloading = "0.7.3" serial_test = "0.9.0" socket2 = { version = "0.4.7", features = ["all"] } -solana-account-decoder = { version = "1.16.0" } -solana-core = { version = "1.16.0" } -solana-local-cluster = { version = "1.16.0" } -solana-net-utils = { version = "1.16.0" } -solana-streamer = { version = "1.16.0" } +solana-account-decoder = { version = "1.16.17" } +solana-core = { version = "1.16.17" } +solana-local-cluster = { version = "1.16.17" } +solana-net-utils = { version = "1.16.17" } +solana-streamer = { version = "1.16.17" } tempfile = "3.3.0" [package.metadata.docs.rs] diff --git a/scripts/create_schema.sql b/scripts/create_schema.sql index d55cf07..f531382 100644 --- a/scripts/create_schema.sql +++ b/scripts/create_schema.sql @@ -67,7 +67,8 @@ Create TYPE "TransactionErrorCode" AS ENUM ( 'InsufficientFundsForRent', 'MaxLoadedAccountsDataSizeExceeded', 'InvalidLoadedAccountsDataSizeLimit', - 'ResanitizationNeeded' + 'ResanitizationNeeded', + 'UnbalancedTransaction' ); CREATE TYPE "TransactionError" AS ( diff --git a/src/postgres_client/postgres_client_transaction.rs b/src/postgres_client/postgres_client_transaction.rs index 3668095..e71a588 100644 --- a/src/postgres_client/postgres_client_transaction.rs +++ b/src/postgres_client/postgres_client_transaction.rs @@ -351,6 +351,7 @@ pub enum DbTransactionErrorCode { MaxLoadedAccountsDataSizeExceeded, InvalidLoadedAccountsDataSizeLimit, ResanitizationNeeded, + UnbalancedTransaction, } impl From<&TransactionError> for DbTransactionErrorCode { @@ -407,6 +408,7 @@ impl From<&TransactionError> for DbTransactionErrorCode { Self::InvalidLoadedAccountsDataSizeLimit } TransactionError::ResanitizationNeeded => Self::ResanitizationNeeded, + TransactionError::UnbalancedTransaction => Self::UnbalancedTransaction, } } } @@ -1374,7 +1376,7 @@ pub(crate) mod tests { #[test] fn test_build_db_transaction_legacy() { - let signature = Signature::new(&[1u8; 64]); + let signature = Signature::from([1u8; 64]); let message_hash = Hash::new_unique(); let transaction = build_test_transaction_legacy(); @@ -1407,9 +1409,9 @@ pub(crate) mod tests { fn build_test_transaction_v0() -> VersionedTransaction { VersionedTransaction { signatures: vec![ - Signature::new(&[1u8; 64]), - Signature::new(&[2u8; 64]), - Signature::new(&[3u8; 64]), + Signature::from([1u8; 64]), + Signature::from([2u8; 64]), + Signature::from([3u8; 64]), ], message: VersionedMessage::V0(build_transaction_message_v0()), } @@ -1417,7 +1419,7 @@ pub(crate) mod tests { #[test] fn test_build_db_transaction_v0() { - let signature = Signature::new(&[1u8; 64]); + let signature = Signature::from([1u8; 64]); let message_hash = Hash::new_unique(); let transaction = build_test_transaction_v0(); From 4ddb1a69dd03c3f693d132541753daca21363f7f Mon Sep 17 00:00:00 2001 From: Lijun Wang <83639177+lijunwangs@users.noreply.github.com> Date: Wed, 18 Oct 2023 10:23:32 -0700 Subject: [PATCH 2/2] update rust version --- ci/rust-version.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/rust-version.sh b/ci/rust-version.sh index 177f7da..88a5616 100644 --- a/ci/rust-version.sh +++ b/ci/rust-version.sh @@ -18,13 +18,13 @@ if [[ -n $RUST_STABLE_VERSION ]]; then stable_version="$RUST_STABLE_VERSION" else - stable_version=1.66.1 + stable_version=1.69.0 fi if [[ -n $RUST_NIGHTLY_VERSION ]]; then nightly_version="$RUST_NIGHTLY_VERSION" else - nightly_version=2022-04-01 + nightly_version=2023-04-19 fi