Skip to content
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0e92266
some fixes + diff data source
kpinter-iohk Nov 7, 2025
a5a545e
fixes
kpinter-iohk Nov 10, 2025
1123111
add block caching
kpinter-iohk Nov 12, 2025
9f129e1
remove diff sources
kpinter-iohk Nov 12, 2025
64ebe1b
fix docstrings
kpinter-iohk Nov 12, 2025
477da44
address comments
kpinter-iohk Nov 13, 2025
1441b3a
better errors
kpinter-iohk Nov 13, 2025
edaa6ec
upgrade to dolos rc2
kpinter-iohk Nov 13, 2025
7570d44
formatting
kpinter-iohk Nov 13, 2025
7b29bcd
fix
kpinter-iohk Nov 14, 2025
3e3d7f9
api cleanup
kpinter-iohk Nov 14, 2025
5beac89
fixes
kpinter-iohk Nov 6, 2025
0f28a5a
stake distribution dolos data source
kpinter-iohk Nov 5, 2025
a37bb82
wip
kpinter-iohk Nov 14, 2025
31284fb
WIP fix compiler errors
jankun4 Nov 19, 2025
a1d7609
Merge remote-tracking branch 'origin/dolos-data-source-bridge-jankun'…
ladamesny Nov 19, 2025
b94fdbd
ETCM-12351: Implement governed-map data source
ladamesny Nov 21, 2025
9754ae6
ETCM-12351: clean up for stake distribution
ladamesny Nov 21, 2025
ae2bcd7
ETCM-12351: optimize asset utxo dolos query
ladamesny Nov 21, 2025
872256b
tests: fix closing parens and types
ladamesny Nov 24, 2025
90bada8
ETCM-12351: Refactor Dolos data sources: manual asset filtering and i…
ladamesny Nov 24, 2025
e3b5957
ETCM-12351: fix dolos data source code
ladamesny Nov 25, 2025
9608e5a
Merge master into ETCM-12351-dolos-governed-map-data-source
ladamesny Nov 26, 2025
8509df2
ETCM-12351: apply option to set dolos to local env
ladamesny Nov 26, 2025
bff4f35
ETCM-12351: improve error handling on dolos data sourcce
ladamesny Dec 1, 2025
5933299
Mrge branch 'master' of github.com:input-output-hk/partner-chains int…
ladamesny Dec 1, 2025
eda4777
ETCM-12351: rename variable
ladamesny Dec 2, 2025
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
3 changes: 3 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ fork-tree = { version = "13.0.1" }
ureq = { version = "3.1.2", default-features = false }
url = { version = "2.5.7", default-features = false }
blockfrost-openapi = { version = "0.1.75", default-features = false }
chrono = { version = "0.4.31", default-features = false }

# substrate dependencies
frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2509" }
Expand Down
34 changes: 11 additions & 23 deletions demo/node/src/data_sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,11 @@ pub fn create_mock_data_sources()

