From 60721382f181e22045cddbc8567f489726e00d50 Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xkitsune@protonmail.com> Date: Mon, 21 Oct 2024 14:59:47 -0400 Subject: [PATCH] remove todos --- world-chain-builder/src/node/test_utils.rs | 11 +++++------ world-chain-builder/src/payload/builder.rs | 2 -- world-chain-builder/src/pbh/date_marker.rs | 3 +-- world-chain-builder/src/pbh/db.rs | 10 ++++------ world-chain-builder/src/pbh/external_nullifier.rs | 9 +++------ world-chain-builder/src/pool/builder.rs | 15 +++++---------- 6 files changed, 18 insertions(+), 32 deletions(-) diff --git a/world-chain-builder/src/node/test_utils.rs b/world-chain-builder/src/node/test_utils.rs index 6b501f44..f9c3075d 100644 --- a/world-chain-builder/src/node/test_utils.rs +++ b/world-chain-builder/src/node/test_utils.rs @@ -1,9 +1,3 @@ -use std::{ - ops::{RangeBounds, RangeInclusive}, - path::PathBuf, - sync::Arc, -}; - use alloy_eips::{BlockHashOrNumber, BlockId, BlockNumberOrTag}; use alloy_primitives::{ map::{HashMap, HashSet}, @@ -40,6 +34,11 @@ use reth_trie::{ updates::TrieUpdates, AccountProof, HashedPostState, HashedStorage, MultiProof, TrieInput, }; use revm::primitives::{BlockEnv, CfgEnvWithHandlerCfg}; +use std::{ + ops::{RangeBounds, RangeInclusive}, + path::PathBuf, + sync::Arc, +}; use tokio::sync::{broadcast, watch}; use crate::pool::{ diff --git a/world-chain-builder/src/payload/builder.rs b/world-chain-builder/src/payload/builder.rs index ee753303..2814bf5f 100644 --- a/world-chain-builder/src/payload/builder.rs +++ b/world-chain-builder/src/payload/builder.rs @@ -53,7 +53,6 @@ pub struct WorldChainPayloadBuilder { inner: OptimismPayloadBuilder, /// The percentage of the blockspace that should be reserved for verified transactions verified_blockspace_capacity: u8, - // TODO: NOTE: we need to insert the verified txs into the table after they are inserted into the block pbh_db: Arc, } @@ -147,7 +146,6 @@ where #[derive(Debug)] pub struct WorldChainPayloadServiceBuilder { - // TODO: handle this field pub compute_pending_block: bool, pub verified_blockspace_capacity: u8, pub pbh_db: Arc, diff --git a/world-chain-builder/src/pbh/date_marker.rs b/world-chain-builder/src/pbh/date_marker.rs index 11763fa7..b8fe643b 100644 --- a/world-chain-builder/src/pbh/date_marker.rs +++ b/world-chain-builder/src/pbh/date_marker.rs @@ -1,6 +1,5 @@ -use std::str::FromStr; - use chrono::{Datelike, NaiveDate}; +use std::str::FromStr; use thiserror::Error; #[derive(Debug, Clone, Copy, PartialEq, Eq)] diff --git a/world-chain-builder/src/pbh/db.rs b/world-chain-builder/src/pbh/db.rs index 1a5fc88e..71d514f2 100644 --- a/world-chain-builder/src/pbh/db.rs +++ b/world-chain-builder/src/pbh/db.rs @@ -1,21 +1,19 @@ -use std::path::Path; -use std::sync::Arc; - use alloy_primitives::TxHash; use bytes::BufMut; +use reth_db::cursor::DbCursorRW; use reth_db::mdbx::tx::Tx; use reth_db::mdbx::{DatabaseArguments, DatabaseFlags, RW}; use reth_db::{create_db, DatabaseError}; +use std::path::Path; +use std::sync::Arc; // TODO: maybe think about some sort of data retention policy for PBH transactions. use reth_db::table::{Compress, Decompress, Table}; +use reth_db::transaction::DbTxMut; use revm_primitives::{FixedBytes, B256}; use semaphore::Field; use serde::{Deserialize, Serialize}; use tracing::info; -use reth_db::cursor::DbCursorRW; -use reth_db::transaction::DbTxMut; - /// Table to store PBH validated transactions along with their nullifiers. /// /// When a trasnaction is validated before being inserted into the pool, diff --git a/world-chain-builder/src/pbh/external_nullifier.rs b/world-chain-builder/src/pbh/external_nullifier.rs index 272d0625..1ee22c0a 100644 --- a/world-chain-builder/src/pbh/external_nullifier.rs +++ b/world-chain-builder/src/pbh/external_nullifier.rs @@ -1,12 +1,9 @@ -use std::str::FromStr; - -use semaphore::{hash_to_field, Field}; -use thiserror::Error; - use crate::pbh::date_marker::{DateMarker, DateMarkerParsingError}; - +use semaphore::{hash_to_field, Field}; +use std::str::FromStr; use strum::EnumString; use strum_macros::Display; +use thiserror::Error; #[derive(Display, EnumString, Debug, Clone, Copy, PartialEq, Eq)] #[strum(serialize_all = "snake_case")] diff --git a/world-chain-builder/src/pool/builder.rs b/world-chain-builder/src/pool/builder.rs index 603a1bbe..b3fc6593 100644 --- a/world-chain-builder/src/pool/builder.rs +++ b/world-chain-builder/src/pool/builder.rs @@ -1,5 +1,7 @@ -use std::sync::Arc; - +use super::validator::WorldChainTransactionPool; +use crate::pool::ordering::WorldChainOrdering; +use crate::pool::root::WorldChainRootValidator; +use crate::pool::validator::WorldChainTransactionValidator; use reth::builder::components::PoolBuilder; use reth::builder::{BuilderContext, FullNodeTypes, NodeTypes}; use reth::transaction_pool::blobstore::DiskFileBlobStore; @@ -8,16 +10,9 @@ use reth_db::DatabaseEnv; use reth_optimism_chainspec::OpChainSpec; use reth_optimism_node::txpool::OpTransactionValidator; use reth_provider::CanonStateSubscriptions; +use std::sync::Arc; use tracing::{debug, info}; -use crate::pool::ordering::WorldChainOrdering; -use crate::pool::root::WorldChainRootValidator; -use crate::pool::validator::WorldChainTransactionValidator; - -use super::validator::WorldChainTransactionPool; - -// use crate::txpool::{WorldChainTransactionPool, WorldChainTransactionValidator}; - /// A basic World Chain transaction pool. /// /// This contains various settings that can be configured and take precedence over the node's