FraxFinance / frax-oft-upgradeable

Frax <> LayerZero Upgradeable OFTs
2 stars 1 forks source link

Proper gas for `setEnforcedOptions` #6

Open pegahcarter opened 5 months ago

pegahcarter commented 5 months ago

Introduction

Frax OFTs require a minimum amount of gas to be forwarded to the destination chain to enable destination execution. We are currently using a default value from tests and need to migrate to a proven minimum value.

Description

In setting up an OFT, we set the enforced options on both the source and destination chain. Currently, these are set as default values as found in the tests: https://github.com/FraxFinance/frax-oft-upgradeable/blob/efe4c6444862b6908c8ed667d8562fd580e0bf63/scripts/DeployFraxOFTProtocol/DeployFraxOFTProtocol.s.sol#L425-L427

It has been recommended by the L0 team to decrease the amount of gas forwarded as a simple non-upgradeable transfer should require less than 6k gas. What you can use is the suggested tenderly gas profiler to determine the amount spent of an upgradeable OFT transfer. With this knowledge, we can:

Requirements