miden-objects 0.12.4

Core components of the Miden protocol
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::transaction::ExecutedTransaction;

impl ExecutedTransaction {
    /// A Rust implementation of the compute_fee epilogue procedure.
    pub fn compute_fee(&self) -> u64 {
        // Round up the number of cycles to the next power of two and take log2 of it.
        let verification_cycles = self.measurements().trace_length().ilog2();
        let fee_amount =
            self.block_header().fee_parameters().verification_base_fee() * verification_cycles;
        fee_amount as u64
    }
}