Skip to content

[Provers N07] Constants not using UPPER_CASE format#77

Merged
luiz-lvj merged 3 commits intomainfrom
fix/provers-N07
Feb 24, 2026
Merged

[Provers N07] Constants not using UPPER_CASE format#77
luiz-lvj merged 3 commits intomainfrom
fix/provers-N07

Conversation

@pepebndc
Copy link
Collaborator

@pepebndc pepebndc commented Feb 10, 2026

Summary by CodeRabbit

  • Refactor
    • Standardized naming conventions for public constants and state variables across multiple prover contracts by adopting UPPERCASE_SNAKE_CASE format. Updated all internal references and test cases to reflect these naming changes. No functional behavior changes.

@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 2026

Warning

Rate limit exceeded

@luiz-lvj has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minutes and 25 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between e93f65d and ca02ff2.

📒 Files selected for processing (6)
  • snapshots/verifyBroadcastMessage.json
  • src/contracts/provers/arbitrum/ChildToParentProver.sol
  • src/contracts/provers/linea/ChildToParentProver.sol
  • src/contracts/provers/optimism/ChildToParentProver.sol
  • src/contracts/provers/scroll/ChildToParentProver.sol
  • src/contracts/provers/zksync/ChildToParentProver.sol
📝 Walkthrough

Walkthrough

This pull request standardizes naming conventions across all prover contracts by renaming public constants and immutable state variables from camelCase to UPPER_SNAKE_CASE. All internal references and corresponding test cases are updated consistently. No functional behavior changes are introduced.

Changes

Cohort / File(s) Summary
Arbitrum Provers
src/contracts/provers/arbitrum/ChildToParentProver.sol, src/contracts/provers/arbitrum/ParentToChildProver.sol
Renamed public constants and immutables: blockHashBufferBLOCK_HASH_BUFFER, blockHashMappingSlotBLOCK_HASH_MAPPING_SLOT, homeChainIdHOME_CHAIN_ID, and outbox/rootsSlot to OUTBOX/ROOTS_SLOT. Updated all internal references and constructor assignments.
Linea Provers
src/contracts/provers/linea/ChildToParentProver.sol, src/contracts/provers/linea/ParentToChildProver.sol
Renamed public variables: blockHashBufferBLOCK_HASH_BUFFER, blockHashMappingSlotBLOCK_HASH_MAPPING_SLOT, homeChainIdHOME_CHAIN_ID, and lineaRollup/stateRootHashesSlot to LINEA_ROLLUP/STATE_ROOT_HASHES_SLOT. Updated all references throughout verification logic.
Optimism Provers
src/contracts/provers/optimism/ChildToParentProver.sol, src/contracts/provers/optimism/ParentToChildProver.sol
Renamed constants and immutables: l1BlockPredeployL1_BLOCK_PREDEPLOY, l1BlockHashSlotL1_BLOCK_HASH_SLOT, homeChainIdHOME_CHAIN_ID, and anchorStateRegistryANCHOR_STATE_REGISTRY. Updated all internal logic and comparisons.
Scroll Provers
src/contracts/provers/scroll/ChildToParentProver.sol, src/contracts/provers/scroll/ParentToChildProver.sol
Renamed public fields: blockHashBufferBLOCK_HASH_BUFFER, blockHashMappingSlotBLOCK_HASH_MAPPING_SLOT, homeChainIdHOME_CHAIN_ID, and scrollChain/finalizedStateRootsSlot to SCROLL_CHAIN/FINALIZED_STATE_ROOTS_SLOT. Updated all storage references and slot derivations.
Taiko Provers
src/contracts/provers/taiko/ChildToParentProver.sol, src/contracts/provers/taiko/ParentToChildProver.sol
Renamed public immutables: signalServiceSIGNAL_SERVICE, checkpointsSlotCHECKPOINTS_SLOT, homeChainIdHOME_CHAIN_ID. Updated all references across checkpoint verification logic and service interactions.
ZkSync Provers
src/contracts/provers/zksync/ChildToParentProver.sol, src/contracts/provers/zksync/ParentToChildProver.sol
Renamed public state variables: blockHashBufferBLOCK_HASH_BUFFER, blockHashMappingSlotBLOCK_HASH_MAPPING_SLOT, homeChainIdHOME_CHAIN_ID, and gateway/chain references to uppercase equivalents. Updated constructor and all verification logic.
Test Updates
test/Receiver.t.sol, test/VerifyBroadcastMessageBenchmark.t.sol, test/provers/linea/ParentToChildProver.t.sol, test/provers/scroll/ParentToChildProver.t.sol, test/provers/taiko/ChildToParentProver.t.sol, test/provers/taiko/ParentToChildProver.t.sol
Updated all test references to use new UPPER_SNAKE_CASE public getter names across prover contract assertions and test setup calls.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

  • PR #36: Introduced the same blockHashBuffer and related fields in Linea ChildToParentProver that this PR standardizes to UPPER_SNAKE_CASE.
  • PR #31: Added Taiko prover public fields that this PR renames to uppercase naming conventions (signalService, checkpointsSlot, homeChainId).
  • PR #29: Modified Optimism prover constants and chain ID references that this PR now standardizes to uppercase naming.

