cowprotocol / research

CoW Protocol Research
GNU Lesser General Public License v3.0
0 stars 0 forks source link

research(contracts): gas optimisation #11

Open mfw78 opened 5 months ago

mfw78 commented 5 months ago

Problem

The Ethereum ecosystem has moved on since the current contracts were created, opening avenues for which to explorer for gas optimisation.

Acceptance criteria

Details

The current contracts are built with Solidity v0.7.6, targeting the default evmVersion at the time, which was istanbul. Since istanbul, there have been upgrades / updates to EVM that will enhance gas efficiency, making the contracts more competitive and/or allow for inclusion of additional features with offset gas cost.

Additionally, we should give consideration for upgrade paths where hashing may become more expensive, such as proposed in EIP-7667.

Possible Solutions

  1. Make use of TSTORE / TLOAD: a. Re-entrancy locks b. Auction context exposure for callbacks (ie. eip1271 callback and/or HooksTrampoline callbacks)
  2. Custom encoding of calldata

Research track