Skip to content
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

[framework] Fix transaction fee deduct bug #2286

Merged
merged 2 commits into from
Jul 26, 2024
Merged

Conversation

jolestar
Copy link
Contributor

@jolestar jolestar commented Jul 26, 2024

Summary

Deduct the gas fee in the pre_execute function and refund in the post_execute function.

resolve #1137

TODO: #2287

Copy link

vercel bot commented Jul 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rooch ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 26, 2024 7:20am
rooch-portal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 26, 2024 7:20am

Copy link

github-actions bot commented Jul 26, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

let max_gas_amount = tx_context::max_gas_amount();
let paid_gas = transaction_fee::calculate_gas(max_gas_amount);

if (gas_used_after_scale < paid_gas) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

实际支付的 gas,如果比预先扣除的 gas 要多怎么办?出现的情况是,网络变的拥挤之后 Gas 费上涨

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gas factor 调整会在交易执行之后,这个后面设计 gas factor 调整方案的时候需要考虑。 #1733

@jolestar jolestar force-pushed the fix_transaction_fee_bug branch from ca568bd to 9b96c7c Compare July 26, 2024 07:17
@jolestar jolestar merged commit e90a55e into main Jul 26, 2024
8 checks passed
@jolestar jolestar deleted the fix_transaction_fee_bug branch July 26, 2024 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Testing] Integration test improvement
4 participants