Skip to content

Commit

Permalink
chore: use alloy primitives map (#586)
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell authored Sep 30, 2024
1 parent 391da87 commit 5223b9a
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 28 deletions.
46 changes: 27 additions & 19 deletions 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ kona-primitives = { path = "crates/primitives", version = "0.0.2", default-featu
anyhow = { version = "1.0.89", default-features = false }
thiserror = { git = "https://github.com/quartiq/thiserror", branch = "no-std", default-features = false }
cfg-if = "1.0.0"
hashbrown = "0.14.5"
spin = { version = "0.9.8", features = ["mutex"] }
lru = "0.12.4"
async-trait = "0.1.82"
Expand Down
3 changes: 1 addition & 2 deletions crates/derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ workspace = true
alloy-eips.workspace = true
alloy-rlp = { workspace = true, features = ["derive"] }
alloy-consensus = { workspace = true, features = ["k256"] }
alloy-primitives = { workspace = true, features = ["rlp", "k256"] }
alloy-primitives = { workspace = true, features = ["rlp", "k256", "map"] }
alloy-rpc-types-engine.workspace = true
op-alloy-consensus = { workspace = true, features = ["k256"] }
op-alloy-protocol.workspace = true
op-alloy-genesis.workspace = true
op-alloy-rpc-types-engine.workspace = true

# General
hashbrown.workspace = true
unsigned-varint.workspace = true
miniz_oxide.workspace = true
brotli.workspace = true
Expand Down
5 changes: 2 additions & 3 deletions crates/derive/src/stages/channel_bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ use crate::{
traits::{OriginAdvancer, OriginProvider, ResettableStage},
};
use alloc::{boxed::Box, collections::VecDeque, sync::Arc};
use alloy_primitives::{hex, Bytes};
use alloy_primitives::{hex, map::HashMap, Bytes};
use async_trait::async_trait;
use core::fmt::Debug;
use hashbrown::HashMap;
use op_alloy_genesis::{RollupConfig, SystemConfig};
use op_alloy_protocol::{BlockInfo, Channel, ChannelId, Frame};
use tracing::{trace, warn};
Expand Down Expand Up @@ -139,7 +138,7 @@ where
{
// For each channel, get the number of frames and record it in the CHANNEL_FRAME_COUNT
// histogram metric.
for (_, channel) in &self.channels {
for channel in self.channels.values() {
crate::observe!(CHANNEL_FRAME_COUNT, channel.len() as f64);
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/derive/src/stages/test_utils/sys_config_fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

use crate::{block::OpBlock, traits::L2ChainProvider};
use alloc::{boxed::Box, sync::Arc};
use alloy_primitives::map::HashMap;
use anyhow::Result;
use async_trait::async_trait;
use hashbrown::HashMap;
use op_alloy_genesis::{RollupConfig, SystemConfig};
use op_alloy_protocol::L2BlockInfo;

Expand Down
3 changes: 1 addition & 2 deletions crates/derive/src/traits/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ use crate::{
use alloc::{boxed::Box, sync::Arc, vec, vec::Vec};
use alloy_consensus::{Header, Receipt, TxEnvelope};
use alloy_eips::eip4844::Blob;
use alloy_primitives::{Address, Bytes, B256};
use alloy_primitives::{map::HashMap, Address, Bytes, B256};
use anyhow::Result;
use async_trait::async_trait;
use core::fmt::Debug;
use hashbrown::HashMap;
use kona_primitives::IndexedBlobHash;
use op_alloy_genesis::{RollupConfig, SystemConfig};
use op_alloy_protocol::{BlockInfo, L2BlockInfo};
Expand Down

0 comments on commit 5223b9a

Please sign in to comment.