Skip to content

Commit f3670e0

Browse files
committed
Merge branch 'main' into feat/sync-with-gateway-v2-endpoints-3362
# Conflicts: # catalyst_voices/Earthfile
2 parents 48e1d74 + 3075105 commit f3670e0

File tree

199 files changed

+2398
-1932
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+2398
-1932
lines changed

.config/dictionaries/project.dic

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ headful
151151
headlessui
152152
healthz
153153
HIDPI
154+
hotfixes
154155
hotspots
155156
httpx
156157
icudtl
@@ -310,8 +311,8 @@ ripgrep
310311
ristretto
311312
rlib
312313
rngs
313-
rolname
314314
rollouts
315+
rolname
315316
RPATH
316317
ruleset
317318
rustc
@@ -428,4 +429,4 @@ xprv
428429
xpub
429430
xpublic
430431
xvfb
431-
yoroi
432+
yoroi

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ permissions:
1818

1919
jobs:
2020
paths-filter:
21-
if: ${{ github.event.pull_request }}
2221
runs-on: ubuntu-latest
2322
outputs:
2423
catalyst-gateway: ${{ steps.filter.outputs.catalyst-gateway }}
2524
catalyst-voices: ${{ steps.filter.outputs.catalyst-voices }}
2625
docs: ${{ steps.filter.outputs.docs }}
2726
not-only-docs: ${{ steps.filter.outputs.not-only-docs }}
2827
steps:
28+
- uses: actions/checkout@v4
2929
- uses: dorny/paths-filter@v3
3030
id: filter
3131
with:
@@ -67,7 +67,7 @@ jobs:
6767
forge_version: 0.21.0
6868

6969
ci:
70-
if: ${{ !github.event.pull_request.draft && needs.paths-filter.outputs.not-only-docs == 'true' }}
70+
if: ${{ (!github.event.pull_request.draft && needs.paths-filter.outputs.not-only-docs == 'true') || startsWith(github.ref, 'refs/tags/') }}
7171
needs: [reject, paths-filter]
7272
uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@ci/v1.10.0
7373
with:

Earthfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.5.28 AS mdlint-ci
4-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.5.28 AS cspell-ci
5-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.5.28 AS postgresql-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.6.1 AS mdlint-ci
4+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.6.1 AS cspell-ci
5+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.6.1 AS postgresql-ci
66

77
ARG --global REGISTRY="harbor.shared-services.projectcatalyst.io/dockerhub/library"
88
FROM ${REGISTRY}/debian:stable-slim

catalyst-gateway/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[workspace]
2-
resolver = "2"
2+
resolver = "3"
33
members = [
44
"bin",
55
]
66

77
[workspace.package]
8-
edition = "2021"
8+
edition = "2024"
99
version = "0.0.1"
1010
authors = [
1111
"Steven Johnson <[email protected]>"

catalyst-gateway/Earthfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.5.28 AS rust-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.6.1 AS rust-ci
44
IMPORT ../ AS repo-ci
55
IMPORT github.com/input-output-hk/catalyst-voices/catalyst-gateway:main AS cat-gateway-main
66

catalyst-gateway/bin/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ repository.workspace = true
1515
workspace = true
1616

1717
[dependencies]
18-
cardano-chain-follower = { version = "0.0.17", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "cardano-chain-follower/v0.0.17" }
19-
rbac-registration = { version = "0.0.13", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "rbac-registration/v0.0.13" }
20-
catalyst-signed-doc = { version = "0.0.9", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "catalyst-signed-doc/v0.0.9" }
18+
cardano-chain-follower = { version = "0.0.18", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "cardano-chain-follower/v0.0.18" }
19+
rbac-registration = { version = "0.0.14", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "rbac-registration/v0.0.14" }
20+
catalyst-signed-doc = { version = "0.0.10", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "catalyst-signed-doc/v0.0.10" }
2121
catalyst-signed-doc-v1 = { package = "catalyst-signed-doc", version = "0.0.4", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "catalyst-signed-doc/v.0.0.4" }
2222
c509-certificate = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "c509-certificate-v0.0.3" }
23-
catalyst-types = { version = "0.0.9", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "catalyst-types/v0.0.9" }
23+
catalyst-types = { version = "0.0.10", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "catalyst-types/v0.0.10" }
2424

2525
clap = { version = "4.5.20", features = ["derive", "env"] }
2626
tracing = { version = "0.1.40", features = ["log"] }

