@@ -8,7 +8,11 @@ use std::{
88use anyhow:: { anyhow, bail, Result } ;
99use serde:: { Deserialize , Serialize } ;
1010
11- use crate :: { clock:: Timestamp , model:: TransactionId , probability:: FloatDistribution } ;
11+ use crate :: {
12+ clock:: Timestamp ,
13+ model:: { Transaction , TransactionId } ,
14+ probability:: FloatDistribution ,
15+ } ;
1216
1317#[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
1418pub struct NodeId ( usize ) ;
@@ -141,6 +145,7 @@ pub enum LeiosVariant {
141145 Short ,
142146 Full ,
143147 FullWithoutIbs ,
148+ FullWithTxReferences ,
144149}
145150
146151#[ derive( Debug , Copy , Clone , Deserialize , PartialEq , Eq ) ]
@@ -338,6 +343,7 @@ impl CpuTimeConfig {
338343
339344#[ derive( Debug , Clone ) ]
340345pub ( crate ) struct BlockSizeConfig {
346+ variant : LeiosVariant ,
341347 pub block_header : u64 ,
342348 cert_constant : u64 ,
343349 cert_per_node : u64 ,
@@ -351,6 +357,7 @@ pub(crate) struct BlockSizeConfig {
351357impl BlockSizeConfig {
352358 fn new ( params : & RawParameters ) -> Self {
353359 Self {
360+ variant : params. leios_variant ,
354361 block_header : params. rb_head_size_bytes ,
355362 cert_constant : params. cert_size_bytes_constant ,
356363 cert_per_node : params. cert_size_bytes_per_node ,
@@ -366,6 +373,13 @@ impl BlockSizeConfig {
366373 self . cert_constant + self . cert_per_node * nodes as u64
367374 }
368375
376+ pub fn ib_payload ( & self , txs : & [ Arc < Transaction > ] ) -> u64 {
377+ match self . variant {
378+ LeiosVariant :: FullWithTxReferences => txs. len ( ) as u64 * self . eb_per_ib ,
379+ _ => txs. iter ( ) . map ( |tx| tx. bytes ) . sum ( ) ,
380+ }
381+ }
382+
369383 pub fn eb ( & self , txs : usize , ibs : usize , ebs : usize ) -> u64 {
370384 self . eb_constant + self . eb_per_ib * ( txs + ibs + ebs) as u64
371385 }
0 commit comments