Suggested reviewers

  • frangio
  • nahimterrazas

🐰 Constants wearing fancy hats,
From camelCase to UPPER_SNAKE_CASE bats,
Every prover now dressed in style,
Making our codebase smile with a mile! ✨
Consistency hopping through each test and file,
The naming convention's now worthwhile! 🎩

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: renaming constants/variables across prover contracts from camelCase to UPPER_CASE format per the N07 naming convention.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/provers-N07

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.

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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/contracts/provers/arbitrum/ParentToChildProver.sol`:
- Around line 14-31: The ABI changed because immutable state variables were
renamed to OUTBOX, ROOTS_SLOT, HOME_CHAIN_ID which changes their autogenerated
getter names and breaks the pre-deployed contract; fix by restoring ABI
compatibility either by renaming the variables back to their original camelCase
names (outbox, rootsSlot, homeChainId) or by adding explicit public view getter
functions named outbox(), rootsSlot(), and homeChainId() that return the
corresponding immutable values (OUTBOX, ROOTS_SLOT, HOME_CHAIN_ID) so callers
and test/Receiver.t.sol can still use the old getters; update whichever approach
you choose across the constructor assignments and references to these symbols.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7714c79 and e93f65d.

📒 Files selected for processing (18)
  • src/contracts/provers/arbitrum/ChildToParentProver.sol
  • src/contracts/provers/arbitrum/ParentToChildProver.sol
  • src/contracts/provers/linea/ChildToParentProver.sol
  • src/contracts/provers/linea/ParentToChildProver.sol
  • src/contracts/provers/optimism/ChildToParentProver.sol
  • src/contracts/provers/optimism/ParentToChildProver.sol
  • src/contracts/provers/scroll/ChildToParentProver.sol
  • src/contracts/provers/scroll/ParentToChildProver.sol
  • src/contracts/provers/taiko/ChildToParentProver.sol
  • src/contracts/provers/taiko/ParentToChildProver.sol
  • src/contracts/provers/zksync/ChildToParentProver.sol
  • src/contracts/provers/zksync/ParentToChildProver.sol
  • test/Receiver.t.sol
  • test/VerifyBroadcastMessageBenchmark.t.sol
  • test/provers/linea/ParentToChildProver.t.sol
  • test/provers/scroll/ParentToChildProver.t.sol
  • test/provers/taiko/ChildToParentProver.t.sol
  • test/provers/taiko/ParentToChildProver.t.sol

Comment on lines 14 to 31
address public immutable OUTBOX;
/// @dev Storage slot the Outbox contract uses to store roots.
/// Should be set to 3 unless the outbox contract has been modified.
/// See https://github.com/OffchainLabs/nitro-contracts/blob/9d0e90ef588f94a9d2ffa4dc22713d91a76f57d4/src/bridge/AbsOutbox.sol#L32
uint256 public immutable rootsSlot;
uint256 public immutable ROOTS_SLOT;

/// @dev The chain ID of the home chain (where this prover reads from).
uint256 public immutable homeChainId;
uint256 public immutable HOME_CHAIN_ID;

error CallNotOnHomeChain();
error CallOnHomeChain();
error TargetBlockHashNotFound();

constructor(address _outbox, uint256 _rootsSlot, uint256 _homeChainId) {
outbox = _outbox;
rootsSlot = _rootsSlot;
homeChainId = _homeChainId;
OUTBOX = _outbox;
ROOTS_SLOT = _rootsSlot;
HOME_CHAIN_ID = _homeChainId;
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's verify the actual code in ParentToChildProver.sol
cat -n src/contracts/provers/arbitrum/ParentToChildProver.sol | head -40

Repository: openintentsframework/broadcaster

Length of output: 2338


🏁 Script executed:

# Search for remaining references to old getter names across the codebase
rg -n --type=sol -e '\boutbox\(\)' -e '\brootsSlot\(\)' -e '\bhomeChainId\(\)' \
   -e '\bblockHashBuffer\(\)' -e '\bblockHashMappingSlot\(\)' \
   -e '\bgatewayZkChain\(\)' -e '\bl2LogsRootHashSlot\(\)' \
   -e '\bchildChainId\(\)' -e '\bgatewayChainId\(\)' \
   -e '\bl1BlockPredeploy\(\)' -e '\bsignalService\(\)' \
   -e '\bcheckpointsSlot\(\)' -e '\blineaRollup\(\)' \
   -e '\bstateRootHashesSlot\(\)'

Repository: openintentsframework/broadcaster

Length of output: 103


🏁 Script executed:

# Check if test/Receiver.t.sol exists and contains the reference mentioned
if [ -f test/Receiver.t.sol ]; then
  echo "=== test/Receiver.t.sol exists ==="
  grep -n "ON_CHAIN_ARB_PROVER" test/Receiver.t.sol
else
  echo "test/Receiver.t.sol does not exist"
fi

Repository: openintentsframework/broadcaster

Length of output: 267


🏁 Script executed:

# Search for any TypeScript/JavaScript files that might be calling these getters
fd -e ts -e js -e tsx -e jsx | head -20

Repository: openintentsframework/broadcaster

Length of output: 197


🏁 Script executed:

# Search for references to OUTBOX, ROOTS_SLOT, HOME_CHAIN_ID in all files
rg -n "OUTBOX|ROOTS_SLOT|HOME_CHAIN_ID" --max-count=50 | head -50

Repository: openintentsframework/broadcaster

Length of output: 5161


🏁 Script executed:

# Search TypeScript/JavaScript files for any calls to getter functions
rg -e "\.outbox\(\)" -e "\.rootsSlot\(\)" -e "\.homeChainId\(\)" -e "\.OUTBOX\(\)" -e "\.ROOTS_SLOT\(\)" -e "\.HOME_CHAIN_ID\(\)"

Repository: openintentsframework/broadcaster

Length of output: 1065


🏁 Script executed:

# Check git history to confirm the rename happened
cd src/contracts/provers/arbitrum && git log --oneline -n 20 ParentToChildProver.sol 2>/dev/null || echo "Git history not available"

Repository: openintentsframework/broadcaster

Length of output: 94


🏁 Script executed:

# Look for contract deployment or interaction scripts that might call these getters
fd -e ts -e js | xargs grep -l "ParentToChildProver\|OUTBOX\|ROOTS_SLOT" 2>/dev/null | head -10

Repository: openintentsframework/broadcaster

Length of output: 58


🏁 Script executed:

# Check wagmi.config.js and hardhat.config.ts for contract ABI definitions
cat wagmi.config.js 2>/dev/null | head -50

Repository: openintentsframework/broadcaster

Length of output: 279


🏁 Script executed:

# Search for any ABIs or contract interfaces that might be affected
fd -e json -e ts | xargs grep -l "outbox\|rootsSlot\|homeChainId" 2>/dev/null | head -10

Repository: openintentsframework/broadcaster

Length of output: 58


🏁 Script executed:

# Check if the old names appear in any branch or commit message
git log --all --oneline --grep="outbox\|rootsSlot\|homeChainId" 2>/dev/null | head -5

Repository: openintentsframework/broadcaster

Length of output: 291


🏁 Script executed:

# Search for any README or documentation that might mention deployment or API stability
fd -e md -e txt | xargs grep -l "deployment\|API\|breaking\|getter" 2>/dev/null | head -5

Repository: openintentsframework/broadcaster

Length of output: 190


🏁 Script executed:

# Look for any .gitignore patterns that might hide SDK/ABI artifacts
cat .gitignore 2>/dev/null | grep -i "abi\|sdk\|dist\|build"

Repository: openintentsframework/broadcaster

Length of output: 89


🏁 Script executed:

# Check the git commit that added homeChainId to see if it shows the naming pattern
git show 37b9d68 --stat 2>/dev/null | head -20

Repository: openintentsframework/broadcaster

Length of output: 577


🏁 Script executed:

# Check the documentation to see if it documents the getter function names
cat docs/provers/ARBITRUM.md | head -100

Repository: openintentsframework/broadcaster

Length of output: 4109


🏁 Script executed:

# Look for any ABI files or interface definitions in the codebase
fd -e json -path "*/abi*" -o -path "*/artifacts*" | head -20

Repository: openintentsframework/broadcaster

Length of output: 244


🏁 Script executed:

# Search for IStateProver interface to understand the contract structure
cat -n src/contracts/interfaces/IStateProver.sol 2>/dev/null | head -50

Repository: openintentsframework/broadcaster

Length of output: 3934


🏁 Script executed:

# Check the previous version of ParentToChildProver.sol to see the old naming
git show 37b9d68~1:src/contracts/provers/arbitrum/ParentToChildProver.sol 2>/dev/null || echo "Cannot retrieve previous version"

Repository: openintentsframework/broadcaster

Length of output: 4104


🏁 Script executed:

# Look for any JSON ABIs or exported interface definitions
find . -name "*.json" -type f | xargs grep -l "OUTBOX\|ROOTS_SLOT\|outbox\|rootsSlot" 2>/dev/null | head -10

Repository: openintentsframework/broadcaster

Length of output: 58


🏁 Script executed:

# Check the full diff of commit 37b9d68 for ParentToChildProver.sol
git show 37b9d68 -- src/contracts/provers/arbitrum/ParentToChildProver.sol 2>/dev/null | head -80

Repository: openintentsframework/broadcaster

Length of output: 2946


🏁 Script executed:

# Check if there's a more recent commit that renamed variables to UPPER_SNAKE_CASE
git log --all --oneline -- src/contracts/provers/arbitrum/ParentToChildProver.sol | head -10

Repository: openintentsframework/broadcaster

Length of output: 430


🏁 Script executed:

# Get the full diff showing the transition from camelCase to UPPER_SNAKE_CASE
git log -p --all -- src/contracts/provers/arbitrum/ParentToChildProver.sol 2>/dev/null | grep -A 20 "address public immutable" | head -40

Repository: openintentsframework/broadcaster

Length of output: 58


🏁 Script executed:

# Check the most recent commits to see when variables were renamed to UPPER_SNAKE_CASE
git show e93f65d:src/contracts/provers/arbitrum/ParentToChildProver.sol 2>/dev/null | head -35

Repository: openintentsframework/broadcaster

Length of output: 1888


🏁 Script executed:

# Check commit 3b4b69d to see if it involved variable naming changes
git show 3b4b69d -- src/contracts/provers/arbitrum/ParentToChildProver.sol 2>/dev/null | head -50

Repository: openintentsframework/broadcaster

Length of output: 2382


🏁 Script executed:

# Check if there's a commit message or change that explains the renaming
git log --all --oneline --grep="UPPER\|snake\|naming\|convention" 2>/dev/null

Repository: openintentsframework/broadcaster

Length of output: 128


🏁 Script executed:

# Look at the diff between HEAD and commit 37b9d68 to see all changes
git diff 37b9d68 HEAD -- src/contracts/provers/arbitrum/ParentToChildProver.sol 2>/dev/null | head -100

Repository: openintentsframework/broadcaster

Length of output: 5119


ABI breaking change confirmed — pre-deployed contract at 0x2aA03593adf471d6dd7c041984e6D7D6045E373f no longer compatible with this code.

Renaming public immutable state variables from camelCase to UPPER_SNAKE_CASE changes the auto-generated getter function signatures: outbox()OUTBOX(), rootsSlot()ROOTS_SLOT(), homeChainId()HOME_CHAIN_ID().

The contract instance referenced in test/Receiver.t.sol (0x2aA03593adf471d6dd7c041984e6D7D6045E373f) is already deployed on-chain with the old ABI. If this contract is called via its getters from off-chain tooling, scripts, or other contracts, those calls will fail with the new getter names. Confirm whether this contract will be redeployed, upgraded via proxy, or if callers have been updated to use the new getter names.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/contracts/provers/arbitrum/ParentToChildProver.sol` around lines 14 - 31,
The ABI changed because immutable state variables were renamed to OUTBOX,
ROOTS_SLOT, HOME_CHAIN_ID which changes their autogenerated getter names and
breaks the pre-deployed contract; fix by restoring ABI compatibility either by
renaming the variables back to their original camelCase names (outbox,
rootsSlot, homeChainId) or by adding explicit public view getter functions named
outbox(), rootsSlot(), and homeChainId() that return the corresponding immutable
values (OUTBOX, ROOTS_SLOT, HOME_CHAIN_ID) so callers and test/Receiver.t.sol
can still use the old getters; update whichever approach you choose across the
constructor assignments and references to these symbols.

@luiz-lvj
Copy link
Collaborator

I updated the PR so only the constants are upper case, not the immutable variables.

@luiz-lvj luiz-lvj merged commit dd46f95 into main Feb 24, 2026
3 checks passed
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.

2 participants