Conversation
0918376 to
8a6c43a
Compare
There was a problem hiding this comment.
Pull request overview
Implements the FIP-0115 base fee update path by deriving the next base fee from message gas premiums (rather than utilization), and updates effective gas premium calculation to clamp negative rewards to zero.
Changes:
- Add premium-based base fee computation (
ComputeNextBaseFeeFromPremiums) and supporting weighted percentile selection logic. - Clamp
EffectiveGasPremiumto never return a negative value whenGasFeeCap < BaseFee. - Add/adjust tests covering
EffectiveGasPremium, weighted selection, and next-base-fee-from-premium formula.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
venus-shared/actors/types/message.go |
Clamp effective gas premium to zero when GasFeeCap is below BaseFee. |
venus-shared/actors/types/message_test.go |
New unit tests for EffectiveGasPremium edge cases. |
pkg/chain/message_store.go |
Add premium-based base fee computation + weighted quickselect percentile helper. |
pkg/chain/message_store_test.go |
Add tests for weighted quickselect determinism and next-base-fee-from-premium formula. |
pkg/chain/export_test.go |
Expose internal helpers for testing. |
pkg/constants/chain_parameters.go |
Add BlockGasTargetIndex constant for percentile selection. |
pkg/config/config.go |
Add new fork upgrade height field (currently placeholder-named) and minor comment formatting. |
app/submodule/eth/eth_test.go |
Update reward expectation to match clamped premium behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #6528 +/- ##
======================================
Coverage 22% 22%
======================================
Files 775 775
Lines 81995 82083 +88
======================================
+ Hits 18349 18410 +61
- Misses 60777 60805 +28
+ Partials 2869 2868 -1 🚀 New features to boost your workflow:
|
c860b7e to
9f686c0
Compare
|
@wjmelements Would you mind reviewing this pr, please? |
wjmelements
left a comment
There was a problem hiding this comment.
base fee adjustment, activation, and tests look good to me
| {maxFeePerGas: big.NewInt(600), maxPriorityFeePerGas: big.NewInt(500), answer: big.NewInt(500)}, | ||
| {maxFeePerGas: big.NewInt(600), maxPriorityFeePerGas: big.NewInt(600), answer: big.NewInt(500)}, | ||
| {maxFeePerGas: big.NewInt(600), maxPriorityFeePerGas: big.NewInt(1000), answer: big.NewInt(500)}, | ||
| {maxFeePerGas: big.NewInt(50), maxPriorityFeePerGas: big.NewInt(200), answer: big.NewInt(-50)}, |
There was a problem hiding this comment.
Check that you weren't previously using this method for the block reward calculation. For the block reward it is possible for the max fee per gas to be less than the base fee, and in that case a part of the base fee is paid by the storage provider.
There was a problem hiding this comment.
Yeah, it's not about the block reward.
关联的Issues (Related Issues)
ref #6525
改动 (Proposed Changes)
附注 (Additional Info)
自查清单 (Checklist)
在你认为本 PR 满足被审阅的标准之前,需要确保 / Before you mark the PR ready for review, please make sure that: