Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(l1-contracts): Migrate L1 Contracts to Custom Errors #477

Merged
merged 23 commits into from
Jun 10, 2024

Conversation

koloz193
Copy link
Contributor

@koloz193 koloz193 commented May 16, 2024

What ❔

Moving all of the l1 contracts to use custom errors instead of string based reverts

pt 2 of #473

Gas Report From Before: https://gist.github.com/koloz193/c8f39f6b61411e6b6a3ddebd8a8869df
Gas Report From After: https://gist.github.com/koloz193/beb78cb4ed2aa0919d7adda72b288a07

Why ❔

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.

// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

error Unauthorized(address caller);
Copy link
Member

Choose a reason for hiding this comment

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

Better to place errors in the interface version of the contract. So we will see which error supposed to be in which contract + there will be no ridiculously big imports

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we'll likely end up with the same number of imports unless they live within the interface (but then we need to duplicate them in the tests) and a single file lets us remove duplicates. I don't feel strongly though on this.

Maybe @dnkolegov does?

@koloz193 koloz193 requested a review from vladbochok June 4, 2024 00:09
@koloz193 koloz193 marked this pull request as ready for review June 4, 2024 00:09
@koloz193 koloz193 requested a review from dnkolegov June 4, 2024 00:11
@koloz193 koloz193 changed the base branch from dev to protocol-defense June 7, 2024 18:07
l1-contracts/contracts/bridge/L1SharedBridge.sol Outdated Show resolved Hide resolved
l1-contracts/contracts/bridge/L1SharedBridge.sol Outdated Show resolved Hide resolved
l1-contracts/contracts/bridge/L1SharedBridge.sol Outdated Show resolved Hide resolved
l1-contracts/contracts/bridge/L1SharedBridge.sol Outdated Show resolved Hide resolved
l1-contracts/contracts/bridge/L1SharedBridge.sol Outdated Show resolved Hide resolved
l1-contracts/contracts/upgrades/BaseZkSyncUpgrade.sol Outdated Show resolved Hide resolved
l1-contracts/contracts/upgrades/BaseZkSyncUpgrade.sol Outdated Show resolved Hide resolved
l1-contracts/contracts/upgrades/BaseZkSyncUpgrade.sol Outdated Show resolved Hide resolved
l1-contracts/contracts/upgrades/BaseZkSyncUpgrade.sol Outdated Show resolved Hide resolved
l1-contracts/contracts/upgrades/BaseZkSyncUpgrade.sol Outdated Show resolved Hide resolved
@koloz193 koloz193 merged commit 1561905 into protocol-defense Jun 10, 2024
21 checks passed
@koloz193 koloz193 deleted the zk-l1-custom-errors branch June 10, 2024 04:05
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