Skip to content
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
smtmfft merged 8 commits into
mainfrom
new-base-fee
Mar 5, 2026
Merged

feat(raiko): enhance Shasta base fee/anchor offset calculation according to mono#669
smtmfft merged 8 commits into
mainfrom
new-base-fee

Conversation

@smtmfft

@smtmfft smtmfft commented Feb 25, 2026

Copy link
Copy Markdown
Contributor
  • 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.

- 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.
Copilot AI review requested due to automatic review settings February 25, 2026 01:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_fee and validate_shasta_block_base_fee to clamp/validate against a provided minimum base fee.
  • Wired generate_transactions_for_shasta_blocks to compute the chain-specific minimum from chain_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_fee API in favor of a private clamp_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 takes min_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.

Comment thread lib/src/utils/shasta_rules.rs
Comment thread lib/src/utils/shasta_rules.rs
Comment thread lib/src/utils/shasta_rules.rs Outdated
smtmfft and others added 2 commits February 25, 2026 14:40
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@smtmfft smtmfft changed the title feat: enhance Shasta base fee calculation with new minimum config feat: enhance Shasta base fee/anchor offset calculation according to mono Feb 28, 2026
@smtmfft
smtmfft requested review from Copilot and johntaiko February 28, 2026 07:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread lib/src/utils/shasta_rules.rs
Comment thread lib/src/utils/shasta_rules.rs
@smtmfft
smtmfft requested review from johntaiko and removed request for johntaiko March 3, 2026 02:05
@smtmfft smtmfft changed the title feat: enhance Shasta base fee/anchor offset calculation according to mono feat(raiko): enhance Shasta base fee/anchor offset calculation according to mono Mar 5, 2026
@smtmfft
smtmfft enabled auto-merge March 5, 2026 06:14
@smtmfft
smtmfft added this pull request to the merge queue Mar 5, 2026
Merged via the queue into main with commit 42db63c Mar 5, 2026
17 of 19 checks passed
@smtmfft
smtmfft deleted the new-base-fee branch March 5, 2026 06:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants