Skip to content

Commit

Permalink
remove todos
Browse files Browse the repository at this point in the history
  • Loading branch information
0xKitsune committed Oct 21, 2024
1 parent 0c294e0 commit 6072138
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 32 deletions.
11 changes: 5 additions & 6 deletions world-chain-builder/src/node/test_utils.rs
Original file line number Diff line number Diff line change
@@ -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},
Expand Down Expand Up @@ -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::{
Expand Down
2 changes: 0 additions & 2 deletions world-chain-builder/src/payload/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ pub struct WorldChainPayloadBuilder<EvmConfig> {
inner: OptimismPayloadBuilder<EvmConfig>,
/// 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<DatabaseEnv>,
}

Expand Down Expand Up @@ -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<DatabaseEnv>,
Expand Down
3 changes: 1 addition & 2 deletions world-chain-builder/src/pbh/date_marker.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
10 changes: 4 additions & 6 deletions world-chain-builder/src/pbh/db.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
9 changes: 3 additions & 6 deletions world-chain-builder/src/pbh/external_nullifier.rs
Original file line number Diff line number Diff line change
@@ -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")]
Expand Down
15 changes: 5 additions & 10 deletions world-chain-builder/src/pool/builder.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
Expand Down

0 comments on commit 6072138

Please sign in to comment.