EVM: tune FA bridge tick & gas model
What
This MR adjusts the ticks and gas constants for FA bridge.
It also increases gas costs XTZ withdrawal precompile calls to prevent potential abuses.
Why
We need a better approximation to avoid potential spam attack vector.
How
Tick constants to be estimated:
-
FA_DEPOSIT_EXECUTE_TICKS- for updating the ticket table and emitting deposit event -
TICKS_PER_FA_DEPOSIT_PARSING- for parsing ticket transfer into FA deposit structure (also hashing) -
FA_WITHDRAWAL_PRECOMPILE_TICKS_INTERCEPT,FA_WITHDRAWAL_PRECOMPILE_TICKS_SLOPE- for executing the precompile, excluding inner proxy call (linear regression model)
Additionally there are two gas constants:
-
FA_DEPOSIT_PROXY_GAS_LIMIT- max gas allocated to call the (ERC) proxy contract on L2 -
FA_WITHDRAWAL_PRECOMPILE_GAS_COST- added cost of calling the FA withdrawal precompile (artificial)
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.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Michael Zaikin