diff --git a/examples/n2n-miniprotocols/src/main.rs b/examples/n2n-miniprotocols/src/main.rs index 2adf4d9..2f2bcfb 100644 --- a/examples/n2n-miniprotocols/src/main.rs +++ b/examples/n2n-miniprotocols/src/main.rs @@ -78,7 +78,7 @@ async fn do_chainsync( tracing::info!("epoch boundary"); None } - MultiEraHeader::AlonzoCompatible(_) | MultiEraHeader::Babbage(_) => { + MultiEraHeader::ShelleyCompatible(_) | MultiEraHeader::BabbageCompatible(_) => { if next_log.elapsed().as_secs() > 1 { tracing::info!("chainsync block header: {}", number); next_log = Instant::now(); diff --git a/pallas-network/src/facades.rs b/pallas-network/src/facades.rs index 6cdf37a..6d6aa6f 100644 --- a/pallas-network/src/facades.rs +++ b/pallas-network/src/facades.rs @@ -2,7 +2,7 @@ use std::net::SocketAddr; use std::path::Path; use std::time::Duration; use thiserror::Error; -use tracing::{debug, error, warn}; +use tracing::{debug, error}; use tokio::net::{TcpListener, ToSocketAddrs}; @@ -67,7 +67,7 @@ impl KeepAliveLoop { loop { interval.tick().await; - warn!("sending keepalive request"); + debug!("sending keepalive request"); client .keepalive_roundtrip() diff --git a/pallas-traverse/src/block.rs b/pallas-traverse/src/block.rs index 947533e..8204a6e 100644 --- a/pallas-traverse/src/block.rs +++ b/pallas-traverse/src/block.rs @@ -90,10 +90,10 @@ impl<'b> MultiEraBlock<'b> { } MultiEraBlock::Byron(x) => MultiEraHeader::Byron(Cow::Borrowed(&x.header)), MultiEraBlock::AlonzoCompatible(x, _) => { - MultiEraHeader::AlonzoCompatible(Cow::Borrowed(&x.header)) + MultiEraHeader::ShelleyCompatible(Cow::Borrowed(&x.header)) } - MultiEraBlock::Babbage(x) => MultiEraHeader::Babbage(Cow::Borrowed(&x.header)), - MultiEraBlock::Conway(x) => MultiEraHeader::Babbage(Cow::Borrowed(&x.header)), + MultiEraBlock::Babbage(x) => MultiEraHeader::BabbageCompatible(Cow::Borrowed(&x.header)), + MultiEraBlock::Conway(x) => MultiEraHeader::BabbageCompatible(Cow::Borrowed(&x.header)), } } diff --git a/pallas-traverse/src/header.rs b/pallas-traverse/src/header.rs index 0be5fbc..ddcb9b8 100644 --- a/pallas-traverse/src/header.rs +++ b/pallas-traverse/src/header.rs @@ -20,13 +20,13 @@ impl<'b> MultiEraHeader<'b> { Ok(MultiEraHeader::Byron(Cow::Owned(header))) } }, - 5 => { + 1..=4 => { let header = minicbor::decode(cbor).map_err(Error::invalid_cbor)?; - Ok(MultiEraHeader::Babbage(Cow::Owned(header))) + Ok(MultiEraHeader::ShelleyCompatible(Cow::Owned(header))) } _ => { let header = minicbor::decode(cbor).map_err(Error::invalid_cbor)?; - Ok(MultiEraHeader::AlonzoCompatible(Cow::Owned(header))) + Ok(MultiEraHeader::BabbageCompatible(Cow::Owned(header))) } } } @@ -34,8 +34,8 @@ impl<'b> MultiEraHeader<'b> { pub fn cbor(&self) -> &'b [u8] { match self { MultiEraHeader::EpochBoundary(x) => x.raw_cbor(), - MultiEraHeader::AlonzoCompatible(x) => x.raw_cbor(), - MultiEraHeader::Babbage(x) => x.raw_cbor(), + MultiEraHeader::ShelleyCompatible(x) => x.raw_cbor(), + MultiEraHeader::BabbageCompatible(x) => x.raw_cbor(), MultiEraHeader::Byron(x) => x.raw_cbor(), } } @@ -48,16 +48,16 @@ impl<'b> MultiEraHeader<'b> { .first() .cloned() .unwrap_or_default(), - MultiEraHeader::AlonzoCompatible(x) => x.header_body.block_number, - MultiEraHeader::Babbage(x) => x.header_body.block_number, + MultiEraHeader::ShelleyCompatible(x) => x.header_body.block_number, + MultiEraHeader::BabbageCompatible(x) => x.header_body.block_number, MultiEraHeader::Byron(x) => x.consensus_data.2.first().cloned().unwrap_or_default(), } } pub fn slot(&self) -> u64 { match self { - MultiEraHeader::AlonzoCompatible(x) => x.header_body.slot, - MultiEraHeader::Babbage(x) => x.header_body.slot, + MultiEraHeader::ShelleyCompatible(x) => x.header_body.slot, + MultiEraHeader::BabbageCompatible(x) => x.header_body.slot, MultiEraHeader::EpochBoundary(x) => { let genesis = GenesisValues::default(); genesis.relative_slot_to_absolute(x.consensus_data.epoch_id, 0) @@ -72,16 +72,16 @@ impl<'b> MultiEraHeader<'b> { pub fn hash(&self) -> Hash<32> { match self { MultiEraHeader::EpochBoundary(x) => x.original_hash(), - MultiEraHeader::AlonzoCompatible(x) => x.original_hash(), - MultiEraHeader::Babbage(x) => x.original_hash(), + MultiEraHeader::ShelleyCompatible(x) => x.original_hash(), + MultiEraHeader::BabbageCompatible(x) => x.original_hash(), MultiEraHeader::Byron(x) => x.original_hash(), } } pub fn previous_hash(&self) -> Option> { match self { - MultiEraHeader::AlonzoCompatible(x) => x.header_body.prev_hash, - MultiEraHeader::Babbage(x) => x.header_body.prev_hash, + MultiEraHeader::ShelleyCompatible(x) => x.header_body.prev_hash, + MultiEraHeader::BabbageCompatible(x) => x.header_body.prev_hash, MultiEraHeader::EpochBoundary(x) => Some(x.prev_block), MultiEraHeader::Byron(x) => Some(x.prev_block), } @@ -89,8 +89,8 @@ impl<'b> MultiEraHeader<'b> { pub fn vrf_vkey(&self) -> Option<&[u8]> { match self { - MultiEraHeader::AlonzoCompatible(x) => Some(x.header_body.vrf_vkey.as_ref()), - MultiEraHeader::Babbage(x) => Some(x.header_body.vrf_vkey.as_ref()), + MultiEraHeader::ShelleyCompatible(x) => Some(x.header_body.vrf_vkey.as_ref()), + MultiEraHeader::BabbageCompatible(x) => Some(x.header_body.vrf_vkey.as_ref()), MultiEraHeader::EpochBoundary(_) => None, MultiEraHeader::Byron(_) => None, } @@ -98,8 +98,8 @@ impl<'b> MultiEraHeader<'b> { pub fn issuer_vkey(&self) -> Option<&[u8]> { match self { - MultiEraHeader::AlonzoCompatible(x) => Some(x.header_body.issuer_vkey.as_ref()), - MultiEraHeader::Babbage(x) => Some(x.header_body.issuer_vkey.as_ref()), + MultiEraHeader::ShelleyCompatible(x) => Some(x.header_body.issuer_vkey.as_ref()), + MultiEraHeader::BabbageCompatible(x) => Some(x.header_body.issuer_vkey.as_ref()), MultiEraHeader::EpochBoundary(_) => None, MultiEraHeader::Byron(_) => None, } @@ -108,8 +108,8 @@ impl<'b> MultiEraHeader<'b> { pub fn leader_vrf_output(&self) -> Result, Error> { match self { MultiEraHeader::EpochBoundary(_) => Err(Error::InvalidEra(Era::Byron)), - MultiEraHeader::AlonzoCompatible(x) => Ok(x.header_body.leader_vrf.0.to_vec()), - MultiEraHeader::Babbage(x) => { + MultiEraHeader::ShelleyCompatible(x) => Ok(x.header_body.leader_vrf.0.to_vec()), + MultiEraHeader::BabbageCompatible(x) => { let mut leader_tagged_vrf: Vec = vec![0x4C_u8]; /* "L" */ leader_tagged_vrf.extend(&*x.header_body.vrf_result.0); Ok(Hasher::<256>::hash(&leader_tagged_vrf).to_vec()) @@ -121,8 +121,8 @@ impl<'b> MultiEraHeader<'b> { pub fn nonce_vrf_output(&self) -> Result, Error> { match self { MultiEraHeader::EpochBoundary(_) => Err(Error::InvalidEra(Era::Byron)), - MultiEraHeader::AlonzoCompatible(x) => Ok(x.header_body.nonce_vrf.0.to_vec()), - MultiEraHeader::Babbage(x) => { + MultiEraHeader::ShelleyCompatible(x) => Ok(x.header_body.nonce_vrf.0.to_vec()), + MultiEraHeader::BabbageCompatible(x) => { let mut nonce_tagged_vrf: Vec = vec![0x4E_u8]; /* "N" */ nonce_tagged_vrf.extend(&*x.header_body.vrf_result.0); Ok(Hasher::<256>::hash(&nonce_tagged_vrf).to_vec()) @@ -147,14 +147,14 @@ impl<'b> MultiEraHeader<'b> { pub fn as_alonzo(&self) -> Option<&alonzo::Header> { match self { - MultiEraHeader::AlonzoCompatible(x) => Some(x.deref().deref()), + MultiEraHeader::ShelleyCompatible(x) => Some(x.deref().deref()), _ => None, } } pub fn as_babbage(&self) -> Option<&babbage::Header> { match self { - MultiEraHeader::Babbage(x) => Some(x.deref().deref()), + MultiEraHeader::BabbageCompatible(x) => Some(x.deref().deref()), _ => None, } } diff --git a/pallas-traverse/src/lib.rs b/pallas-traverse/src/lib.rs index 6973df9..3a7fbcd 100644 --- a/pallas-traverse/src/lib.rs +++ b/pallas-traverse/src/lib.rs @@ -63,8 +63,8 @@ pub enum Feature { #[derive(Debug)] pub enum MultiEraHeader<'b> { EpochBoundary(Cow<'b, KeepRaw<'b, byron::EbbHead>>), - AlonzoCompatible(Cow<'b, KeepRaw<'b, alonzo::Header>>), - Babbage(Cow<'b, KeepRaw<'b, babbage::Header>>), + ShelleyCompatible(Cow<'b, KeepRaw<'b, alonzo::Header>>), + BabbageCompatible(Cow<'b, KeepRaw<'b, babbage::Header>>), Byron(Cow<'b, KeepRaw<'b, byron::BlockHead>>), }