By Ulrik Strid
The protocol in Tezos is made to be future proof by updating on chain. To help with the burden of making sure the protocol operations are safe Octez provides a environment that the protocol can execute functions from. The general idea looks something like this the figure below.
"But wait, that doesn't sound particularly future proof!" you say. And you would be correct, that's why we allow to update the protocol environment in a safe manner. To make it safe we make sure old environments are immutable and if something changes "shims" are created to keep old versions working as expected.
There are multiple reasons why we would want to create a new environment. We at Marigold want to add functionality - specifically BLS signatures that are needed to implement Optimistic Rollups efficiently.
Other reasons to create a new environment could be updating underlying libraries with different performance characteristics. An example of this is Environment V4 that updates the BLS12-381 library with new bindings to blst. Environment V4 also uses a newer version of zcash. Both these libraries have better performance than the previous versions, which will result in lower gas consumption in subsequent protocol upgrades.
If you want to know more about environments you can read the documentation or reach out to us on social media.