Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: improved Conway genesis and protocol params support #360

Closed
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
6 changes: 3 additions & 3 deletions Cargo.lock

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

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ authors = ["Santiago Carmuega <[email protected]>"]


[dependencies]
pallas = { git = "https://github.com/txpipe/pallas.git", features = ["hardano", "applying"] }
# pallas = { git = "https://github.com/txpipe/pallas.git", features = ["hardano", "applying"] }
# pallas = { version = "^0.30.1", features = ["hardano", "applying"] }
# pallas = { path = "../pallas/pallas", features = ["hardano", "applying"] }
pallas = { path = "../pallas/pallas", features = ["hardano", "applying"] }

gasket = { git = "https://github.com/construkts/gasket-rs.git", features = ["derive"] }
# gasket = { version = "^0.8", features = ["derive"] }
Expand Down Expand Up @@ -62,6 +62,7 @@ console-subscriber = { version = "0.3.0", optional = true }
flate2 = "1.0.33"
tar = "0.4.41"
reqwest = { version = "0.12.7", features = ["blocking"] }
paste = "1.0.15"
tower-http = { version = "0.6.1", features = ["cors"] }

[dev-dependencies]
Expand Down
9 changes: 7 additions & 2 deletions src/bin/dolos/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use miette::{Context as _, IntoDiagnostic};
use pallas::ledger::configs::alonzo::GenesisFile as AlonzoFile;
use pallas::ledger::configs::byron::GenesisFile as ByronFile;
use pallas::ledger::configs::shelley::GenesisFile as ShelleyFile;
use pallas::ledger::configs::conway::GenesisFile as ConwayFile;
use std::{path::PathBuf, time::Duration};
use tokio::task::JoinHandle;
use tokio_util::sync::CancellationToken;
Expand Down Expand Up @@ -99,7 +100,7 @@ pub fn setup_tracing(config: &LoggingConfig) -> miette::Result<()> {
Ok(())
}

pub type GenesisFiles = (ByronFile, ShelleyFile, AlonzoFile);
pub type GenesisFiles = (ByronFile, ShelleyFile, AlonzoFile, ConwayFile);

pub fn open_genesis_files(config: &GenesisConfig) -> miette::Result<GenesisFiles> {
let byron_genesis = pallas::ledger::configs::byron::from_file(&config.byron_path)
Expand All @@ -114,7 +115,11 @@ pub fn open_genesis_files(config: &GenesisConfig) -> miette::Result<GenesisFiles
.into_diagnostic()
.context("loading alonzo genesis config")?;

Ok((byron_genesis, shelley_genesis, alonzo_genesis))
let conway_genesis = pallas::ledger::configs::conway::from_file(&config.conway_path)
.into_diagnostic()
.context("loading conway genesis config")?;

Ok((byron_genesis, shelley_genesis, alonzo_genesis, conway_genesis))
}

#[inline]
Expand Down
6 changes: 3 additions & 3 deletions src/bin/dolos/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub async fn run(config: super::Config, _args: &Args) -> miette::Result<()> {
crate::common::setup_tracing(&config.logging)?;

let (wal, ledger) = crate::common::open_data_stores(&config)?;
let (byron, shelley, _) = crate::common::open_genesis_files(&config.genesis)?;
let (byron, shelley, _, _) = crate::common::open_genesis_files(&config.genesis)?;
let mempool = dolos::mempool::Mempool::new();
let exit = crate::common::hook_exit_token();

Expand All @@ -32,10 +32,10 @@ pub async fn run(config: super::Config, _args: &Args) -> miette::Result<()> {
// that benefits

// We need new file handled for the separate process.
let (byron, shelley, alonzo) = crate::common::open_genesis_files(&config.genesis)?;
let (byron, shelley, alonzo, conway) = crate::common::open_genesis_files(&config.genesis)?;
let serve = tokio::spawn(dolos::serve::serve(
config.serve,
(alonzo, byron, shelley),
(alonzo, byron, shelley, conway),
wal.clone(),
ledger.clone(),
mempool.clone(),
Expand Down
2 changes: 1 addition & 1 deletion src/bin/dolos/doctor/rebuild_ledger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub fn run(config: &crate::Config, _args: &Args, feedback: &Feedback) -> miette:
let progress = feedback.slot_progress_bar();
progress.set_message("rebuilding ledger");

let (byron, shelley, _) = crate::common::open_genesis_files(&config.genesis)?;
let (byron, shelley, _, _) = crate::common::open_genesis_files(&config.genesis)?;

let wal = crate::common::open_wal(config).context("opening WAL store")?;

Expand Down
3 changes: 2 additions & 1 deletion src/bin/dolos/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn run(config: &super::Config, args: &Args) -> miette::Result<()> {
.into_diagnostic()
.context("resolving utxo")?;

let (byron, shelley, alonzo) = crate::common::open_genesis_files(&config.genesis)?;
let (byron, shelley, alonzo, conway) = crate::common::open_genesis_files(&config.genesis)?;

let mut utxos2 = UTxOs::new();

Expand Down Expand Up @@ -92,6 +92,7 @@ pub fn run(config: &super::Config, args: &Args) -> miette::Result<()> {
byron: &byron,
shelley: &shelley,
alonzo: &alonzo,
conway: &conway
},
&updates,
args.epoch,
Expand Down
Loading
Loading