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

fix: apply missing pparams in update logic #361

Merged
merged 17 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
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,11 +2,12 @@
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;
use tokio_util::sync::CancellationToken;
use tracing::{debug, warn};

Check warning on line 10 in src/bin/dolos/common.rs

View workflow job for this annotation

GitHub Actions / Check (windows-latest, stable)

unused import: `warn`
use tracing_subscriber::{filter::Targets, prelude::*};

use dolos::prelude::*;
Expand Down Expand Up @@ -99,7 +100,7 @@
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 @@
.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