[monero-project/monero] Bp multi aggregation pippenger (#4219)

stoffu commented on this pull request.

>
— // divide in two steps, since the divisor must be 32 bits, but DYNAMIC_FEE_PER_KB_BASE_BLOCK_REWARD isn’t
— div128_32(hi, lo, DYNAMIC_FEE_PER_KB_BASE_BLOCK_REWARD / 1000000, &hi, &lo);
+ uint64_t unscaled_fee_base = (fee_base * min_block_weight / median_block_weight);
+ lo = mul128(unscaled_fee_base, block_reward, &hi);
+ static_assert(DYNAMIC_FEE_BASE_BLOCK_REWARD % 1000000 == 0, «DYNAMIC_FEE_BASE_BLOCK_REWARD must be divisible by 1000000»);
+ static_assert(DYNAMIC_FEE_BASE_BLOCK_REWARD / 1000000 <= std::numeric_limits::max(), «DYNAMIC_FEE_BASE_BLOCK_REWARD is too large»);
+
+ // divide in two steps, since the divisor must be 32 bits, but DYNAMIC_FEE_BASE_BLOCK_REWARD isn’t
+ div128_32(hi, lo, DYNAMIC_FEE_BASE_BLOCK_REWARD / 1000000, &hi, &lo);

But this code path is specific to the per-kb scheme as it’s outside the section `if (version >= HF_VERSION_PER_BYTE_FEE) { … return lo; }`, so it doesn’t make sense to me to make changes here other than minimal set of renaming (e.g. `min_block_size` to `min_block_weight`).