Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
checksum

fmt & clippy

fix util import

 #![feature(build_hasher_simple_hash_one)]

clear comments

fmt
  • Loading branch information
CeciliaZ030 committed Jan 27, 2024
1 parent 039d219 commit 92fa6be
Show file tree
Hide file tree
Showing 22 changed files with 25 additions and 42 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions guests/eth-block/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions guests/op-block/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions guests/op-derive/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion host/src/bin/op-derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
// --cache \
// --op-block-no=109279674 \
// --op-blocks=6

use std::path::{Path, PathBuf};

use anyhow::{Context, Result};
Expand Down
1 change: 0 additions & 1 deletion host/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

extern crate core;

use std::{
Expand Down
2 changes: 1 addition & 1 deletion host/src/util/mpt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub fn is_not_included(key: &[u8], proof_nodes: &[MptNode]) -> Result<bool> {
// for valid proofs, the get must not fail
let value = proof_trie
.get(key)
.map_err(|e| Into::<anyhow::Error>::into(e))
.map_err(Into::<anyhow::Error>::into)
.context("invalid trie")?;

Ok(value.is_none())
Expand Down
6 changes: 3 additions & 3 deletions lib/src/builder/execute/ethereum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ impl TxExecStrategy<EthereumTxEssence> for EthTxExecStrategy {
let trie_key = tx_no.to_rlp();
tx_trie
.insert_rlp(&trie_key, tx)
.map_err(|e| Into::<anyhow::Error>::into(e))
.map_err(Into::<anyhow::Error>::into)
.context("failed to insert transaction")?;
receipt_trie
.insert_rlp(&trie_key, receipt)
.map_err(|e| Into::<anyhow::Error>::into(e))
.map_err(Into::<anyhow::Error>::into)
.context("failed to insert receipt")?;

// update account states
Expand Down Expand Up @@ -225,7 +225,7 @@ impl TxExecStrategy<EthereumTxEssence> for EthTxExecStrategy {
// Add withdrawal to trie
withdrawals_trie
.insert_rlp(&i.to_rlp(), withdrawal)
.map_err(|e| Into::<anyhow::Error>::into(e))
.map_err(Into::<anyhow::Error>::into)
.context("failed to insert withdrawal")?;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/src/builder/execute/optimism.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ impl TxExecStrategy<OptimismTxEssence> for OpTxExecStrategy {
let trie_key = tx_no.to_rlp();
tx_trie
.insert_rlp(&trie_key, tx)
.map_err(|e| Into::<anyhow::Error>::into(e))
.map_err(Into::<anyhow::Error>::into)
.context("failed to insert transaction")?;
receipt_trie
.insert_rlp(&trie_key, receipt)
.map_err(|e| Into::<anyhow::Error>::into(e))
.map_err(Into::<anyhow::Error>::into)
.context("failed to insert receipt")?;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use alloc::vec::Vec;
use alloc::{vec, vec::Vec};

use hashbrown::HashMap;
use serde::{Deserialize, Serialize};
Expand Down
4 changes: 0 additions & 4 deletions lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,10 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#![cfg_attr(not(feature = "std"), no_std)]
extern crate alloc;
extern crate core;

// #[cfg(any(not(target_os = "zkvm"), not(feature = "std")))]
// pub mod host;

pub mod builder;
pub mod consts;
pub mod input;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/optimism/batcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
// limitations under the License.

use alloc::{
collections::{BinaryHeap, VecDeque, BTreeMap},
collections::{BTreeMap, VecDeque},
vec::Vec,
};
use core::cmp::{Ordering, Reverse};
use core::cmp::Ordering;

use anyhow::{bail, ensure, Context, Result};
use zeth_primitives::{
Expand Down
7 changes: 4 additions & 3 deletions lib/src/optimism/batcher_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// use std::io::Read;

use alloc::{
format,
collections::{BTreeMap, VecDeque},
format, vec,
vec::Vec,
};

Expand Down Expand Up @@ -314,6 +314,7 @@ impl Channel {
let mut channel_data = decompressed.as_slice();
while !channel_data.is_empty() {
let batch = Batch::decode(&mut channel_data)
.map_err(|e| anyhow!(AlloyRlpError::from(e)))
.with_context(|| format!("failed to decode batch {}", batches.len()))?;

batches.push(BatchWithInclusion {
Expand Down Expand Up @@ -584,10 +585,10 @@ mod tests {
let mut channel = new_channel();
channel.add_frame(frame_a).unwrap();
assert_eq!(channel.size, 209);
assert_eq!(channel.is_ready(), false);
assert!(!channel.is_ready());
channel.add_frame(frame_b).unwrap();
assert_eq!(channel.size, 420);
assert_eq!(channel.is_ready(), true);
assert!(channel.is_ready());
assert_eq!(channel.decompress().unwrap(), b"Hello World!");
}
}
Expand Down
2 changes: 0 additions & 2 deletions primitives/src/access_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// #[cfg(not(feature = "std"))]
// use crate::no_std_preflight::*;

extern crate alloc;
extern crate core;
Expand Down
2 changes: 1 addition & 1 deletion primitives/src/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub use core::{
result::{Result, Result::*},
};

use alloy_primitives::{BlockNumber, Bytes, B256};
use alloy_primitives::{Bytes, B256};
use alloy_rlp::{Decodable, Encodable};
use alloy_rlp_derive::{RlpDecodable, RlpEncodable};
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 0 additions & 2 deletions primitives/src/ethers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
// limitations under the License.

//! Convert from Ethers types.
// #[cfg(not(feature = "std"))]
// use crate::no_std_preflight::*;

extern crate alloc;
extern crate core;
Expand Down
2 changes: 0 additions & 2 deletions primitives/src/receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// #[cfg(not(feature = "std"))]
// use crate::no_std_preflight::*;

extern crate alloc;
extern crate core;
Expand Down
2 changes: 0 additions & 2 deletions primitives/src/revm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
// limitations under the License.

//! Convert to revm types.
// #[cfg(not(feature = "std"))]
// use crate::no_std_preflight::*;

extern crate alloc;
extern crate core;
Expand Down
2 changes: 0 additions & 2 deletions primitives/src/transactions/ethereum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// #[cfg(not(feature = "std"))]
// use crate::no_std_preflight::*;

extern crate alloc;
extern crate core;
Expand Down
2 changes: 0 additions & 2 deletions primitives/src/trie/mpt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// use crate::no_std_preflight::*;

extern crate alloc;
extern crate core;

Expand Down
2 changes: 1 addition & 1 deletion testing/ef-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use anyhow::bail;
use hashbrown::HashMap;
use serde::{Deserialize, Serialize};
use serde_with::{serde_as, NoneAsEmptyString};
use zeth::util::{
use util::{
preflight::Data,
provider::{AccountQuery, BlockQuery, ProofQuery, Provider, StorageQuery},
provider_db::ProviderDb,
Expand Down
4 changes: 2 additions & 2 deletions testing/ef-tests/testguest/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 92fa6be

Please sign in to comment.