Skip to content

Commit 3a1e296

Browse files
committed
chore: remove state provider height
1 parent fa954c0 commit 3a1e296

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

crates/block-processor/src/alias.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,22 @@ pub trait AliasOracleFactory: Send + Sync + 'static {
5555
type Oracle: AliasOracle;
5656

5757
/// Create a new [`AliasOracle`].
58-
fn create(&self, block_height: u64) -> eyre::Result<Self::Oracle>;
58+
fn create(&self) -> eyre::Result<Self::Oracle>;
5959
}
6060

6161
impl AliasOracleFactory for Box<dyn StateProviderFactory> {
6262
type Oracle = Box<dyn StateProvider>;
6363

64-
fn create(&self, block_height: u64) -> eyre::Result<Self::Oracle> {
65-
self.state_by_block_number_or_tag(block_height.into()).map_err(Into::into)
64+
fn create(&self) -> eyre::Result<Self::Oracle> {
65+
self.state_by_block_number_or_tag(alloy::eips::BlockNumberOrTag::Latest).map_err(Into::into)
6666
}
6767
}
6868

6969
/// This implementation is primarily for testing purposes.
7070
impl AliasOracleFactory for HashSet<Address> {
7171
type Oracle = HashSet<Address>;
7272

73-
fn create(&self, _block_height: u64) -> eyre::Result<Self::Oracle> {
73+
fn create(&self) -> eyre::Result<Self::Oracle> {
7474
Ok(self.clone())
7575
}
7676
}
@@ -81,10 +81,10 @@ where
8181
{
8282
type Oracle = T::Oracle;
8383

84-
fn create(&self, block_height: u64) -> eyre::Result<Self::Oracle> {
84+
fn create(&self) -> eyre::Result<Self::Oracle> {
8585
let guard =
8686
self.lock().map_err(|_| eyre::eyre!("failed to lock AliasOracleFactory mutex"))?;
87-
guard.create(block_height)
87+
guard.create()
8888
}
8989
}
9090

@@ -94,7 +94,7 @@ where
9494
{
9595
type Oracle = T::Oracle;
9696

97-
fn create(&self, block_height: u64) -> eyre::Result<Self::Oracle> {
98-
self.as_ref().create(block_height)
97+
fn create(&self) -> eyre::Result<Self::Oracle> {
98+
self.as_ref().create()
9999
}
100100
}

crates/block-processor/src/v1/processor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ where
112112
}
113113

114114
/// Check if the given address should be aliased.
115-
fn should_alias(&self, address: Address, host_height: u64) -> eyre::Result<bool> {
116-
self.alias_oracle.create(host_height)?.should_alias(address)
115+
fn should_alias(&self, address: Address) -> eyre::Result<bool> {
116+
self.alias_oracle.create()?.should_alias(address)
117117
}
118118

119119
/// Called when the host chain has committed a block or set of blocks.
@@ -267,7 +267,7 @@ where
267267
let mut to_alias: HashSet<Address> = Default::default();
268268
for transact in block_extracts.transacts() {
269269
let addr = transact.host_sender();
270-
if !to_alias.contains(&addr) && self.should_alias(addr, host_height)? {
270+
if !to_alias.contains(&addr) && self.should_alias(addr)? {
271271
to_alias.insert(addr);
272272
}
273273
}

0 commit comments

Comments
 (0)