diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 981519ed8..d0a881165 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -199,9 +199,9 @@ dependencies = [ [[package]] name = "aptos-indexer-test-transactions" version = "1.0.0" -source = "git+https://github.com/aptos-labs/aptos-core.git?rev=63eb8945a86521bc0fb0e26b306693e11327c85d#63eb8945a86521bc0fb0e26b306693e11327c85d" +source = "git+https://github.com/aptos-labs/aptos-core.git?rev=d949a8fb6fe64e5da8f672be52a148f105bbe0cf#d949a8fb6fe64e5da8f672be52a148f105bbe0cf" dependencies = [ - "aptos-protos 1.3.1 (git+https://github.com/aptos-labs/aptos-core.git?rev=63eb8945a86521bc0fb0e26b306693e11327c85d)", + "aptos-protos 1.3.1 (git+https://github.com/aptos-labs/aptos-core.git?rev=d949a8fb6fe64e5da8f672be52a148f105bbe0cf)", "serde_json", ] @@ -309,7 +309,7 @@ dependencies = [ [[package]] name = "aptos-protos" version = "1.3.1" -source = "git+https://github.com/aptos-labs/aptos-core.git?rev=63eb8945a86521bc0fb0e26b306693e11327c85d#63eb8945a86521bc0fb0e26b306693e11327c85d" +source = "git+https://github.com/aptos-labs/aptos-core.git?rev=d949a8fb6fe64e5da8f672be52a148f105bbe0cf#d949a8fb6fe64e5da8f672be52a148f105bbe0cf" dependencies = [ "pbjson", "prost 0.13.4", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index afb74f120..c41cb30f9 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -31,7 +31,7 @@ anyhow = "1.0.86" aptos-indexer-processor-sdk = { git = "https://github.com/aptos-labs/aptos-indexer-processor-sdk.git", rev = "b79ed8b5864b2a12a1f9c5fd01579462e029b2ae" } aptos-indexer-processor-sdk-server-framework = { git = "https://github.com/aptos-labs/aptos-indexer-processor-sdk.git", rev = "b79ed8b5864b2a12a1f9c5fd01579462e029b2ae" } aptos-protos = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "1d8460a995503574ec4e9699d3442d0150d7f3b9" } -aptos-indexer-test-transactions = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "63eb8945a86521bc0fb0e26b306693e11327c85d" } +aptos-indexer-test-transactions = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "d949a8fb6fe64e5da8f672be52a148f105bbe0cf" } aptos-indexer-testing-framework = { git = "https://github.com/aptos-labs/aptos-indexer-processor-sdk.git", rev = "b79ed8b5864b2a12a1f9c5fd01579462e029b2ae" } async-trait = "0.1.53" backtrace = "0.3.58" diff --git a/rust/integration-tests/sdk_expected_db_output_files/imported_mainnet_txns/events_processor/validator_txn_missing_events/events.json b/rust/integration-tests/sdk_expected_db_output_files/imported_mainnet_txns/events_processor/validator_txn_missing_events/events.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/sdk_expected_db_output_files/imported_mainnet_txns/events_processor/validator_txn_missing_events/events.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/src/sdk_tests/events_processor_tests.rs b/rust/integration-tests/src/sdk_tests/events_processor_tests.rs index 62be9b180..10f4e9bc1 100644 --- a/rust/integration-tests/src/sdk_tests/events_processor_tests.rs +++ b/rust/integration-tests/src/sdk_tests/events_processor_tests.rs @@ -52,6 +52,7 @@ mod tests { IMPORTED_DEVNET_TXNS_78753811_COIN_TRANSFER_WITH_V2_EVENTS, IMPORTED_DEVNET_TXNS_78753831_TOKEN_V1_MINT_TRANSFER_WITH_V2_EVENTS, IMPORTED_DEVNET_TXNS_78753832_TOKEN_V2_MINT_TRANSFER_WITH_V2_EVENTS, + IMPORTED_MAINNET_TXNS_554229017_EVENTS_WITH_NO_EVENT_SIZE_INFO, IMPORTED_TESTNET_TXNS_1255836496_V2_FA_METADATA_, IMPORTED_TESTNET_TXNS_1_GENESIS, IMPORTED_TESTNET_TXNS_278556781_V1_COIN_REGISTER_FA_METADATA, IMPORTED_TESTNET_TXNS_2_NEW_BLOCK_EVENT, IMPORTED_TESTNET_TXNS_3_EMPTY_TXN, @@ -151,6 +152,19 @@ mod tests { .await; } + // This is a test for the validator txn with missing events + // This happens because we did not fully backfill validator txn events + // so GRPC can return a txn with event size info but no events + // We expect no events parsed + #[tokio::test(flavor = "multi_thread", worker_threads = 2)] + async fn mainnet_events_processor_validator_txn_missing_events() { + process_single_mainnet_event_txn( + IMPORTED_MAINNET_TXNS_554229017_EVENTS_WITH_NO_EVENT_SIZE_INFO, // this is misnamed, but it's the validatortxn with missing events + Some("validator_txn_missing_events".to_string()), + ) + .await; + } + // Example 2: Test for multiple transactions handling #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn testnet_events_processor_db_output_scenario_testing() { @@ -218,6 +232,10 @@ mod tests { process_single_event_txn(txn, test_case_name, "imported_testnet_txns").await } + async fn process_single_mainnet_event_txn(txn: &[u8], test_case_name: Option) { + process_single_event_txn(txn, test_case_name, "imported_mainnet_txns").await + } + // Helper function to abstract out the single transaction processing async fn process_single_event_txn( txn: &[u8],