Skip to content

Conversation

@Thegaram
Copy link

@Thegaram Thegaram commented Nov 26, 2025

See also:

Summary by CodeRabbit

  • New Features

    • Introduces GalileoV2 hard fork with update to the L1 gas-price oracle bytecode and storage layout.
    • Adds activation and transition detection for GalileoV2 across block processing and mining flows.
    • Execution witnesses now include the GalileoV2 transition flag to ensure correct state proofs.
  • Chores

    • Patch version bumped to 16.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 26, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds GalileoV2 hard-fork support: new config fields and detection, rollup rcfg constants, a misc.ApplyGalileoV2HardFork implementation, and integration points that invoke the fork during prestate application, state processing, chain generation, miner worker flow, plus witness state read; bumps VersionPatch.

Changes

Cohort / File(s) Summary
Config & versioning
params/config.go, params/version.go
Introduces GalileoV2Time *uint64, IsGalileoV2 and IsGalileoV2TransitionBlock methods, adds IsGalileoV2 to Rules, updates String(), removes prior Feynman transition helper, and bumps VersionPatch 15→16.
Hard-fork implementation
consensus/misc/galileoV2.go
New ApplyGalileoV2HardFork(statedb *state.StateDB) that logs application, sets L1GasPriceOracle bytecode to GalileoV2 variant, and initializes IsGalileoSlot storage.
Per-block integration
cmd/evm/internal/t8ntool/execution.go, core/chain_makers.go, core/state_processor.go, miner/scroll_worker.go
Add checks for IsGalileoV2TransitionBlock(...) and invoke ApplyGalileoV2HardFork where blocks transition, sequenced after existing Feynman handling.
Rollup RCcfg / oracle layout
rollup/rcfg/config.go
Adds GalileoV2L1GasPriceOracleBytecode, IsGalileoSlot slot constant, and updates storage layout comments (inserts gap and new slot).
Execution witness
eth/api.go
Reads IsGalileoSlot from L1GasPriceOracleAddress into the execution witness alongside existing Feynman slot read; updates comment to reference both slots.

Sequence Diagram

sequenceDiagram
    participant Config as ChainConfig
    participant BlockProc as Block Processor
    participant Misc as misc.ApplyGalileoV2HardFork
    participant StateDB as StateDB / L1GasPriceOracle

    Note over Config,BlockProc: Per-block processing checks for transitions
    BlockProc->>Config: IsGalileoV2TransitionBlock(parentTS, ts)?
    alt transition == true
        BlockProc->>Misc: ApplyGalileoV2HardFork(statedb)
        Misc->>StateDB: Set L1GasPriceOracle bytecode -> GalileoV2
        Misc->>StateDB: Set IsGalileoSlot = 1
        StateDB-->>Misc: ack
        Misc-->>BlockProc: fork applied
    else
        BlockProc-->>Config: continue normal processing
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Verify sequencing of GalileoV2 checks relative to Feynman across state processing, chain generation, miner worker, and evm prestate.
  • Inspect consensus/misc/galileoV2.go bytecode and storage writes for correctness against L1GasPriceOracle spec.
  • Confirm params public API changes and JSON/tag consistency.

Possibly related PRs

Suggested labels

bump-version, breaking-change

Suggested reviewers

  • jonastheis
  • georgehao

Poem

🐰 I hopped through configs, slots, and bytecode bright,
I set the oracle's flag to one last night,
Blocks now notice a new dawn in the chain,
GalileoV2 dances across every lane —
Hooray for forks, and carrot-code delight! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ⚠️ Warning The pull request description is severely incomplete and does not follow the required template structure. Add all required sections: (1) Purpose/design rationale, (2) PR title following conventional commits format, (3) Version bump confirmation, and (4) Breaking change label indication.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly identifies the main change: upgrading the L1GasOracle predeploy as part of the GalileoV2 upgrade, which aligns with the changes across multiple files implementing GalileoV2 hard fork handling.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-galileo-v2

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot finished reviewing on behalf of Thegaram November 26, 2025 11:21
Copy link

