Skip to content

Commit

Permalink
fix: apply missing pparams in update logic (#361)
Browse files Browse the repository at this point in the history
Co-authored-by: Clark Alesna <clark_alesna@hotmail.com>
Co-authored-by: johnquinnvictaboada <quinnvictaboada@gmail.com>
  • Loading branch information
3 people authored Oct 17, 2024
1 parent 5896488 commit 0e26238
Show file tree
Hide file tree
Showing 20 changed files with 1,588 additions and 139 deletions.
31 changes: 16 additions & 15 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ authors = ["Santiago Carmuega <santiago@carmuega.me>"]
[dependencies]
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
14 changes: 12 additions & 2 deletions src/bin/dolos/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use dolos::{state, wal};
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::conway::GenesisFile as ConwayFile;
use pallas::ledger::configs::shelley::GenesisFile as ShelleyFile;
use std::{path::PathBuf, time::Duration};
use tokio::task::JoinHandle;
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,16 @@ 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

0 comments on commit 0e26238

Please sign in to comment.