Skip to content

Commit 76579bf

Browse files
authored
Merge branch 'main' into fix/cip36-assets-indexing
2 parents dbad580 + 856164d commit 76579bf

File tree

45 files changed

+1233
-531
lines changed

Some content is hidden

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

45 files changed

+1233
-531
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
ci:
2020
uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@ci/v1.7.2
2121
with:
22-
forge_version: 0.14.0
22+
forge_version: 0.16.0
2323

2424
test_reporting:
2525
if: always()

.github/workflows/flutter-uikit-example-firebase-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Install Forge
2323
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.7.2
2424
with:
25-
version: 0.14.0
25+
version: 0.16.0
2626
- name: Setup CI
2727
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.7.2
2828
- name: Build Flutter Web

.github/workflows/generate-allure-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Install Forge
2929
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.7.2
3030
with:
31-
version: 0.14.0
31+
version: 0.16.0
3232
if: always()
3333

3434
- name: Setup CI

.github/workflows/nightly-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
ci_nightly:
2323
uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@ci/v1.7.2
2424
with:
25-
forge_version: 0.14.0
25+
forge_version: 0.16.0
2626
nightly: true
2727

2828
generate-test-reports:

catalyst-gateway/bin/Cargo.toml

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

1717
[dependencies]
18-
cardano-chain-follower = { version = "0.0.8", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250401-01" }
19-
rbac-registration = { version = "0.0.4", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250401-01" }
20-
catalyst-types = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250401-01" }
21-
cardano-blockchain-types = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250401-01" }
22-
catalyst-signed-doc = { version = "0.0.4", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250401-01" }
18+
cardano-chain-follower = { version = "0.0.8", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250406-00" }
19+
rbac-registration = { version = "0.0.4", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250406-00" }
20+
catalyst-types = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250406-00" }
21+
cardano-blockchain-types = { version = "0.0.3", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250406-00" }
22+
catalyst-signed-doc = { version = "0.0.4", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250406-00" }
2323

2424
pallas = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "9b5183c8b90b90fe2cc319d986e933e9518957b3" }
2525
pallas-traverse = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "9b5183c8b90b90fe2cc319d986e933e9518957b3" }

catalyst-gateway/bin/src/service/api/documents/get_document.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use super::templates::get_doc_static_template;
77
use crate::{
88
db::event::{error::NotFoundError, signed_docs::FullSignedDoc},
99
service::common::{responses::WithErrorResponses, types::payload::cbor::Cbor},
10+
settings::Settings,
1011
};
1112

1213
/// Endpoint responses.
@@ -71,4 +72,14 @@ impl catalyst_signed_doc::providers::CatalystSignedDocumentProvider for DocProvi
7172
Err(err) => Err(err),
7273
}
7374
}
75+
76+
fn future_threshold(&self) -> Option<std::time::Duration> {
77+
let signed_doc_cfg = Settings::signed_doc_cfg();
78+
Some(signed_doc_cfg.future_threshold())
79+
}
80+
81+
fn past_threshold(&self) -> Option<std::time::Duration> {
82+
let signed_doc_cfg = Settings::signed_doc_cfg();
83+
Some(signed_doc_cfg.past_threshold())
84+
}
7485
}

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ use crate::{
2323

2424
pub(crate) mod cassandra_db;
2525
pub(crate) mod chain_follower;
26+
pub(crate) mod signed_doc;
2627
mod str_env_var;
2728

2829
/// Default address to start service on, '0.0.0.0:3030'.
@@ -136,6 +137,9 @@ struct EnvVars {
136137
/// The Chain Follower configuration
137138
chain_follower: chain_follower::EnvVars,
138139

140+
/// The Catalyst Signed Documents configuration
141+
signed_doc: signed_doc::EnvVars,
142+
139143
/// Internal API Access API Key
140144
internal_api_key: Option<StringEnvVar>,
141145

@@ -211,6 +215,7 @@ static ENV_VARS: LazyLock<EnvVars> = LazyLock::new(|| {
211215
cassandra_db::VOLATILE_NAMESPACE_DEFAULT,
212216
),
213217
chain_follower: chain_follower::EnvVars::new(),
218+
signed_doc: signed_doc::EnvVars::new(),
214219
internal_api_key: StringEnvVar::new_optional("INTERNAL_API_KEY", true),
215220
check_config_tick: StringEnvVar::new_as_duration(
216221
"CHECK_CONFIG_TICK",
@@ -307,6 +312,11 @@ impl Settings {
307312
ENV_VARS.chain_follower.clone()
308313
}
309314

315+
/// Get the configuration of the Catalyst Signed Documents.
316+
pub(crate) fn signed_doc_cfg() -> signed_doc::EnvVars {
317+
ENV_VARS.signed_doc.clone()
318+
}
319+
310320
/// Chain Follower network (The Blockchain network we are configured to use).
311321
/// Note: Catalyst Gateway can ONLY follow one network at a time.
312322
pub(crate) fn cardano_network() -> Network {
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
//! Command line and environment variable settings for the Catalyst Signed Docs
2+
3+
use std::time::Duration;
4+
5+
use super::str_env_var::StringEnvVar;
6+
7+
/// Default number value of `future_threshold`, 30 seconds.
8+
const DEFAULT_FUTURE_THRESHOLD: Duration = Duration::from_secs(30);
9+
10+
/// Default number value of `past_threshold`, 10 minutes.
11+
const DEFAULT_PAST_THRESHOLD: Duration = Duration::from_secs(60 * 10);
12+
13+
/// Configuration for the Catalyst Signed Documents validation configuration.
14+
#[derive(Clone)]
15+
pub(crate) struct EnvVars {
16+
/// The Catalyst Signed Document threshold, document cannot be too far in the future.
17+
future_threshold: Duration,
18+
19+
/// The Catalyst Signed Document threshold, document cannot be too far behind.
20+
past_threshold: Duration,
21+
}
22+
23+
impl EnvVars {
24+
/// Create a config for Catalyst Signed Document validation configuration.
25+
pub(super) fn new() -> Self {
26+
let future_threshold =
27+
StringEnvVar::new_as_duration("SIGNED_DOC_FUTURE_THRESHOLD", DEFAULT_FUTURE_THRESHOLD);
28+
29+
let past_threshold =
30+
StringEnvVar::new_as_duration("SIGNED_DOC_PAST_THRESHOLD", DEFAULT_PAST_THRESHOLD);
31+
32+
Self {
33+
future_threshold,
34+
past_threshold,
35+
}
36+
}
37+
38+
/// The Catalyst Signed Document threshold, document cannot be too far in the future
39+
/// (in seconds).
40+
pub(crate) fn future_threshold(&self) -> Duration {
41+
self.future_threshold
42+
}
43+
44+
/// The Catalyst Signed Document threshold, document cannot be too far behind
45+
/// (in seconds).
46+
pub(crate) fn past_threshold(&self) -> Duration {
47+
self.past_threshold
48+
}
49+
}

0 commit comments

Comments
 (0)