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

refactor: replace calculate_next_block_base_fee with alloy's builtin function #7641

Merged
merged 3 commits into from
Apr 15, 2024
Merged

refactor: replace calculate_next_block_base_fee with alloy's builtin function #7641

merged 3 commits into from
Apr 15, 2024

Conversation

rupam-04
Copy link
Contributor

Fixes #7635 by replacing calculate_next_block_base_fee from

pub fn calculate_next_block_base_fee(
with alloy's builtin function.

@rupam-04 rupam-04 requested a review from gakonst as a code owner April 14, 2024 19:42
@rupam-04
Copy link
Contributor Author

@mattsse

)
}
}
calc_next_block_base_fee(gas_used as u128, gas_limit as u128, base_fee as u128, base_fee_params) as u64
Copy link
Collaborator

Choose a reason for hiding this comment

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

i'd just re-export this and replace every call in the codebase with calc_next_block_base_fee, or alternatively import the alloy_eips crate where this is called

Copy link
Contributor Author

@rupam-04 rupam-04 Apr 15, 2024

Choose a reason for hiding this comment

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

I thought of doing that but felt that changing the function name throughout the whole codebase wouldn't be okay for me to do. If there is no issue with my approach can the PR be merged?

Copy link
Collaborator

Choose a reason for hiding this comment

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

re-export would be preferred here, even if this means we need to about a few type casts etc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

re-export would be preferred here, even if this means we need to about a few type casts etc

working on it

@onbjerg onbjerg added the C-debt A clean up/refactor of existing code label Apr 14, 2024
@onbjerg onbjerg changed the title Replaced calculate_next_block_base_fee with alloy's builtin function refactor: replace calculate_next_block_base_fee with alloy's builtin function Apr 15, 2024
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

I'd prefer if we could entirely replace the function and use the re-exported alloy fn

this likely requires a few casts

)
}
}
calc_next_block_base_fee(gas_used as u128, gas_limit as u128, base_fee as u128, base_fee_params) as u64
Copy link
Collaborator

Choose a reason for hiding this comment

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

re-export would be preferred here, even if this means we need to about a few type casts etc

@rupam-04 rupam-04 requested a review from Rjected as a code owner April 15, 2024 15:29
@rupam-04
Copy link
Contributor Author

rupam-04 commented Apr 15, 2024

I'd prefer if we could entirely replace the function and use the re-exported alloy fn

this likely requires a few casts

fixed in the latest commit

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

great, ty!

@mattsse mattsse enabled auto-merge April 15, 2024 21:49
@mattsse mattsse added this pull request to the merge queue Apr 15, 2024
Merged via the queue into paradigmxyz:main with commit d4a8ef9 Apr 15, 2024
27 checks passed
@rupam-04 rupam-04 deleted the replace-with-alloy's-builtin-function branch April 16, 2024 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-debt A clean up/refactor of existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace calculate_next_block_base_fee with alloy's builtin function
3 participants