Skip to content

Commit

Permalink
Update aptos-protos to upstream branch 01-10-test_the_release (#91)
Browse files Browse the repository at this point in the history
* Update aptos-protos to 33540e35bd9a83e79c8ffff737ca119e7ec9f7da

* update the dependencies.

* fix.

* fix.

* fix.

---------

Co-authored-by: Aptos Bot <[email protected]>
Co-authored-by: Larry Liu <[email protected]>
  • Loading branch information
3 people authored Jan 13, 2025
1 parent 604787e commit a56b641
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 92 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/update-processor-sdk-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ name: Update Processor SDK Version
# Reason: if SDK version is not updated, no change will be picked up by processors.
- aptos-indexer-processors-sdk/Cargo.toml

permissions:
contents: read
id-token: write

jobs:
update-processor-sdk-version:
runs-on: ubuntu-latest
Expand All @@ -19,8 +23,21 @@ jobs:
contains(github.event.pull_request.labels.*.name, 'indexer-sdk-update')
)
steps:
- id: auth
uses: "google-github-actions/auth@v2"
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }}
- name: Get Secret Manager Secrets
id: secrets
uses: 'google-github-actions/get-secretmanager-secrets@v2'
with:
secrets: |-
token:aptos-ci/github-actions-repository-dispatch
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ steps.secrets.outputs.token }}
- name: Capture the commit hash
id: commit_hash
run: |
Expand All @@ -41,7 +58,7 @@ jobs:
- name: Dispatch Event to processors Repo
uses: peter-evans/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ steps.secrets.outputs.token }}
repository: 'aptos-labs/aptos-indexer-processors'
event-type: 'sdk-dependency-update'
client-payload: '{"commit_hash": "${{ github.sha }}", "branch_name": "${{ steps.commit_hash.outputs.branch_name }}", "aptos_protos_commit_hash": ${{ steps.aptos_protos_commit_hash.outputs.aptos_protos_commit_hash }}}'
113 changes: 30 additions & 83 deletions aptos-indexer-processors-sdk/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions aptos-indexer-processors-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ testing-framework = { path = "testing-framework" }

ahash = { version = "0.8.7", features = ["serde"] }
anyhow = "1.0.86"
aptos-protos = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "5c48aee129b5a141be2792ffa3d9bd0a1a61c9cb" }
aptos-protos = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "6116af69aa173ca49e1761daabd6fe103fe2c65e" }
aptos-system-utils = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "4541add3fd29826ec57f22658ca286d2d6134b93" }
async-trait = "0.1.80"
autometrics = { version = "1.0.1", features = ["prometheus-exporter"] }
Expand Down Expand Up @@ -78,7 +78,7 @@ once_cell = { version = "1.19.0" }
petgraph = "0.6.5"
prometheus = "0.13.3"
prometheus-client = "0.22.2"
prost = { version = "0.12.3", features = ["no-recursion-limit"] }
prost = { version = "0.13.4", features = ["no-recursion-limit"] }
rayon = "1.10.0"
serde = { version = "1.0.193", features = ["derive", "rc"] }
serde_json = { version = "1.0.81", features = ["preserve_order"] }
Expand All @@ -93,7 +93,7 @@ tracing = "0.1.34"
tokio = { version = "1.37.0", features = ["full"] }
tokio-retry = { version = "0.3.0" }
toml = "0.7.4"
tonic = { version = "0.11.0", features = [
tonic = { version = "0.12.3", features = [
"tls",
"tls-roots",
"transport",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub struct WriteRateLimitConfig {
pub num_seconds: u64,
}

#[allow(clippy::too_long_first_doc_paragraph)]
/// This step limits the number of bytes that can be written to the DB per second, based
/// on a config specifying the number of bytes that can be written in a given number of
/// seconds. See `WriteRateLimitConfig` for more.
Expand Down Expand Up @@ -145,6 +146,7 @@ impl<Input: Send + Sizeable + 'static> NamedStep for WriteRateLimitStep<Input> {
}
}

#[allow(clippy::too_long_first_doc_paragraph)]
/// To use an item with `WriteRateLimitStep`, it must implement `Sizeable`. The intent
/// of `WriteRateLimitStep` is to put an upper bound on the write load on the DB, so the
/// implementation of this trait should reflect the size of the data in terms of what it
Expand Down
2 changes: 1 addition & 1 deletion aptos-indexer-processors-sdk/sdk/src/utils/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn parse_timestamp(ts: &Timestamp, version: i64) -> chrono::DateTime<Utc> {
nanos: 0,
}
} else {
ts.clone()
*ts
};
chrono::DateTime::from_timestamp(final_ts.seconds, final_ts.nanos as u32)
.unwrap_or_else(|| panic!("Could not parse timestamp {:?} for version {}", ts, version))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,9 @@ impl TransactionStream {
self.reconnection_retries = 0;
let start_version = r.transactions.as_slice().first().unwrap().version;
let start_txn_timestamp =
r.transactions.as_slice().first().unwrap().timestamp.clone();
r.transactions.as_slice().first().unwrap().timestamp;
let end_version = r.transactions.as_slice().last().unwrap().version;
let end_txn_timestamp =
r.transactions.as_slice().last().unwrap().timestamp.clone();
let end_txn_timestamp = r.transactions.as_slice().last().unwrap().timestamp;

let size_in_bytes = r.encoded_len() as u64;
let chain_id: u64 = r
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use serde::{Deserialize, Serialize};
use std::{collections::HashMap, str::FromStr};
use tonic::metadata::{Ascii, MetadataKey, MetadataMap, MetadataValue};

#[allow(clippy::too_long_first_doc_paragraph)]
/// This struct holds additional headers that we attach to the request metadata.
/// Regarding serde, we just serialize this as we would a HashMap<String, String>.
/// Similarly, we expect that format when deserializing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub fn parse_timestamp(ts: &Timestamp, version: i64) -> chrono::DateTime<chrono:
nanos: 0,
}
} else {
ts.clone()
*ts
};
chrono::DateTime::from_timestamp(final_ts.seconds, final_ts.nanos as u32)
.unwrap_or_else(|| panic!("Could not parse timestamp {:?} for version {}", ts, version))
Expand Down

0 comments on commit a56b641

Please sign in to comment.