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

feat(node): default executor finish message with hook #4

Merged
merged 3 commits into from
Feb 25, 2025

Conversation

cryptoAtwill
Copy link

@cryptoAtwill cryptoAtwill commented Feb 18, 2025

This PR introduces finish_message_with_hook method that allows customisation on which actors receives the transaction gas fee, i.e.

transfer_to_actor(BURNT_FUNDS_ACTOR_ID, &base_fee_burn)?;
.

This is implemented by introducing a gas processing hook with a newly added method: execute_with_options. This method takes a closure as the gas processing hook. At the end of the execution, finish_message is replaced with finish_message_with_hook instead that calls the hook.

@cryptoAtwill cryptoAtwill changed the title initial commit feat(node): customise txn gas distribution Feb 18, 2025
@cryptoAtwill cryptoAtwill changed the title feat(node): customise txn gas distribution feat(node): default executor finish message with hook Feb 18, 2025

if (&base_fee_burn + &over_estimation_burn + &refund + &miner_tip) != gas_cost {
if gas_sum != gas_cost {
// Sanity check. This could be a fatal error.
return Err(anyhow!("Gas handling math is wrong"));
Copy link

Choose a reason for hiding this comment

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

Please provide more context and use the bail! macro

Copy link
Author

Choose a reason for hiding this comment

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

added

@cryptoAtwill cryptoAtwill merged commit 6831002 into master Feb 25, 2025
@cryptoAtwill cryptoAtwill deleted the customize-gas branch February 25, 2025 08:34
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.

2 participants