Copilot AI left a comment

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 implements the GalileoV2 hard fork upgrade, which updates the L1GasPriceOracle predeploy contract with new gas calculation logic. The upgrade follows the established pattern of previous Scroll hard forks (e.g., Feynman).

  • Adds GalileoV2 fork configuration and detection logic
  • Updates the L1GasPriceOracle contract bytecode with the GalileoV2 version
  • Ensures witness generation includes the new isGalileo storage slot for revm compatibility

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
params/version.go Bumps patch version from 15 to 16
params/config.go Adds GalileoV2Time configuration field, fork detection methods (IsGalileoV2, IsGalileoV2TransitionBlock), and updates Rules struct and String() method
rollup/rcfg/config.go Adds IsGalileoSlot storage slot constant and GalileoV2L1GasPriceOracleBytecode with verification instructions
consensus/misc/galileoV2.go New file implementing ApplyGalileoV2HardFork to upgrade contract bytecode and initialize isGalileo storage slot
core/state_processor.go Applies GalileoV2 hard fork during block processing at transition block
core/chain_makers.go Applies GalileoV2 hard fork during test chain generation at transition block
miner/scroll_worker.go Applies GalileoV2 hard fork during block mining at transition block
cmd/evm/internal/t8ntool/execution.go Applies GalileoV2 hard fork during EVM transition tool execution at transition block
eth/api.go Ensures IsGalileoSlot is accessed during witness generation for revm compatibility

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5f8d4b6 and cf3fa88.

📒 Files selected for processing (2)
  • params/config.go (8 hunks)
  • rollup/rcfg/config.go (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-09T19:18:56.758Z
Learnt from: Thegaram
Repo: scroll-tech/go-ethereum PR: 1245
File: crypto/kzg4844/kzg4844_gokzg.go:118-150
Timestamp: 2025-10-09T19:18:56.758Z
Learning: The scroll-tech/go-ethereum repository uses Go 1.22+ and supports range-over-integer syntax such as `for range n` and `for i := range len(slice)`, which are valid Go 1.22 language features.

Applied to files:

  • params/config.go
🧬 Code graph analysis (1)
rollup/rcfg/config.go (2)
common/types.go (1)
  • BigToHash (62-62)
common/bytes.go (1)
  • Hex2Bytes (79-82)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test
  • GitHub Check: Analyze (go)
🔇 Additional comments (6)
params/config.go (5)

337-337: GalileoV2 fork not yet scheduled on Sepolia.

The GalileoV2Time is correctly set to nil, indicating the fork is not yet activated on the Sepolia testnet. This is consistent with a preparatory PR.


885-915: String representation correctly updated.

The String() method properly formats GalileoV2Time for display, following the same pattern as other fork times (Darwin, Euclid, Feynman, Galileo).


1033-1036: IsFeynmanTransitionBlock helper added.

This new helper method detects the first Feynman block by checking if the current block is post-Feynman but the parent is pre-Feynman. This follows the same pattern as IsGalileoV2TransitionBlock and is useful for fork transition logic.


1043-1051: GalileoV2 detection methods implemented correctly.

Both IsGalileoV2() and IsGalileoV2TransitionBlock() follow the established pattern from previous forks. The transition block helper will be useful for applying the L1GasPriceOracle upgrade at the exact fork boundary.


1281-1311: Rules struct properly extended.

The IsGalileoV2 field is correctly added to the Rules struct and initialized in the Rules() method, maintaining consistency with other fork flags.

rollup/rcfg/config.go (1)

96-105: Build instructions reference incorrect file paths.

The review comment provides build instructions that contain errors:

  1. Source file location: The comment references src/L1GasPriceOracle.sol, but the actual contract is located at src/L2/predeploys/L1GasPriceOracle.sol.

  2. Artifact path: The jq command should extract from artifacts/src/L2/predeploys/L1GasPriceOracle.sol/L1GasPriceOracle.json instead of artifacts/src/L1GasPriceOracle.sol/L1GasPriceOracle.json.

  3. PR association: The commit dfffa0f04bbd1de31ef342e1642a2f9ad9a620fe is confirmed to be associated with PR #164 only. There is no reference to PR #163 in the commit message.

The corrected build instructions should be:

git checkout dfffa0f04bbd1de31ef342e1642a2f9ad9a620fe
yarn
forge build
cat artifacts/src/L2/predeploys/L1GasPriceOracle.sol/L1GasPriceOracle.json | jq -r .deployedBytecode.object

@Thegaram Thegaram merged commit dd85415 into develop Nov 27, 2025
14 checks passed
@Thegaram Thegaram deleted the feat-galileo-v2 branch November 27, 2025 07:15
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.

5 participants