Skip to content
Closed
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
450 changes: 246 additions & 204 deletions Cargo.lock

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ diesel-async = "0.5.2"
diesel_migrations = "2.2.0"
anyhow = "1.0.100"
thiserror = "2.0.17"
once_cell = "1.20.3"
once_cell = "1.21.3"
tracing = "0.1.41"
clap = "4.5.48"
async-trait = "0.1.89"
Expand All @@ -33,19 +33,19 @@ futures = "0.3.31"
tempfile = "3.20.0"

# Main Sui Mono-repo
sui-indexer-alt-metrics = { git = "https://github.com/MystenLabs/sui.git", rev = "3b96ab72dd5db2fb800837d6067bf45839178b62" }
mysten-metrics = { git = "https://github.com/MystenLabs/sui.git", rev = "3b96ab72dd5db2fb800837d6067bf45839178b62" }
telemetry-subscribers = { git = "https://github.com/MystenLabs/sui.git", rev = "3b96ab72dd5db2fb800837d6067bf45839178b62" }
sui-pg-db = { git = "https://github.com/MystenLabs/sui.git", rev = "3b96ab72dd5db2fb800837d6067bf45839178b62" }
move-core-types = { git = "https://github.com/MystenLabs/sui.git", rev = "3b96ab72dd5db2fb800837d6067bf45839178b62" }
sui-types = { git = "https://github.com/MystenLabs/sui.git", rev = "3b96ab72dd5db2fb800837d6067bf45839178b62" }
sui-package-resolver = { git = "https://github.com/MystenLabs/sui.git", rev = "3b96ab72dd5db2fb800837d6067bf45839178b62" }
sui-move-build = { git = "https://github.com/MystenLabs/sui.git", rev = "3b96ab72dd5db2fb800837d6067bf45839178b62" }
move-binary-format = { git = "https://github.com/MystenLabs/sui.git", rev = "3b96ab72dd5db2fb800837d6067bf45839178b62" }
sui-indexer-alt-framework = { git = "https://github.com/MystenLabs/sui.git", rev = "3b96ab72dd5db2fb800837d6067bf45839178b62" }
sui-rpc-api = { git = "https://github.com/MystenLabs/sui.git", rev = "3b96ab72dd5db2fb800837d6067bf45839178b62" }
sui-storage = { git = "https://github.com/MystenLabs/sui.git", rev = "3b96ab72dd5db2fb800837d6067bf45839178b62" }
sui-field-count = { git = "https://github.com/MystenLabs/sui.git", rev = "3b96ab72dd5db2fb800837d6067bf45839178b62"}
sui-indexer-alt-metrics = { git = "https://github.com/MystenLabs/sui.git", rev = "fd1805c68e57484fcd14b7bddfb9e36570682306" }
mysten-metrics = { git = "https://github.com/MystenLabs/sui.git", rev = "fd1805c68e57484fcd14b7bddfb9e36570682306" }
telemetry-subscribers = { git = "https://github.com/MystenLabs/sui.git", rev = "fd1805c68e57484fcd14b7bddfb9e36570682306" }
sui-pg-db = { git = "https://github.com/MystenLabs/sui.git", rev = "fd1805c68e57484fcd14b7bddfb9e36570682306" }
move-core-types = { git = "https://github.com/MystenLabs/sui.git", rev = "fd1805c68e57484fcd14b7bddfb9e36570682306" }
sui-types = { git = "https://github.com/MystenLabs/sui.git", rev = "fd1805c68e57484fcd14b7bddfb9e36570682306" }
sui-package-resolver = { git = "https://github.com/MystenLabs/sui.git", rev = "fd1805c68e57484fcd14b7bddfb9e36570682306" }
sui-move-build = { git = "https://github.com/MystenLabs/sui.git", rev = "fd1805c68e57484fcd14b7bddfb9e36570682306" }
move-binary-format = { git = "https://github.com/MystenLabs/sui.git", rev = "fd1805c68e57484fcd14b7bddfb9e36570682306" }
sui-indexer-alt-framework = { git = "https://github.com/MystenLabs/sui.git", rev = "fd1805c68e57484fcd14b7bddfb9e36570682306" }
sui-rpc-api = { git = "https://github.com/MystenLabs/sui.git", rev = "fd1805c68e57484fcd14b7bddfb9e36570682306" }
sui-storage = { git = "https://github.com/MystenLabs/sui.git", rev = "fd1805c68e57484fcd14b7bddfb9e36570682306" }
sui-field-count = { git = "https://github.com/MystenLabs/sui.git", rev = "fd1805c68e57484fcd14b7bddfb9e36570682306"}

# New Rust SDK
sui-sdk-types = { git = "https://github.com/mystenlabs/sui-rust-sdk", package = "sui-sdk-types", rev="86a9e06"}
Expand Down
7 changes: 4 additions & 3 deletions crates/mvr-indexer/src/handlers/git_info_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl MoveObjectProcessor<TestnetGitInfo, GitInfo> for GitInfoHandler<TestnetGitI
}

