Skip to content

refactor: remove zenith, prep to invert dep relationship #89

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

Merged
merged 1 commit into from
Mar 11, 2025
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
4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "trevm"
version = "0.19.11"
version = "0.19.12"
rust-version = "1.83.0"
edition = "2021"
authors = ["init4"]
Expand Down Expand Up @@ -31,8 +31,6 @@ alloy = { version = "=0.11.1", default-features = false, features = ["consensus"

revm = { version = "19.5.0", default-features = false, features = ["std"] }

zenith-types = { version = "0.15" }

dashmap = { version = "6.1.0", optional = true }
tracing = { version = "0.1.41", optional = true}
thiserror = "2.0.11"
Expand Down
2 changes: 0 additions & 2 deletions src/fill/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ pub use noop::{NoopBlock, NoopCfg};

mod traits;
pub use traits::{Block, Cfg, Tx};

mod zenith;
95 changes: 0 additions & 95 deletions src/fill/zenith.rs

This file was deleted.

38 changes: 0 additions & 38 deletions src/journal/coder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use std::{
sync::Arc,
vec::Vec,
};
use zenith_types::Zenith;

type Result<T, E = JournalDecodeError> = core::result::Result<T, E>;

Expand All @@ -41,7 +40,6 @@ const TAG_OPTION_NONE: u8 = 0;
const TAG_OPTION_SOME: u8 = 1;

// Sizes
const ZENITH_HEADER_BYTES: usize = 32 + 32 + 32 + 20 + 32;
const ACCOUNT_INFO_BYTES: usize = 8 + 32 + 32;
const INFO_OUTCOME_MIN_BYTES: usize = 1 + ACCOUNT_INFO_BYTES;
const ACCT_DIFF_MIN_BYTES: usize = 4 + INFO_OUTCOME_MIN_BYTES;
Expand Down Expand Up @@ -413,22 +411,6 @@ impl JournalEncode for BundleState {
}
}

impl JournalEncode for Zenith::BlockHeader {
fn serialized_size(&self) -> usize {
ZENITH_HEADER_BYTES
}

fn encode(&self, buf: &mut dyn BufMut) {
let Self { rollupChainId, hostBlockNumber, gasLimit, rewardAddress, blockDataHash } = self;

rollupChainId.encode(buf);
hostBlockNumber.encode(buf);
gasLimit.encode(buf);
rewardAddress.encode(buf);
blockDataHash.encode(buf);
}
}

/// Trait for decoding journal types from a buffer.
pub trait JournalDecode: JournalEncode + Sized + 'static {
/// Decode the type from the buffer.
Expand Down Expand Up @@ -638,18 +620,6 @@ impl JournalDecode for BundleState {
}
}

impl JournalDecode for Zenith::BlockHeader {
fn decode(buf: &mut &[u8]) -> Result<Self> {
Ok(Self {
rollupChainId: JournalDecode::decode(buf)?,
hostBlockNumber: JournalDecode::decode(buf)?,
gasLimit: JournalDecode::decode(buf)?,
rewardAddress: JournalDecode::decode(buf)?,
blockDataHash: JournalDecode::decode(buf)?,
})
}
}

#[cfg(test)]
mod test {
use super::*;
Expand Down Expand Up @@ -748,13 +718,5 @@ mod test {
.collect(),
};
roundtrip(&bsi);

roundtrip(&Zenith::BlockHeader {
rollupChainId: U256::from(1),
hostBlockNumber: U256::from(1),
gasLimit: U256::from(1),
rewardAddress: Address::repeat_byte(0xa),
blockDataHash: B256::repeat_byte(0xa),
});
}
}
Loading