-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
before
for now we use fixed n_tx
pub fn flush_with_nop(&mut self) {
let mut cnt = 0;
while self.buffered_txs.len() % self.n_tx != 0 {
self.nop();
cnt += 1;
}
log::debug!("flush with {} nop", cnt);
}
n_tx is params::NTXS
after
we should replace params::NTXS with params::TX_SLOT_NUM
for example,
TX_SLOT_NUM = [2, 16, 64, 512]
use
pub fn parse_env_to_collection<F, I>(name: &str) -> F
where
I: FromStr,
I::Err: std::fmt::Debug,
F: FromIterator<I>,
{
get_env(name)
.split(',')
.map(|p| p.parse::<I>().unwrap())
.collect()
}
and then sort them
compare one by one (basic idea, should use for loop or iter:
if self.buffered_txs.len() > 512 * 10 {
n_tx = 512
} else if self.buffered_txs.len() > 64 * 10 {
n_tx = 64
} else if self.buffered_txs.len() > 16 * 10 {
n_tx = 16
} ....
then flush_with_nop
also need the same logic to decide n_tx in pop_all_blocks
we should also record whether it's a large or medium or small block
I think we can record this info in pop_all_blocks's forge_with_txs?
so we add block_type (small, medium, large) in L2BlockDetail
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels