OP Grant Application - Reducing gas costs on Optimism and Arbitrum

Hi Bach,

Thank you for coming back to give us an idea of your progress on the project.

We look forward to further updates from you.

Keep up the good work

2 Likes

Hey mates!

Iā€™ve had a few personal concerns to deal with lately. So it has added a bit of delay.

However Iā€™ve progressed much more than you think! The 1st step is already achieved, and Iā€™m almost done with the 2nd step requirements too.
The current global compression rate I could achieve is around 50% of savings already!

So Iā€™m gonna publish and share the work with the team soon, that should also facilitate the review of the work by the team and @Xutyr (one big review instead of two), as it was additional work for me to roll-back to the first milestone version after all my implementations.

So Iā€™m cleaning my work, adding more examples to the testing framework to better assess the exact saving average in the wide variety of callData for swap with Paraswap August structure, as well as the correctness of these compressions.

Iā€™m just having a last ā€œconflictā€ in all the optimisations that is gonna take me a few days to revert and fix.

A few days are gonna be necessary too, so I can analyze my work and figure out if another compression method could save even more (for example the recursive compression I couldnā€™t succeed to implement currently due to restriction with solidity attribute ā€œcalldataā€ on input types on contract methods).

In conclusion this second milestone should be reached by the 15th of December.

Cheers,
Chab

5 Likes

Hi Bach,

as usual, thank you for sharing with us the progress of the project.

Hoping to see the product working soon!

Cheers :wink:

2 Likes

Hey all,

I confirm that the shipping of phases 1 and 2 are imminent.

Iā€™ve finalised the v5 of the compression/decompression algorithm.
Iā€™ve also been very careful to write good tests and handling every edge cases that could happen.

Here are a few examples of the initial gas cost of writing the transaction on the L1 and the final gas cost of writing the compressed call data. The coefficient represents the compression rate related to the initial cost (1 - (finalCost / initialCost)):

13568 | 4668
0.66
------------
10460 | 4392
0.58
------------
4084 | 1508
0.63
------------
7008 | 2624
0.63
------------
7008 | 2640
0.62
------------
30532 | 7536
0.75
------------
11316 | 4104
0.64
------------
11484 | 4216
0.63

The global average compression currently reached on the Paraswap call data examples (50 different ones randomly selected) is 60%:

446496 | 177116
0.60

The expected average rate will be a bit better because these tests are realized in conditions where not all compression methods are applied at 100%.

Iā€™m gonna see with Mwamedacen and Xut when I can share the project and discuss the next steps.

Have a great year!

Cheers,
Chab

7 Likes

Additionally I forgot to mention that I found out during some researches that this optimisation currently seems usable on the Base network too: Fees | Base

Regarding Polygon zkEVM this also seems possible as stated in this doc, the L2 fee is mostly a portion of the L1 fee: Astar zkEVM Fee Calculation | Astar Docs
Edit: after trying this on Polygon zkEVM, it doesnā€™t seem the same calculation ways.

More testing in real conditions will be required to find out exactly the conditions of fee savings for these layers.

But this looks very promising as it would be applied on 3 layers where Paraswap is deployed!

8 Likes

For information the repository has been shared with Xut and three core team members since the 3rd of January!

We should soon have a meeting to discuss the implementation and next steps.

8 Likes

Catching up on this development. Havenā€™t seen the code but seems like great stuff! Is there a repo we can look at ? (web dev instructor, just curious)

Hey @nimser, for now the code is not open source, weā€™re discussing it with the team of what should be the good decision regarding this, as it could open more risks of seeing these optimisations copied by other aggregators.

Regarding the general development, sorry for the lack of news Iā€™ve been quite busy on other projects recently. However as communicated the first two steps are done, the payment of the first one has been made, and the payment of the second one is waiting for the complete review finalisation by the core team.

As soon as this validation is completed weā€™ll be able to start phase 3, even if we have already discussed the way to do so, Iā€™m waiting for more clear instructions to pursue the developments.

Cheers

5 Likes