feat: basefee caculation for fip0115#6528
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 @@
## feat/nv28 #6528 +/- ##
===========================================
Coverage ? 22%
===========================================
Files ? 790
Lines ? 83671
Branches ? 0
===========================================
Hits ? 18426
Misses ? 62372
Partials ? 2873 🚀 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
9f686c0 to
74daadf
Compare
关联的Issues (Related Issues)
ref #6525
改动 (Proposed Changes)
附注 (Additional Info)
自查清单 (Checklist)
在你认为本 PR 满足被审阅的标准之前,需要确保 / Before you mark the PR ready for review, please make sure that: