Skip to content

Commit

Permalink
Disable bloom filter checks
Browse files Browse the repository at this point in the history
  • Loading branch information
intoverflow committed Nov 21, 2023
1 parent 41d88a7 commit 4a90227
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
8 changes: 5 additions & 3 deletions host/src/bin/op-derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,12 @@ async fn main() -> Result<()> {

let (mut mem_db, output_1) = tokio::task::spawn_blocking(move || {
let mut rpc_db = RpcDb::new(args.eth_rpc_url, args.op_rpc_url, args.cache);
let batches = derive(&mut rpc_db, args.block_no, args.blocks).unwrap();
(rpc_db.get_mem_db(), batches)
let batches =
derive(&mut rpc_db, args.block_no, args.blocks).context("could not derive")?;
let out: Result<_> = Ok((rpc_db.get_mem_db(), batches));
out
})
.await?;
.await??;

let output_2 = derive(&mut mem_db, args.block_no, args.blocks).unwrap();
assert_eq!(output_1, output_2);
Expand Down
20 changes: 18 additions & 2 deletions lib/src/optimism/batches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,24 @@ where

// check timestamp range
match batch.essence.timestamp.cmp(&next_timestamp) {
Ordering::Greater => return BatchStatus::Future,
Ordering::Less => return BatchStatus::Drop,
Ordering::Greater => {
#[cfg(not(target_os = "zkvm"))]
log::warn!(
"Future batch: {} = batch.essence.timestamp > next_timestamp = {}",
&batch.essence.timestamp,
&next_timestamp
);
return BatchStatus::Future;
}
Ordering::Less => {
#[cfg(not(target_os = "zkvm"))]
log::warn!(
"Drop batch: {} = batch.essence.timestamp < next_timestamp = {}",
&batch.essence.timestamp,
&next_timestamp
);
return BatchStatus::Drop;
}
Ordering::Equal => (),
}

Expand Down
2 changes: 2 additions & 0 deletions lib/src/optimism/deposits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ pub fn extract_transactions(

/// Returns whether the given Bloom filter can contain a deposit log.
pub fn can_contain(address: &Address, bloom: &Bloom) -> bool {

Check failure on line 86 in lib/src/optimism/deposits.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] lib/src/optimism/deposits.rs#L86

error: unused variable: `address` --> lib/src/optimism/deposits.rs:86:20 | 86 | pub fn can_contain(address: &Address, bloom: &Bloom) -> bool { | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_address` | = note: `-D unused-variables` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unused_variables)]`
Raw output
lib/src/optimism/deposits.rs:86:20:e:error: unused variable: `address`
  --> lib/src/optimism/deposits.rs:86:20
   |
86 | pub fn can_contain(address: &Address, bloom: &Bloom) -> bool {
   |                    ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_address`
   |
   = note: `-D unused-variables` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(unused_variables)]`


__END__

Check failure on line 86 in lib/src/optimism/deposits.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] lib/src/optimism/deposits.rs#L86

error: unused variable: `bloom` --> lib/src/optimism/deposits.rs:86:39 | 86 | pub fn can_contain(address: &Address, bloom: &Bloom) -> bool { | ^^^^^ help: if this is intentional, prefix it with an underscore: `_bloom`
Raw output
lib/src/optimism/deposits.rs:86:39:e:error: unused variable: `bloom`
  --> lib/src/optimism/deposits.rs:86:39
   |
86 | pub fn can_contain(address: &Address, bloom: &Bloom) -> bool {
   |                                       ^^^^^ help: if this is intentional, prefix it with an underscore: `_bloom`


__END__
return true; // TODO: remove me!

let input = BloomInput::Raw(address.as_slice());

Check failure on line 89 in lib/src/optimism/deposits.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] lib/src/optimism/deposits.rs#L89

error: unreachable statement --> lib/src/optimism/deposits.rs:89:5 | 87 | return true; // TODO: remove me! | ----------- any code following this expression is unreachable 88 | 89 | let input = BloomInput::Raw(address.as_slice()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement | = note: `-D unreachable-code` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unreachable_code)]`
Raw output
lib/src/optimism/deposits.rs:89:5:e:error: unreachable statement
  --> lib/src/optimism/deposits.rs:89:5
   |
87 |     return true; // TODO: remove me!
   |     ----------- any code following this expression is unreachable
88 |
89 |     let input = BloomInput::Raw(address.as_slice());
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
   |
   = note: `-D unreachable-code` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(unreachable_code)]`


__END__
if !bloom.contains_input(input) {
return false;
Expand Down
2 changes: 2 additions & 0 deletions lib/src/optimism/system_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ impl SystemConfig {

/// Returns whether the given Bloom filter can contain a config update log.
pub fn can_contain(address: &Address, bloom: &Bloom) -> bool {

Check failure on line 139 in lib/src/optimism/system_config.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] lib/src/optimism/system_config.rs#L139

error: unused variable: `address` --> lib/src/optimism/system_config.rs:139:20 | 139 | pub fn can_contain(address: &Address, bloom: &Bloom) -> bool { | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_address`
Raw output
lib/src/optimism/system_config.rs:139:20:e:error: unused variable: `address`
   --> lib/src/optimism/system_config.rs:139:20
    |
139 | pub fn can_contain(address: &Address, bloom: &Bloom) -> bool {
    |                    ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_address`


__END__

Check failure on line 139 in lib/src/optimism/system_config.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] lib/src/optimism/system_config.rs#L139

error: unused variable: `bloom` --> lib/src/optimism/system_config.rs:139:39 | 139 | pub fn can_contain(address: &Address, bloom: &Bloom) -> bool { | ^^^^^ help: if this is intentional, prefix it with an underscore: `_bloom`
Raw output
lib/src/optimism/system_config.rs:139:39:e:error: unused variable: `bloom`
   --> lib/src/optimism/system_config.rs:139:39
    |
139 | pub fn can_contain(address: &Address, bloom: &Bloom) -> bool {
    |                                       ^^^^^ help: if this is intentional, prefix it with an underscore: `_bloom`


__END__
return true; // TODO: remove me!

let input = BloomInput::Raw(address.as_slice());

Check failure on line 142 in lib/src/optimism/system_config.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] lib/src/optimism/system_config.rs#L142

error: unreachable statement --> lib/src/optimism/system_config.rs:142:5 | 140 | return true; // TODO: remove me! | ----------- any code following this expression is unreachable 141 | 142 | let input = BloomInput::Raw(address.as_slice()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
Raw output
lib/src/optimism/system_config.rs:142:5:e:error: unreachable statement
   --> lib/src/optimism/system_config.rs:142:5
    |
140 |     return true; // TODO: remove me!
    |     ----------- any code following this expression is unreachable
141 |
142 |     let input = BloomInput::Raw(address.as_slice());
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement


__END__
if !bloom.contains_input(input) {
return false;
Expand Down

0 comments on commit 4a90227

Please sign in to comment.