Skip to content

fix: Actually deploy EVM contracts in eth_call mode#2043

Merged
StanislavBreadless merged 8 commits intomainfrom
vv-deploy-evm-contracts-in-a-call-mode
Feb 23, 2026
Merged

fix: Actually deploy EVM contracts in eth_call mode#2043
StanislavBreadless merged 8 commits intomainfrom
vv-deploy-evm-contracts-in-a-call-mode

Conversation

@0xVolosnikov
Copy link
Contributor

@0xVolosnikov 0xVolosnikov commented Feb 20, 2026

What ❔

This PR updates bootloader eth_call handling for EVM-style deployments. Currently playground bootloader just calls 0x0 instead of doing an EVM deployment.

Main changes

  • In bootloader/bootloader.yul (ZKSYNC_NEAR_CALL_ethCall):
    • Detects EVM deployment intent (to == 0 && reserved1 == 1).
    • Rewrites calldata to ContractDeployer.createEVM(bytes) and routes call to ContractDeployer as a system call.
    • Bumps nonce for EOA caller path via NonceHolder.incrementMinNonceIfEquals(...) before deployment.
    • On successful EVM deployment, returns deployed runtime bytecode (instead of raw createEVM returndata):
      • decode deployed address from createEVM returndata,
      • fetch versioned hash via AccountCodeStorage.getRawCodeHash(address),
      • fetch bytecode via CodeOracle,
      • trim returned bytes to extcodesize(deployedAddress).

It doesn't affect proving/sequencer bootloader.

Why ❔

Returning deployed runtime bytecode makes the result useful and consistent for EVM deployment simulation workflows.

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 00e53eaa66

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@0xVolosnikov 0xVolosnikov force-pushed the vv-deploy-evm-contracts-in-a-call-mode branch from 00e53ea to 6879a5e Compare February 20, 2026 14:40
@0xVolosnikov 0xVolosnikov force-pushed the vv-deploy-evm-contracts-in-a-call-mode branch from 9699458 to f66bed6 Compare February 20, 2026 16:55
@0xVolosnikov 0xVolosnikov enabled auto-merge (squash) February 20, 2026 17:31
@github-actions
Copy link
Contributor

Coverage after merging vv-deploy-evm-contracts-in-a-call-mode into main will be

84.47%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
contracts/bridge
   BridgeHelper.sol85.71%100%100%85%31, 36, 41
   BridgedStandardERC20.sol82.14%100%92.31%80.28%120–121, 126–127, 139–140, 164, 205, 212, 219, 229–230, 63, 91
   L1ERC20Bridge.sol94%100%100%93.02%189, 208, 270
   L1Nullifier.sol83.33%100%86.21%82.89%114, 128–130, 160, 221, 224, 234, 237, 247, 250, 418–420, 424–425, 452, 518, 602, 614, 652, 654, 698, 710, 713, 715, 728, 741–742, 746–747, 767
contracts/bridge/asset-router
   AssetRouterBase.sol95.45%100%100%94.44%59, 87
   L1AssetRouter.sol88.33%100%88.89%88.24%208, 246, 262, 349, 360, 391, 430–431, 445, 476, 548, 60, 637, 648, 662, 667, 76, 84
contracts/bridge/interfaces
   AssetHandlerModifiers.sol75%100%100%66.67%13
contracts/bridge/ntv
   L1NativeTokenVault.sol84.82%100%88.24%84.21%144–150, 152, 220–221, 223, 234, 236, 240, 66
   NativeTokenVault.sol89.50%100%92%89.10%102, 234, 239, 256, 274, 279, 295, 314, 322, 488, 503, 531, 564–565, 569–570, 74
contracts/bridgehub
   Bridgehub.sol83.39%100%84.78%83.15%115, 123, 128–130, 137, 165–166, 182, 227–228, 236, 239, 248, 258, 271, 286, 315, 339, 342, 401, 417, 448, 528, 610, 708, 712, 716–717, 736, 739, 790, 793, 796, 831, 835, 838, 873–874, 878–879, 887–888, 892–893
   CTMDeploymentTracker.sol73.47%100%81.82%71.05%106, 110, 114, 139, 143–144, 32, 40, 65, 78–79
   ChainAssetHandler.sol77.94%100%80%77.59%125, 139, 142, 152, 197, 245–246, 250–251, 55, 62–63, 71
   L2MessageVerification.sol100%100%100%100%
   MessageRoot.sol94.87%100%100%93.85%102, 136, 183, 193
