This repository was archived by the owner on Aug 3, 2026. It is now read-only.
feat(raiko): enhance Shasta base fee/anchor offset calculation according to mono - #669
Merged
Conversation
- Updated `calc_next_shasta_base_fee` to include a minimum base fee parameter, ensuring base fees are clamped according to chain-specific requirements. - Introduced `min_base_fee_for_shasta_chain` to determine the minimum base fee based on the chain ID. - Adjusted related functions and validation logic to accommodate the new minimum fee parameter, improving the robustness of base fee validation for Shasta blocks.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Shasta base fee calculation/validation to support a chain-specific minimum base fee (notably a higher minimum on Taiko mainnet), and threads that minimum through the existing calculation and validation flow.
Changes:
- Added a chain-aware minimum base fee selector (
min_base_fee_for_shasta_chain) and a separate mainnet minimum constant. - Updated
calc_next_shasta_base_feeandvalidate_shasta_block_base_feeto clamp/validate against a provided minimum base fee. - Wired
generate_transactions_for_shasta_blocksto compute the chain-specific minimum fromchain_spec.chain_id()and pass it into validation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| lib/src/utils/shasta_rules.rs | Adds chain-specific minimum base fee logic and updates base fee calculation/validation to use it. |
| lib/src/utils/shasta.rs | Computes the minimum base fee from chain ID and passes it into Shasta base fee validation. |
Comments suppressed due to low confidence (1)
lib/src/utils/shasta_rules.rs:479
- This change removes the previously public
clamp_shasta_base_feeAPI in favor of a privateclamp_shasta_base_fee_with_min. If this crate has any downstream consumers, that’s a breaking change; consider keeping a public wrapper (possibly deprecated) or exposing a new public clamping function that takesmin_base_fee/chain_id.
/// Clamp the provided base fee to the given minimum and max allowed for Shasta blocks.
fn clamp_shasta_base_fee_with_min(base_fee: u64, min_base_fee: u64) -> u64 {
if base_fee < min_base_fee {
min_base_fee
} else if base_fee > MAX_BASE_FEE_SHASTA {
MAX_BASE_FEE_SHASTA
} else {
base_fee
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
johntaiko
approved these changes
Mar 3, 2026
smtmfft
enabled auto-merge
March 5, 2026 06:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
calc_next_shasta_base_feeto include a minimum base fee parameter, ensuring base fees are clamped according to chain-specific requirements.min_base_fee_for_shasta_chainto determine the minimum base fee based on the chain ID.