balancer / balancer-v2-monorepo

Balancer V2 Monorepo
https://balancer.fi/
GNU General Public License v3.0
304 stars 378 forks source link

Migrate to solc 0.8 #1340

Open nventuro opened 2 years ago

nventuro commented 2 years ago

At some point we'll want to do this.

There's two big changes that I know of that will affect us:

It'd be good if we kept the interface pragmas >0.7.0, to avoid breaking compatibiliy.

nventuro commented 2 years ago

We may want to wait until https://github.com/ethereum/solidity/issues/10698 is solved before migrating. See this comment on how the lack of that feature negatively affects gas usage.

nventuro commented 2 years ago

After reading the docs more carefully, I realized that the actual change 0.8 introduced is to make enums always have at most 256 elements, not make the type wider. So we're unaffected by this.

Starloss commented 1 year ago

Any update on this?

nventuro commented 1 year ago

Not really. We still want to do it, and I was hoping the unchecked expression would be resolved by now. Unfortunately it looks like it's not going to happen, so we may just have to bite the bullet and live with that.

0xJem commented 1 year ago

Hello! Are there still plans to perform this migration? We (Olympus) have a codebase built on solc 0.8.x and were trying to use the StableMath library, but are concerned about changes in behaviour (particularly those not immediately visible, edge cases, etc) due to the overflow/underflow changes.

nventuro commented 1 year ago

One of the original motivations for waiting was https://github.com/ethereum/solidity/issues/10698 being addressed, though it looks like that won't happen in the short term.

That said, you should definitely be able to use StableMath (and indeed pretty much any math-related code) in 0.8, since we don't ever rely on overflow behavior.