From 8b7bed24191a60fe32fd81e72c173ea62f19d077 Mon Sep 17 00:00:00 2001 From: larry-aptos <112209412+larry-aptos@users.noreply.github.com> Date: Wed, 18 Sep 2024 17:05:03 -0700 Subject: [PATCH] update dependency to be compatible with aptos-core (#515) --- rust/Cargo.lock | 18 ++++++++++++------ rust/Cargo.toml | 11 ++++++----- .../common/latest_processed_version_tracker.rs | 2 ++ .../steps/events_processor/events_storer.rs | 2 ++ 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 4efcce8e9..43ab13654 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -147,7 +147,7 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "aptos-indexer-processor-sdk" version = "0.1.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=e1e1bdd9349f0a68c9fc53b7e2cebda9e2ce92b7#e1e1bdd9349f0a68c9fc53b7e2cebda9e2ce92b7" +source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=3970abde03f9eca299e668562d71ccda8ed42ebf#3970abde03f9eca299e668562d71ccda8ed42ebf" dependencies = [ "anyhow", "aptos-indexer-transaction-stream", @@ -179,7 +179,7 @@ dependencies = [ [[package]] name = "aptos-indexer-processor-sdk-server-framework" version = "1.0.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=e1e1bdd9349f0a68c9fc53b7e2cebda9e2ce92b7#e1e1bdd9349f0a68c9fc53b7e2cebda9e2ce92b7" +source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=3970abde03f9eca299e668562d71ccda8ed42ebf#3970abde03f9eca299e668562d71ccda8ed42ebf" dependencies = [ "anyhow", "aptos-indexer-processor-sdk", @@ -212,16 +212,17 @@ dependencies = [ [[package]] name = "aptos-indexer-transaction-stream" version = "0.1.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=e1e1bdd9349f0a68c9fc53b7e2cebda9e2ce92b7#e1e1bdd9349f0a68c9fc53b7e2cebda9e2ce92b7" +source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=3970abde03f9eca299e668562d71ccda8ed42ebf#3970abde03f9eca299e668562d71ccda8ed42ebf" dependencies = [ "anyhow", - "aptos-moving-average 0.1.0 (git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=e1e1bdd9349f0a68c9fc53b7e2cebda9e2ce92b7)", + "aptos-moving-average 0.1.0 (git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=3970abde03f9eca299e668562d71ccda8ed42ebf)", "aptos-protos 1.3.1 (git+https://github.com/aptos-labs/aptos-core.git?rev=5c48aee129b5a141be2792ffa3d9bd0a1a61c9cb)", "chrono", "futures-util", "once_cell", "prometheus", "prost 0.12.6", + "sample", "serde", "tokio", "tonic 0.11.0", @@ -239,7 +240,7 @@ dependencies = [ [[package]] name = "aptos-moving-average" version = "0.1.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=e1e1bdd9349f0a68c9fc53b7e2cebda9e2ce92b7#e1e1bdd9349f0a68c9fc53b7e2cebda9e2ce92b7" +source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=3970abde03f9eca299e668562d71ccda8ed42ebf#3970abde03f9eca299e668562d71ccda8ed42ebf" dependencies = [ "chrono", ] @@ -2202,7 +2203,7 @@ dependencies = [ [[package]] name = "instrumented-channel" version = "0.1.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=e1e1bdd9349f0a68c9fc53b7e2cebda9e2ce92b7#e1e1bdd9349f0a68c9fc53b7e2cebda9e2ce92b7" +source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=3970abde03f9eca299e668562d71ccda8ed42ebf#3970abde03f9eca299e668562d71ccda8ed42ebf" dependencies = [ "delegate", "derive_builder", @@ -4061,6 +4062,11 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +[[package]] +name = "sample" +version = "0.1.0" +source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=3970abde03f9eca299e668562d71ccda8ed42ebf#3970abde03f9eca299e668562d71ccda8ed42ebf" + [[package]] name = "schannel" version = "0.1.23" diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 9ba106d11..caa70c2fa 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -17,7 +17,7 @@ homepage = "https://aptoslabs.com" license = "Apache-2.0" publish = false repository = "https://github.com/aptos-labs/aptos-indexer-processors" -rust-version = "1.75" +rust-version = "1.78" [workspace.dependencies] processor = { path = "processor" } @@ -28,8 +28,8 @@ sdk-processor = { path = "sdk-processor" } ahash = { version = "0.8.7", features = ["serde"] } anyhow = "1.0.86" -aptos-indexer-processor-sdk = { git = "https://github.com/aptos-labs/aptos-indexer-processor-sdk.git", rev = "e1e1bdd9349f0a68c9fc53b7e2cebda9e2ce92b7" } -aptos-indexer-processor-sdk-server-framework = { git = "https://github.com/aptos-labs/aptos-indexer-processor-sdk.git", rev = "e1e1bdd9349f0a68c9fc53b7e2cebda9e2ce92b7" } +aptos-indexer-processor-sdk = { git = "https://github.com/aptos-labs/aptos-indexer-processor-sdk.git", rev = "3970abde03f9eca299e668562d71ccda8ed42ebf" } +aptos-indexer-processor-sdk-server-framework = { git = "https://github.com/aptos-labs/aptos-indexer-processor-sdk.git", rev = "3970abde03f9eca299e668562d71ccda8ed42ebf" } aptos-protos = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "5c48aee129b5a141be2792ffa3d9bd0a1a61c9cb" } aptos-system-utils = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "202bdccff2b2d333a385ae86a4fcf23e89da9f62" } aptos-indexer-test-transactions = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "202bdccff2b2d333a385ae86a4fcf23e89da9f62" } @@ -83,10 +83,11 @@ kanal = { version = "0.1.0-pre8", features = ["async"] } once_cell = "1.10.0" num_cpus = "1.16.0" pbjson = "0.5.1" -prometheus = { version = "0.13.0", default-features = false } +prometheus = { version = "0.13.3", default-features = false } prost = { version = "0.12.3", features = ["no-recursion-limit"] } prost-types = "0.12.3" -rayon = "1.10.0" +# Keep it compatible with the aptos-core version. +rayon = "1.5.2" regex = "1.5.5" reqwest = { version = "0.11.20", features = [ "blocking", diff --git a/rust/sdk-processor/src/steps/common/latest_processed_version_tracker.rs b/rust/sdk-processor/src/steps/common/latest_processed_version_tracker.rs index 7e8b09546..54b7e7b78 100644 --- a/rust/sdk-processor/src/steps/common/latest_processed_version_tracker.rs +++ b/rust/sdk-processor/src/steps/common/latest_processed_version_tracker.rs @@ -85,6 +85,8 @@ where Some(" WHERE processor_status.last_success_version <= EXCLUDED.last_success_version "), ).await.map_err(|e| ProcessorError::DBStoreError { message: format!("Failed to update processor status: {}", e), + // TODO: fix it with a debug_query. + query: None, })?; } Ok(()) diff --git a/rust/sdk-processor/src/steps/events_processor/events_storer.rs b/rust/sdk-processor/src/steps/events_processor/events_storer.rs index cda8ccf76..c5560155e 100644 --- a/rust/sdk-processor/src/steps/events_processor/events_storer.rs +++ b/rust/sdk-processor/src/steps/events_processor/events_storer.rs @@ -94,6 +94,8 @@ impl Processable for EventsStorer { "Failed to store events versions {} to {}: {:?}", events.start_version, events.end_version, e, ), + // TODO: fix it with a debug_query. + query: None, }), } }