File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,8 @@ use fvm_ipld_blockstore::Blockstore;
1010
1111use super :: weighted_quick_select:: weighted_quick_select;
1212
13- /// TODO(FIP-0115): Replace this placeholder with actual next upgrade height
14- /// This is a temporary value used during the FIP-0115 implementation.
15- /// Replace with the actual next upgrade height once it is determined and finalized.
13+ /// Placeholder for the FIP-0115 activation height.
14+ /// Replace with the actual network upgrade height once finalized.
1615pub const PLACEHOLDER_NEXT_UPGRADE_HEIGHT : ChainEpoch = ChainEpoch :: MAX ;
1716
1817pub const BLOCK_GAS_TARGET_INDEX : u64 = BLOCK_GAS_LIMIT * 80 / 100 - 1 ;
9998 }
10099
101100 let percentile_premium = weighted_quick_select ( premiums, limits, BLOCK_GAS_TARGET_INDEX ) ;
102- Ok ( compute_next_base_fee_from_premium ( parent_base_fee, percentile_premium) )
101+ Ok ( compute_next_base_fee_from_premium (
102+ parent_base_fee,
103+ percentile_premium,
104+ ) )
103105}
104106
105107pub ( crate ) fn compute_next_base_fee_from_premium (
Original file line number Diff line number Diff line change @@ -24,10 +24,10 @@ pub fn weighted_quick_select(
2424 mut target_index : u64 ,
2525) -> TokenAmount {
2626 loop {
27- match premiums. as_slice ( ) {
28- [ ] => return TokenAmount :: zero ( ) ,
29- [ premium] => {
30- return if limits [ 0 ] > target_index {
27+ match ( premiums. as_slice ( ) , limits . as_slice ( ) ) {
28+ ( [ ] , _ ) => return TokenAmount :: zero ( ) ,
29+ ( [ premium] , [ limit ] ) => {
30+ return if * limit > target_index {
3131 premium. clone ( )
3232 } else {
3333 TokenAmount :: zero ( )
You can’t perform that action at this time.
0 commit comments