// TODO Currently uses db-sync for unimplemented Dolos data sources
pub async fn create_dolos_data_sources(
metrics_opt: Option<McFollowerMetrics>,
_metrics_opt: Option<McFollowerMetrics>,
) -> std::result::Result<DataSources, Box<dyn Error + Send + Sync + 'static>> {
let dolos_client = partner_chains_dolos_data_sources::get_connection_from_env()?;
let pool = partner_chains_db_sync_data_sources::get_connection_from_env().await?;
let block = Arc::new(
partner_chains_db_sync_data_sources::BlockDataSourceImpl::new_from_env(pool.clone())
let block_dolos = Arc::new(
partner_chains_dolos_data_sources::BlockDataSourceImpl::new_from_env(dolos_client.clone())
.await?,
);
Ok(DataSources {
Expand All @@ -118,37 +117,26 @@ pub async fn create_dolos_data_sources(
),
),
mc_hash: Arc::new(partner_chains_dolos_data_sources::McHashDataSourceImpl::new(
dolos_client.clone(),
block_dolos.clone(),
)),
authority_selection: Arc::new(
partner_chains_dolos_data_sources::AuthoritySelectionDataSourceImpl::new(
dolos_client.clone(),
),
),
block_participation: Arc::new(
partner_chains_db_sync_data_sources::StakeDistributionDataSourceImpl::new(
pool.clone(),
metrics_opt.clone(),
STAKE_CACHE_SIZE,
partner_chains_dolos_data_sources::StakeDistributionDataSourceImpl::new(
dolos_client.clone(),
),
),
governed_map: Arc::new(
partner_chains_db_sync_data_sources::GovernedMapDataSourceCachedImpl::new(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still see 2 datasources coming from dbsync here, StakeDistributionDataSourceImpl and CachedTokenBridgeDataSourceImpl

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, this is intentional.

At the beginning of this, we had dbsync based data sources (multiple).
To implement the dolos data sources, I copied the dbsync based data sources, and started replacing them one by one. This is necessary as we can't implement all 5-6 data sources all at once.
There is a transitional period, while the dolos data sources use a mixture of dolos and dbsync. We go through each source in the dolos data sources, and we rewrite the dbsync ones to use dolos.

Note, that all of this is in addition to the dbsync data source, which is kept as is.
Again, in addition to the dbsync data sources we created the dolos ones, which use pieces of the dbsync implementation as stand-in, until they are implemented one by one and replaced. This is needed because there is a lot of code and we don't want to do it all in one PR.

pool.clone(),
metrics_opt.clone(),
GOVERNED_MAP_CACHE_SIZE,
block.clone(),
)
.await?,
),
bridge: Arc::new(
partner_chains_db_sync_data_sources::CachedTokenBridgeDataSourceImpl::new(
pool,
metrics_opt,
block,
BRIDGE_TRANSFER_CACHE_LOOKAHEAD,
partner_chains_dolos_data_sources::GovernedMapDataSourceImpl::new(
dolos_client.clone(),
),
),
bridge: Arc::new(partner_chains_dolos_data_sources::TokenBridgeDataSourceImpl::new(
dolos_client,
)),
})
}

Expand Down
2 changes: 1 addition & 1 deletion dev/local-environment/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
PARTNER_CHAINS_NODE_IMAGE="ghcr.io/input-output-hk/partner-chains/partner-chains-node-unstable:latest"
CARDANO_IMAGE="ghcr.io/intersectmbo/cardano-node:10.5.1"
DBSYNC_IMAGE="ghcr.io/intersectmbo/cardano-db-sync:13.6.0.5"
DOLOS_IMAGE="ghcr.io/txpipe/dolos:1.0.0-beta.8"
DOLOS_IMAGE="ghcr.io/txpipe/dolos:1.0.0-rc.2"
OGMIOS_IMAGE="cardanosolutions/ogmios:v6.13.0"
POSTGRES_IMAGE="postgres:17.2"
TESTS_IMAGE="python:3.12-slim"
Expand Down
2 changes: 1 addition & 1 deletion toolkit/data-sources/db-sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sqlx = { workspace = true }
db-sync-sqlx = { workspace = true }
tokio = { workspace = true, features = ["full"] }
futures = { workspace = true }
chrono = "0.4.31"
chrono = { workspace = true }
hex = { workspace = true }
hex-literal = { workspace = true }
itertools = { workspace = true }
Expand Down
3 changes: 3 additions & 0 deletions toolkit/data-sources/db-sync/src/candidates/cached.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub type ArcMut<T> = Arc<Mutex<T>>;

type AriadneParametersCacheKey = (McEpochNumber, PolicyId, PolicyId);
type CandidatesCacheKey = (McEpochNumber, String);
/// Cached candidate data source
pub struct CandidateDataSourceCached {
inner: CandidatesDataSourceImpl,
get_ariadne_parameters_for_epoch_cache:
Expand Down Expand Up @@ -96,6 +97,7 @@ impl CandidateDataSourceCacheConfig {
}

impl CandidateDataSourceCached {
/// Creates new instance of the data source
pub fn new(
inner: CandidatesDataSourceImpl,
candidates_for_epoch_cache_size: usize,
Expand All @@ -114,6 +116,7 @@ impl CandidateDataSourceCached {
}
}

/// Creates a new instance of the data source, reading configuration from the environment.
pub fn new_from_env(
inner: CandidatesDataSourceImpl,
candidates_for_epoch_cache_size: usize,
Expand Down
2 changes: 1 addition & 1 deletion toolkit/data-sources/db-sync/src/candidates/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use sqlx::PgPool;
use std::collections::HashMap;
use std::error::Error;

mod cached;
pub mod cached;

#[cfg(test)]
mod tests;
Expand Down
2 changes: 1 addition & 1 deletion toolkit/data-sources/db-sync/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub use crate::block::{BlockDataSourceImpl, DbSyncBlockDataSourceConfig};
#[cfg(feature = "bridge")]
pub use crate::bridge::{TokenBridgeDataSourceImpl, cache::CachedTokenBridgeDataSourceImpl};
#[cfg(feature = "candidate-source")]
pub use crate::candidates::CandidatesDataSourceImpl;
pub use crate::candidates::{CandidatesDataSourceImpl, cached::CandidateDataSourceCached};
#[cfg(feature = "governed-map")]
pub use crate::governed_map::{GovernedMapDataSourceCachedImpl, GovernedMapDataSourceImpl};
#[cfg(feature = "mc-hash")]
Expand Down
3 changes: 3 additions & 0 deletions toolkit/data-sources/dolos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ cardano-serialization-lib = { workspace = true }
itertools = { workspace = true }
figment = { workspace = true }
tokio = { workspace = true }
derive-new = { workspace = true }
chrono = { workspace = true }
bech32 = { workspace = true }

[features]
default = []
Expand Down
Loading