[go: up one dir, main page]

EVM/Kernel: prevent circular calls of impure precompiles

What

This MR introduces mechanisms that prevent circular kernel calls, like:

  • FA withdrawal -> ... -> XTZ withdrawal precompile
  • FA withdrawal -> ... -> FA withdrawal precompile -> ... -> FA withdrawal precompile -> ...

Why

Although circular calls / reentrancy do not immediately introduce issues, there can be some implications we've not discovered yet.

Potential problems:

  • Amplified spam attack
  • Outbox censorship attack
  • Double spending attack (tez/tickets)

How

A special reentrancy guard is introduced to the EVM handler, it tracks the call stack and identifies circular precompile calls (specifically XTZ/FA withdrawal precompile)

Manually testing the MR

make test

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Michael Zaikin

Merge request reports

Loading