-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(evm): Fix unit inconsistency related to AuthInfo.Fee and txData.Fee #2157
Conversation
…ee using effective fee
WalkthroughThis pull request addresses a unit inconsistency in transaction fee calculations within the Nibiru EVM. The changes modify how transaction fees are computed across multiple files, introducing an effective fee calculation that enforces a minimum gas price of 1 unibi. The modifications ensure more consistent and accurate fee handling in Ethereum-compatible transactions, focusing on aligning Changes
Sequence DiagramsequenceDiagram
participant TX as Ethereum Transaction
participant Validator as EVM Ante Handler
participant FeeCalc as Fee Calculator
TX->>Validator: Submit Transaction
Validator->>FeeCalc: Calculate Effective Fee
FeeCalc-->>Validator: Compute Fee (Min 1 unibi)
Validator->>TX: Validate and Process Transaction
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🔇 Additional comments (3)
Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
ba3a5fb
to
1e9ef8a
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2157 +/- ##
=======================================
Coverage 65.19% 65.20%
=======================================
Files 277 277
Lines 22240 22242 +2
=======================================
+ Hits 14500 14502 +2
Misses 6746 6746
Partials 994 994
|
Purpose / Abstract
fix(evm): Fix unit inconsistency related to AuthInfo.Fee and txData.Fee by using effective fee. Prior to this change, there were two areas where a wei amount was passed as an argument to a "Cosmos" fee where it expects units of unibi (micronibi).
Since
txData.Fee
does not take into account the fact that the network has a global and absolute minimum gas price of 1 unibi == 10^{12} wei, this is fixed by usingtxData.EffectiveFeeWei
, as the latter function guarantees the minimum gas price without adding configuration on the part of end-users. This is similar to what we do to computeweiPerGas
inEthereumTx
:Summary by CodeRabbit
Bug Fixes
Documentation