Skip to content

Comments

refactor: consolidate DummyCaller contracts into single generic implementation#18786

Merged
smartcontracts merged 3 commits intodevelopfrom
devin/1768420886-consolidate-dummycaller
Jan 15, 2026
Merged

refactor: consolidate DummyCaller contracts into single generic implementation#18786
smartcontracts merged 3 commits intodevelopfrom
devin/1768420886-consolidate-dummycaller

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Jan 14, 2026

Summary

Replaces 7 nearly-identical DummyCaller contracts scattered across deployment scripts with a single generic implementation that uses a fallback() function to forward any call via delegatecall.

The new generic DummyCaller in scripts/libraries/DummyCaller.sol:

  • Reads target address from storage slot 0
  • Forwards calldata via delegatecall
  • Reverts on failure, returns on success

Implementation approach:

  • Scripts that need return values (AddGameType.s.sol) use typed calls directly on the prank address
  • Scripts with complex return types (UpgradeOPChain.s.sol, UpgradeSuperchainConfig.s.sol) use low-level call() to avoid ABI decoding issues
  • Uses type(DummyCaller).runtimeCode for vm.etch() (not creationCode)

Files changed:

  • Added scripts/libraries/DummyCaller.sol with generic implementation
  • Updated UpgradeOPChain.s.sol (removed DummyCallerV1, DummyCallerV2)
  • Updated UpgradeSuperchainConfig.s.sol (removed DummyCaller, DummyCallerV2)
  • Updated AddGameType.s.sol (removed DummyCaller)
  • Updated InteropMigration.s.sol (removed DummyCaller)

Closes #18784

Review & Testing Checklist for Human

  • Verify the assembly in DummyCaller.sol fallback is correct - The inline assembly handles calldatacopy, delegatecall, returndatacopy, and result switching. This is the most critical piece to review.
  • Verify AddGameType.s.sol return value handling - This script calls IOPContractsManager(prank).addGameType() and expects AddGameOutput[] return. Confirm the fallback correctly returns raw delegatecall return data that Solidity can decode.
  • Verify low-level call pattern in upgrade scripts - UpgradeOPChain.s.sol and UpgradeSuperchainConfig.s.sol use _prank.call(data) instead of typed calls to avoid return type mismatches. Verify this is correct.
  • Test deployment scripts manually - Run the affected scripts in a test environment to verify they still work correctly with the generic DummyCaller.

Notes

Requested by: Kelvin Fichter (@smartcontracts)
Link to Devin run: https://app.devin.ai/sessions/0c6ba96a87ff4461b09ef02d3da8c4df

Last update: 2026-01-14 14:41 ET

…mentation

Replaces 7 nearly-identical DummyCaller contracts with a single generic
implementation that uses a fallback() function to forward any call.

Changes:
- Add scripts/libraries/DummyCaller.sol with generic delegatecall forwarder
- Update UpgradeOPChain.s.sol to use generic DummyCaller
- Update UpgradeSuperchainConfig.s.sol to use generic DummyCaller
- Update AddGameType.s.sol to use generic DummyCaller
- Update InteropMigration.s.sol to use generic DummyCaller
- Remove redundant DummyCallerV1, DummyCallerV2, and DummyCaller contracts

The generic DummyCaller reads the target address from storage slot 0,
forwards calldata via delegatecall, reverts on failure, and returns on
success. This is functionally equivalent to the previous implementations
since all callers required success anyway.

Closes #18784

Co-Authored-By: Kelvin Fichter <kelvinfichter@gmail.com>
@devin-ai-integration devin-ai-integration bot requested a review from a team as a code owner January 14, 2026 20:08
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration bot and others added 2 commits January 14, 2026 20:27
Co-Authored-By: Kelvin Fichter <kelvinfichter@gmail.com>
- Use type(DummyCaller).runtimeCode instead of creationCode for vm.etch()
- Use low-level calls in _upgrade() to avoid return type mismatches
- Get upgradeInput before vm.broadcast() to avoid staticcall errors

Co-Authored-By: Kelvin Fichter <kelvinfichter@gmail.com>
@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.03%. Comparing base (b62556d) to head (84fafad).
⚠️ Report is 2029 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #18786      +/-   ##
===========================================
+ Coverage    73.93%   77.03%   +3.09%     
===========================================
  Files          190      135      -55     
  Lines        11318     7288    -4030     
===========================================
- Hits          8368     5614    -2754     
+ Misses        2804     1674    -1130     
+ Partials       146        0     -146     
Flag Coverage Δ
cannon-go-tests-64 ?
contracts-bedrock-tests 77.03% <ø> (-0.61%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 56 files with indirect coverage changes

🚀 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.

Copy link
Contributor

@smartcontracts smartcontracts left a comment

Choose a reason for hiding this comment

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

Nice

@smartcontracts smartcontracts added this pull request to the merge queue Jan 15, 2026
Merged via the queue into develop with commit aa2b4d3 Jan 15, 2026
93 checks passed
@smartcontracts smartcontracts deleted the devin/1768420886-consolidate-dummycaller branch January 15, 2026 17:45
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.

Consolidate unnecessary DummyCaller contracts

2 participants