-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Base fee calculation uses floating point arithmetic which can cause precision loss with large values.
Location
cipherbft/crates/rpc/src/eth/api.rs
Lines 918 to 923 in 1140ac3
| let increase = (last_base_fee as f64 * 0.125 * (last_ratio - 0.5) * 2.0) as u128; | |
| last_base_fee.saturating_add(increase) | |
| } else { | |
| // Block was less than 50% full, decrease base fee | |
| let decrease = (last_base_fee as f64 * 0.125 * (0.5 - last_ratio) * 2.0) as u128; | |
| last_base_fee.saturating_sub(decrease) |
Severity
Medium - May cause fee calculation inconsistencies.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working