zksync-era icon indicating copy to clipboard operation
zksync-era copied to clipboard

feat(en): Check recipient contract and function selector in consistency checker

Open slowli opened this issue 2 years ago • 0 comments

What ❔

  • Checks the recipient contract (should be equal to the main L1 contract address) and the Solidity function selector (should correspond to commitBlocks / commitBatches selector) in the consistency checker.
  • Reworks error handling in the consistency checker to be more maintainable.

Why ❔

Not checking these values allows to more-or-less easily fool the checker into accepting a commit transaction which is not really a commit transaction.

Checklist

  • [x] PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • [x] Tests for the changes have been added / updated.
  • [x] Documentation comments have been added / updated.
  • [x] Code has been formatted via zk fmt and zk lint.
  • [x] Spellcheck has been run via zk spellcheck.
  • [x] Linkcheck has been run via zk linkcheck.

slowli avatar Mar 06 '24 10:03 slowli