scilla
scilla copied to clipboard
Field initialisers are evaluated for each transition invocation
When a contract is initialised before a transition invocation we evaluate all field initialisers, which is unnecessary since the result is never used (fields are read using IPC during transition execution). This takes up unnecessary time for the miners, and costs unnecessary gas for the user invoking the transition.
Once contract constraints are merged, the same problem will occur for them.
Field initialisers and contract constraints should only be evaluated when the contract is deployed. After that the contract should rely on IPC only to access the contract state.
Init files are also validated both during deployment and transition invocation.
@anton-trunov, @jubnzv: Wasn't this fixed recently?
No, I don't think so.
@jjcnn No, definitely not in the last 3 months.