Skip to content

Commit 905b947

Browse files
authored
refactor: remove zenith, prep to invert dep relationship (#89)
1 parent 747c725 commit 905b947

File tree

4 files changed

+1
-138
lines changed

4 files changed

+1
-138
lines changed

Cargo.toml

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "trevm"
3-
version = "0.19.11"
3+
version = "0.19.12"
44
rust-version = "1.83.0"
55
edition = "2021"
66
authors = ["init4"]
@@ -31,8 +31,6 @@ alloy = { version = "=0.11.1", default-features = false, features = ["consensus"
3131

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

34-
zenith-types = { version = "0.15" }
35-
3634
dashmap = { version = "6.1.0", optional = true }
3735
tracing = { version = "0.1.41", optional = true}
3836
thiserror = "2.0.11"

src/fill/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,3 @@ pub use noop::{NoopBlock, NoopCfg};
88

99
mod traits;
1010
pub use traits::{Block, Cfg, Tx};
11-
12-
mod zenith;

src/fill/zenith.rs

-95
This file was deleted.

src/journal/coder.rs

-38
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use std::{
1616
sync::Arc,
1717
vec::Vec,
1818
};
19-
use zenith_types::Zenith;
2019

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

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

4342
// Sizes
44-
const ZENITH_HEADER_BYTES: usize = 32 + 32 + 32 + 20 + 32;
4543
const ACCOUNT_INFO_BYTES: usize = 8 + 32 + 32;
4644
const INFO_OUTCOME_MIN_BYTES: usize = 1 + ACCOUNT_INFO_BYTES;
4745
const ACCT_DIFF_MIN_BYTES: usize = 4 + INFO_OUTCOME_MIN_BYTES;
@@ -413,22 +411,6 @@ impl JournalEncode for BundleState {
413411
}
414412
}
415413

416-
impl JournalEncode for Zenith::BlockHeader {
417-
fn serialized_size(&self) -> usize {
418-
ZENITH_HEADER_BYTES
419-
}
420-
421-
fn encode(&self, buf: &mut dyn BufMut) {
422-
let Self { rollupChainId, hostBlockNumber, gasLimit, rewardAddress, blockDataHash } = self;
423-
424-
rollupChainId.encode(buf);
425-
hostBlockNumber.encode(buf);
426-
gasLimit.encode(buf);
427-
rewardAddress.encode(buf);
428-
blockDataHash.encode(buf);
429-
}
430-
}
431-
432414
/// Trait for decoding journal types from a buffer.
433415
pub trait JournalDecode: JournalEncode + Sized + 'static {
434416
/// Decode the type from the buffer.
@@ -638,18 +620,6 @@ impl JournalDecode for BundleState {
638620
}
639621
}
640622

641-
impl JournalDecode for Zenith::BlockHeader {
642-
fn decode(buf: &mut &[u8]) -> Result<Self> {
643-
Ok(Self {
644-
rollupChainId: JournalDecode::decode(buf)?,
645-
hostBlockNumber: JournalDecode::decode(buf)?,
646-
gasLimit: JournalDecode::decode(buf)?,
647-
rewardAddress: JournalDecode::decode(buf)?,
648-
blockDataHash: JournalDecode::decode(buf)?,
649-
})
650-
}
651-
}
652-
653623
#[cfg(test)]
654624
mod test {
655625
use super::*;
@@ -748,13 +718,5 @@ mod test {
748718
.collect(),
749719
};
750720
roundtrip(&bsi);
751-
752-
roundtrip(&Zenith::BlockHeader {
753-
rollupChainId: U256::from(1),
754-
hostBlockNumber: U256::from(1),
755-
gasLimit: U256::from(1),
756-
rewardAddress: Address::repeat_byte(0xa),
757-
blockDataHash: B256::repeat_byte(0xa),
758-
});
759721
}
760722
}

0 commit comments

Comments
 (0)