catalyst-gateway/bin/src/build_info.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ pub(crate) fn log_build_info() {
4848
let mut branch = "Unknown".to_string();
4949
let mut tags = "Unknown".to_string();
5050

51-
if let Some(ref vc) = info.version_control {
52-
if let Some(git) = vc.git() {
53-
commit_id.clone_from(&git.commit_short_id);
54-
commit_timestamp = git.commit_timestamp.to_rfc3339();
55-
if let Some(git_branch) = git.branch.clone() {
56-
branch = git_branch;
57-
}
58-
tags = git.tags.join(",");
51+
if let Some(ref vc) = info.version_control
52+
&& let Some(git) = vc.git()
53+
{
54+
commit_id.clone_from(&git.commit_short_id);
55+
commit_timestamp = git.commit_timestamp.to_rfc3339();
56+
if let Some(git_branch) = git.branch.clone() {
57+
branch = git_branch;
5958
}
59+
tags = git.tags.join(",");
6060
}
6161

6262
let ipv4 = utilities::net::get_public_ipv4().to_string();
@@ -65,15 +65,15 @@ pub(crate) fn log_build_info() {
6565
let mut interfaces: String = "Unknown".to_string();
6666

6767
// Get local IP address v4 and v6
68-
if let Ok(network_interfaces) = list_afinet_netifas() {
69-
if !network_interfaces.is_empty() {
70-
interfaces.clear();
71-
for iface in network_interfaces {
72-
if !interfaces.is_empty() {
73-
interfaces.push(',');
74-
}
75-
let _ = write!(interfaces, "{}:{}", iface.0, iface.1);
68+
if let Ok(network_interfaces) = list_afinet_netifas()
69+
&& !network_interfaces.is_empty()
70+
{
71+
interfaces.clear();
72+
for iface in network_interfaces {
73+
if !interfaces.is_empty() {
74+
interfaces.push(',');
7675
}
76+
let _ = write!(interfaces, "{}:{}", iface.0, iface.1);
7777
}
7878
}
7979

catalyst-gateway/bin/src/cardano/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::{collections::BTreeSet, fmt::Display, sync::Arc, time::Duration};
44

55
use cardano_chain_follower::{ChainFollower, ChainSyncConfig, MultiEraBlock, Network, Point, Slot};
66
use duration_string::DurationString;
7-
use futures::{stream::FuturesUnordered, StreamExt};
7+
use futures::{StreamExt, stream::FuturesUnordered};
88
use rand::{Rng, SeedableRng};
99
use tokio::sync::watch;
1010
use tracing::{debug, error, info};
@@ -16,7 +16,7 @@ use crate::{
1616
roll_forward::{self, PurgeCondition},
1717
},
1818
queries::sync_status::{
19-
get::{get_sync_status, SyncStatus},
19+
get::{SyncStatus, get_sync_status},
2020
update::update_sync_status,
2121
},
2222
session::CassandraSession,
@@ -25,7 +25,7 @@ use crate::{
2525
service::utilities::health::{
2626
set_follower_immutable_first_reached_tip, set_follower_live_first_reached_tip,
2727
},
28-
settings::{chain_follower, Settings},
28+
settings::{Settings, chain_follower},
2929
};
3030

3131
/// How long we wait between checks for connection to the indexing DB to be ready.

catalyst-gateway/bin/src/db/event/common/eq_or_ranged_uuid.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! `EqOrRangedUuid` query conditional stmt object.
22
3-
/// Search either by a singe UUID, or a Range of UUIDs
3+
/// Search either by a singe UUID, a range of UUIDs or a list of UUIDs.
44
#[derive(Clone, Debug, PartialEq)]
5-
pub(crate) enum EqOrRangedUuid {
5+
pub(crate) enum UuidSelector {
66
/// Search by the exact UUID
77
Eq(uuid::Uuid),
88
/// Search in this UUID's range
@@ -12,9 +12,11 @@ pub(crate) enum EqOrRangedUuid {
1212
/// Maximum UUID to find (inclusive)
1313
max: uuid::Uuid,
1414
},
15+
/// Search UUIDs in the given list.
16+
In(Vec<uuid::Uuid>),
1517
}
1618

17-
impl EqOrRangedUuid {
19+
impl UuidSelector {
1820
/// Return a sql conditional statement by the provided `table_field`
1921
pub(crate) fn conditional_stmt(
2022
&self,
@@ -25,6 +27,13 @@ impl EqOrRangedUuid {
2527
Self::Range { min, max } => {
2628
format!("{table_field} >= '{min}' AND {table_field} <= '{max}'")
2729
},
30+
Self::In(ids) => {
31+
itertools::intersperse(
32+
ids.iter().map(|id| format!("{table_field} = '{id}'")),
33+
" OR ".to_string(),
34+
)
35+
.collect()
36+
},
2837
}
2938
}
3039
}

catalyst-gateway/bin/src/db/event/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
use std::{
33
str::FromStr,
44
sync::{
5-
atomic::{AtomicBool, Ordering},
65
Arc, LazyLock, Mutex, OnceLock,
6+
atomic::{AtomicBool, Ordering},
77
},
88
time::Duration,
99
};
1010

1111
use error::NotFoundError;
1212
use futures::{Stream, StreamExt, TryStreamExt};
1313
use tokio::task::JoinHandle;
14-
use tokio_postgres::{types::ToSql, Row};
15-
use tracing::{debug, debug_span, error, info, Instrument};
14+
use tokio_postgres::{Row, types::ToSql};
15+
use tracing::{Instrument, debug, debug_span, error, info};
1616

1717
use crate::{
1818
service::utilities::health::{event_db_is_live, set_event_db_liveness},
@@ -58,8 +58,8 @@ pub(crate) enum EventDBConnectionError {
5858

5959
impl EventDB {
6060
/// Get a connection from the pool.
61-
async fn get_pool_connection(
62-
) -> Result<deadpool::managed::Object<deadpool_postgres::Manager>, EventDBConnectionError> {
61+
async fn get_pool_connection()
62+
-> Result<deadpool::managed::Object<deadpool_postgres::Manager>, EventDBConnectionError> {
6363
let pool = EVENT_DB_POOL
6464
.get()
6565
.ok_or(EventDBConnectionError::DbPoolUninitialized)?;
@@ -127,7 +127,7 @@ impl EventDB {
127127
pub(crate) async fn query_stream(
128128
stmt: &str,
129129
params: &[&(dyn ToSql + Sync)],
130-
) -> anyhow::Result<impl Stream<Item = anyhow::Result<Row>>> {
130+
) -> anyhow::Result<impl Stream<Item = anyhow::Result<Row>> + use<>> {
131131
if Self::is_deep_query_enabled() {
132132
Self::explain_analyze_rollback(stmt, params).await?;
133133
}

0 commit comments

Comments
 (0)