v4-core icon indicating copy to clipboard operation
v4-core copied to clipboard

Calldata over memory

Open hensha256 opened this issue 10 months ago • 1 comments

Component

No response

Describe the suggested feature and problem it solves.

A number of the parameters used in core are passed in using memory, but are never written to only read, so we should try to move them to calldata and see if it saves gas. This includes the unlockCallback should be parsing in calldata not memory to save it being passed back and forth between the 2

I spent a few mins doing a first pass on calldata-not-memory but things are failing and this isnt my priority right now

Describe the desired implementation.

No response

Describe alternatives.

No response

Additional context.

No response

hensha256 avatar Apr 03 '24 14:04 hensha256

On an initial attempt with making the PoolKey calldata instead of memory, the gas only seems to be increasing. The addLiquidity snap goes up by 2000.

nishim3 avatar Apr 04 '24 14:04 nishim3

Closing this as it seems to cause gas to increase.

snreynolds avatar Aug 30 '24 18:08 snreynolds