contracts/common
   ReentrancyGuard.sol95%100%100%94.12%79
contracts/common/l2-helpers
   L2ContractHelper.sol94.34%100%100%93.33%102, 108, 112
   SystemContractsCaller.sol0%100%0%0%102, 114, 122–125, 128, 135–139, 141–142, 32–34, 37, 44–45, 47, 49, 51, 53, 66, 69, 72, 75, 78, 83, 89, 91, 93, 96, 98
contracts/common/libraries
   DataEncoding.sol85.11%100%100%81.58%109–110, 117–118, 163, 177, 45
   DynamicIncrementalMerkle.sol73.91%100%80%73.17%66–70, 72–74, 76–78
   FullMerkle.sol100%100%100%100%
   Merkle.sol98.15%100%100%97.96%83
   MessageHashing.sol95.16%100%100%94.64%113, 77, 94
   SemVer.sol100%100%100%100%
   UncheckedMath.sol100%100%100%100%
   UnsafeBytes.sol100%100%100%100%
contracts/governance
   AccessControlRestriction.sol100%100%100%100%
   ChainAdmin.sol97.87%100%100%97.30%39
   ChainAdminOwnable.sol44.83%100%40%45.83%28, 38–40, 46–48, 57, 66, 77–79, 81
   Governance.sol100%100%100%100%
   L2ProxyAdminDeployer.sol0%100%0%0%16–18, 20
   PermanentRestriction.sol88.80%100%100%87.39%103, 110–111, 199–200, 203–204, 207, 209–210, 239, 287, 309, 340
   ServerNotifier.sol93.10%100%100%90.91%55, 65
   TransitionaryOwner.sol0%100%0%0%16–17, 21–23
contracts/governance/restriction
   Restriction.sol100%100%100%100%
   RestrictionValidator.sol100%100%100%100%
contracts/state-transition
   AccessControlEnumerablePerChainAddressUpgradeable.sol98.15%100%100%97.67%179
   ChainTypeManager.sol86.07%100%84.62%86.42%111, 123, 129, 137–138, 248–251, 264–267, 282, 412, 474, 502, 509, 536, 584, 592–593
   ValidatorTimelock.sol89.25%100%77.78%92%120, 140, 163, 273, 292, 97
contracts/state-transition/chain-deps
   DiamondInit.sol92.68%100%100%92.50%50, 54, 58
   DiamondProxy.sol100%100%100%100%
   GatewayCTMDeployer.sol0%100%0%0%166–167, 170, 172–174, 176, 178, 180, 188, 190, 192, 194, 196–197, 203, 215, 223, 226–227, 229, 235, 239–240, 248, 253–255, 262, 267–269, 282–285, 299, 304–309, 313, 326, 332, 334, 336–337, 341, 343–345, 353, 358, 362–363, 369, 375, 381, 388, 398, 404, 406, 416, 424, 438, 443, 448
contracts/state-transition/chain-deps/facets
   Admin.sol81.78%100%88%81%153–154, 171, 174, 178, 185–187, 190, 192, 195, 199–200, 204, 300, 303, 312, 315, 325, 332, 352, 366, 369, 376, 389, 392–393, 395–396, 398–399, 401, 404, 435, 439, 460, 466, 51
   Executor.sol88.22%100%100%87.04%133, 147, 154–156, 183, 221, 270, 279, 284, 287,

Copy link
Collaborator

@StanislavBreadless StanislavBreadless left a comment

Choose a reason for hiding this comment

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

Waiting for CI, if okay, merging.

@StanislavBreadless StanislavBreadless merged commit 74f12f0 into main Feb 23, 2026
28 of 29 checks passed
@StanislavBreadless StanislavBreadless deleted the vv-deploy-evm-contracts-in-a-call-mode branch February 23, 2026 15:27
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