#[async_trait]
impl<T: MoveStruct + DeserializeOwned> Handler for GitInfoHandler<T>
impl<T: MoveStruct + DeserializeOwned + Send + Sync + 'static> Handler for GitInfoHandler<T>
where
Self: MoveObjectProcessor<T, GitInfo>,
{
Expand Down Expand Up @@ -127,14 +127,15 @@ where
}
}

impl<T: MoveStruct + DeserializeOwned> Processor for GitInfoHandler<T>
#[async_trait]
impl<T: MoveStruct + DeserializeOwned + Send + Sync + 'static> Processor for GitInfoHandler<T>
where
Self: MoveObjectProcessor<T, GitInfo>,
{
const NAME: &'static str = Self::PROC_NAME;
type Value = GitInfo;

fn process(&self, checkpoint: &Arc<CheckpointData>) -> anyhow::Result<Vec<Self::Value>> {
async fn process(&self, checkpoint: &Arc<CheckpointData>) -> anyhow::Result<Vec<Self::Value>> {
checkpoint
.transactions
.iter()
Expand Down
3 changes: 2 additions & 1 deletion crates/mvr-indexer/src/handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ impl Handler for NoOpsHandler {
}
}

#[async_trait]
impl Processor for NoOpsHandler {
const NAME: &'static str = "No Ops Handler";
type Value = Package;

fn process(&self, checkpoint: &Arc<CheckpointData>) -> anyhow::Result<Vec<Self::Value>> {
async fn process(&self, checkpoint: &Arc<CheckpointData>) -> anyhow::Result<Vec<Self::Value>> {
info!(
"Processed checkpoint: {}",
checkpoint.checkpoint_summary.sequence_number
Expand Down
3 changes: 2 additions & 1 deletion crates/mvr-indexer/src/handlers/name_record_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ impl Handler for NameRecordHandler {
}
}

#[async_trait]
impl Processor for NameRecordHandler {
const NAME: &'static str = "NameRecord";
type Value = NameRecord;

fn process(&self, checkpoint: &Arc<CheckpointData>) -> anyhow::Result<Vec<Self::Value>> {
async fn process(&self, checkpoint: &Arc<CheckpointData>) -> anyhow::Result<Vec<Self::Value>> {
checkpoint
.transactions
.iter()
Expand Down
4 changes: 3 additions & 1 deletion crates/mvr-indexer/src/handlers/package_handler.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{MAINNET_CHAIN_ID, TESTNET_CHAIN_ID};
use async_trait::async_trait;
use chrono::DateTime;
use diesel_async::RunQueryDsl;
use itertools::Itertools;
Expand Down Expand Up @@ -53,6 +54,7 @@ impl<const MAINNET: bool> Handler for PackageHandler<MAINNET> {
}
}

#[async_trait]
impl<const MAINNET: bool> Processor for PackageHandler<MAINNET> {
const NAME: &'static str = if MAINNET {
"Package - Mainnet"
Expand All @@ -61,7 +63,7 @@ impl<const MAINNET: bool> Processor for PackageHandler<MAINNET> {
};
type Value = Package;

fn process(&self, checkpoint: &Arc<CheckpointData>) -> anyhow::Result<Vec<Self::Value>> {
async fn process(&self, checkpoint: &Arc<CheckpointData>) -> anyhow::Result<Vec<Self::Value>> {
let timestamp =
DateTime::from_timestamp_millis(checkpoint.checkpoint_summary.timestamp_ms as i64)
.unwrap()
Expand Down
7 changes: 4 additions & 3 deletions crates/mvr-indexer/src/handlers/package_info_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl MoveObjectProcessor<TestnetPkgInfo, PackageInfo> for PackageInfoHandler<Tes
}

#[async_trait]
impl<T: MoveStruct + DeserializeOwned> Handler for PackageInfoHandler<T>
impl<T: MoveStruct + DeserializeOwned + Send + Sync + 'static> Handler for PackageInfoHandler<T>
where
Self: MoveObjectProcessor<T, PackageInfo>,
{
Expand Down Expand Up @@ -144,14 +144,15 @@ where
}
}

impl<T: MoveStruct + DeserializeOwned> Processor for PackageInfoHandler<T>
#[async_trait]
impl<T: MoveStruct + DeserializeOwned + Send + Sync + 'static> Processor for PackageInfoHandler<T>
where
Self: MoveObjectProcessor<T, PackageInfo>,
{
const NAME: &'static str = Self::PROC_NAME;
type Value = PackageInfo;

fn process(&self, checkpoint: &Arc<CheckpointData>) -> anyhow::Result<Vec<Self::Value>> {
async fn process(&self, checkpoint: &Arc<CheckpointData>) -> anyhow::Result<Vec<Self::Value>> {
checkpoint.transactions.iter().try_fold(vec![], |result, tx| {
tx.output_objects.iter().try_fold(result, |mut result, obj| {
if matches!(obj.type_(), Some(t) if matches!(t.other(), Some(s) if s == &convert_struct_tag(T::struct_type())) ) {
Expand Down
Loading