tbtc icon indicating copy to clipboard operation
tbtc copied to clipboard

Much of Deposit state can be immutable

Open wjmelements opened this issue 5 years ago • 3 comments

Currently a lot of state is written via SSTORE. It would be much cheaper to use PUSH. If you updated to the latest solidity you would be able to use immutable variables, which are written into code instead of in storage. This would substantially reduce the gas used to create a deposit or to read its state.

wjmelements avatar May 05 '20 23:05 wjmelements

We'd have to upgrade Solidity 6 days before launch. Too risky for my tastes, but flagging this for v2.

Keep these coming! 😍

mhluongo avatar May 05 '20 23:05 mhluongo

With the shutdown, will this make it into the next version?

wjmelements avatar May 18 '20 21:05 wjmelements

With the shutdown, will this make it into the next version?

Highly unlikely. If it didn't require a Solidity upgrade, touching the whole codebase, it would still be a stretch. I'll keep it in mind if there's an opportunity though.

mhluongo avatar May 19 '20 17:05 mhluongo