Skip to content
Merged
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
29 changes: 1 addition & 28 deletions .github/workflows/run-tests-on-push-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,7 @@ jobs:
run: cargo fmt --all -- --check

- name: Run Clippy
run: |
cargo clippy --all-targets --all-features \
--package acropolis_common \
--package acropolis_codec \
--package acropolis_module_accounts_state \
--package acropolis_module_address_state \
--package acropolis_module_assets_state \
--package acropolis_module_block_unpacker \
--package acropolis_module_chain_store \
--package acropolis_module_consensus \
--package acropolis_module_drdd_state \
--package acropolis_module_drep_state \
--package acropolis_module_epochs_state \
--package acropolis_module_genesis_bootstrapper \
--package acropolis_module_governance_state \
--package acropolis_module_historical_accounts_state \
--package acropolis_module_mithril_snapshot_fetcher \
--package acropolis_module_parameters_state \
--package acropolis_module_rest_blockfrost \
--package acropolis_module_snapshot_bootstrapper \
--package acropolis_module_spdd_state \
--package acropolis_module_spo_state \
--package acropolis_module_stake_delta_filter \
--package acropolis_module_tx_submitter \
--package acropolis_module_tx_unpacker \
--package acropolis_module_upstream_chain_fetcher \
--package acropolis_module_utxo_state \
--package acropolis_process_tx_submitter_cli
run: cargo clippy --all-targets --all-features

- name: Run Build
run: cargo build --verbose
Expand Down
4 changes: 2 additions & 2 deletions processes/golden_tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ pub fn signal_test_completion() {
}
}

// Disabled test pending fix
// #[tokio::test]
#[tokio::test]
#[ignore = "Disabled test pending fix"]
async fn golden_test() -> Result<()> {
let config = Arc::new(
Config::builder()
Expand Down
18 changes: 6 additions & 12 deletions processes/golden_tests/src/test_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ pub struct TestModule;

impl TestModule {
pub async fn init(&self, context: Arc<Context<Message>>, config: Arc<Config>) -> Result<()> {
// temporarily forcing test to pass so CI looks happy :)
super::signal_test_completion();
return Ok(());

// TODO: we need to somehow get test data into the context so this module can unpack it all
// Currently just *assuming* it exists in the context as a string
let transactions_topic = config
Expand Down Expand Up @@ -87,14 +83,12 @@ impl TestModule {
return;
};

match message.as_ref() {
Message::Snapshot(SnapshotMessage::Dump(SnapshotStateMessage::SPOState(
spo_state,
))) => {
assert_eq!(&expected_final_state.spo_state, spo_state);
super::signal_test_completion();
}
_ => {}
if let Message::Snapshot(SnapshotMessage::Dump(SnapshotStateMessage::SPOState(
spo_state,
))) = message.as_ref()
{
assert_eq!(&expected_final_state.spo_state, spo_state);
super::signal_test_completion();
}
}
});
Expand Down
1 change: 0 additions & 1 deletion processes/omnibus/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use caryatid_process::Process;
use config::{Config, Environment, File};
use std::sync::Arc;
use tracing::info;
use tracing_subscriber;

// External modules
use acropolis_module_accounts_state::AccountsState;
Expand Down
34 changes: 16 additions & 18 deletions processes/replayer/src/recorder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,25 +110,23 @@ impl Recorder {
gov_recorder.write(&blk_g, CardanoMessage::GovernanceProcedures(gov_procs));
}

if blk_g.new_epoch {
if blk_g.epoch > 0 {
info!("Waiting drep...");
let (blk_drep, d_drep) = Self::read_drep(&mut drep_s).await?;
if blk_g != blk_drep {
error!("Governance {blk_g:?} and DRep distribution {blk_drep:?} are out of sync");
}

info!("Waiting spo...");
let (blk_spo, d_spo) = Self::read_spo(&mut spo_s).await?;
if blk_g != blk_spo {
error!(
"Governance {blk_g:?} and SPO distribution {blk_spo:?} are out of sync"
);
}

drep_recorder.write(&blk_g, CardanoMessage::DRepStakeDistribution(d_drep));
spo_recorder.write(&blk_g, CardanoMessage::SPOStakeDistribution(d_spo));
if blk_g.new_epoch && blk_g.epoch > 0 {
info!("Waiting drep...");
let (blk_drep, d_drep) = Self::read_drep(&mut drep_s).await?;
if blk_g != blk_drep {
error!(
"Governance {blk_g:?} and DRep distribution {blk_drep:?} are out of sync"
);
}

info!("Waiting spo...");
let (blk_spo, d_spo) = Self::read_spo(&mut spo_s).await?;
if blk_g != blk_spo {
error!("Governance {blk_g:?} and SPO distribution {blk_spo:?} are out of sync");
}

drep_recorder.write(&blk_g, CardanoMessage::DRepStakeDistribution(d_drep));
spo_recorder.write(&blk_g, CardanoMessage::SPOStakeDistribution(d_spo));
}
}
}
Expand Down
25 changes: 13 additions & 12 deletions processes/replayer/src/recorder_alonzo_governance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@ pub struct RecorderAlonzoGovernance;
#[derive(serde::Serialize, serde::Deserialize)]
struct ReplayerGenesisKeyhash(#[serde_as(as = "Base64")] GenesisKeyhash);

// key, vote
#[derive(serde::Serialize)]
struct VoteRecord(ReplayerGenesisKeyhash, Box<ProtocolParamUpdate>);

// slot, epoch, era (num), new_epoch, [enactment epoch, voting]
#[derive(serde::Serialize)]
struct BlockRecord(u64, u64, u8, u8, Vec<(u64, Vec<VoteRecord>)>);

struct BlockRecorder {
cfg: Arc<ReplayerConfig>,
prefix: String,
// slot, epoch, era (num), new_epoch, [enactment epoch, voting: [key, vote]]
list: Vec<(
u64,
u64,
u8,
u8,
Vec<(u64, Vec<(ReplayerGenesisKeyhash, Box<ProtocolParamUpdate>)>)>,
)>,
list: Vec<BlockRecord>,
}

impl BlockRecorder {
Expand All @@ -47,22 +48,22 @@ impl BlockRecorder {
}
}

pub fn write(&mut self, block: &BlockInfo, votes: &Vec<AlonzoBabbageUpdateProposal>) {
pub fn write(&mut self, block: &BlockInfo, votes: &[AlonzoBabbageUpdateProposal]) {
let file = format!("{}/{}.json", self.cfg.path, self.prefix);

let mut proposals = Vec::new();
for vote in votes.iter() {
let mut votes_indexed = Vec::new();
for (h, u) in &vote.proposals {
votes_indexed.push((ReplayerGenesisKeyhash(h.clone()), u.clone()));
votes_indexed.push(VoteRecord(ReplayerGenesisKeyhash(h.clone()), u.clone()));
}
proposals.push((vote.enactment_epoch, votes_indexed));
}

self.list.push((
self.list.push(BlockRecord(
block.slot,
block.epoch,
block.era.clone() as u8,
block.era as u8,
block.new_epoch as u8,
proposals,
));
Expand Down
Loading