Skip to content

[Fix] Emit genesis shnarf and initializer to latest version#2337

Open
thedarkjester wants to merge 6 commits intomainfrom
fix/initialization-changes
Open

[Fix] Emit genesis shnarf and initializer to latest version#2337
thedarkjester wants to merge 6 commits intomainfrom
fix/initialization-changes

Conversation

@thedarkjester
Copy link
Collaborator

@thedarkjester thedarkjester commented Feb 9, 2026

This PR implements issue(s) #

Checklist

  • I wrote new tests for my new core changes.
  • I have successfully ran tests, style checker and build against my new changes locally.
  • I have informed the team of any breaking changes if there are any.

Note

High Risk
Touches upgrade/initializer gating and reentrancy protections in core messaging/bridging/rollup contracts; incorrect versioning or slot handling could break proxy upgrades or weaken safety guarantees.

Overview
Adds a shared InitializationVersionCheck mixin and updates TokenBridge, L2MessageService, and LineaRollup initializers to require an exact pre-initialized version (0) and to use newer reinitializer versions (TokenBridge/L2MessageService: 3, LineaRollup: 8), changing “double-initialize” failures to the new InitializedVersionWrong custom error.

Reworks upgrade reinitializers (reinitializeV3/reinitializeV8) to drop proxy-admin slot checks and instead clear legacy OpenZeppelin reentrancy guard storage with explicit slot writes, reverting with ReentrantCall if the legacy guard indicates an entered state; TransientStorageReentrancyGuardUpgradeable is also updated to use a fixed transient storage key via tload/tstore.

Updates rollup initialization to emit LineaRollupBaseInitialized with an added genesisShnarf argument, and extends test-only contracts to allow raw sload/sstore for simulating upgrade states; Hardhat tests are updated/expanded to assert initialized versions, upgrade behavior, and new revert expectations.

Written by Cursor Bugbot for commit 7f1bd60. This will update automatically on new commits. Configure here.

@thedarkjester thedarkjester requested a review from a team as a code owner February 9, 2026 17:59
@codecov-commenter
Copy link

codecov-commenter commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.92%. Comparing base (317ee4a) to head (7f1bd60).
⚠️ Report is 19 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2337      +/-   ##
============================================
- Coverage     60.93%   60.92%   -0.01%     
  Complexity     1619     1619              
============================================
  Files           436      437       +1     
  Lines         17363    17359       -4     
  Branches       1908     1906       -2     
============================================
- Hits          10580    10576       -4     
  Misses         6123     6123              
  Partials        660      660              
Flag Coverage Δ *Carryforward flag
hardhat 97.89% <100.00%> (-0.01%) ⬇️
kotlin 56.64% <ø> (ø) Carriedforward from 67e4d9c

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
contracts/src/bridging/token/TokenBridge.sol 100.00% <100.00%> (ø)
contracts/src/bridging/token/TokenBridgeBase.sol 100.00% <ø> (ø)
...ontracts/src/common/InitializationVersionCheck.sol 100.00% <100.00%> (ø)
contracts/src/messaging/l2/L2MessageService.sol 100.00% <100.00%> (ø)
...ontracts/src/messaging/l2/L2MessageServiceBase.sol 100.00% <ø> (ø)
contracts/src/rollup/LineaRollup.sol 100.00% <100.00%> (ø)
contracts/src/rollup/LineaRollupBase.sol 100.00% <100.00%> (ø)
...ncy/TransientStorageReentrancyGuardUpgradeable.sol 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

kyzooghost
kyzooghost previously approved these changes Feb 10, 2026
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

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.

3 participants