scilla icon indicating copy to clipboard operation
scilla copied to clipboard

Field initialisers are evaluated for each transition invocation

Open jjcnn opened this issue 5 years ago • 4 comments

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.

jjcnn avatar Nov 26 '19 13:11 jjcnn

Init files are also validated both during deployment and transition invocation.

jjcnn avatar Jun 10 '21 19:06 jjcnn

@anton-trunov, @jubnzv: Wasn't this fixed recently?

jjcnn avatar Sep 16 '22 15:09 jjcnn

No, I don't think so.

anton-trunov avatar Sep 16 '22 15:09 anton-trunov

@jjcnn No, definitely not in the last 3 months.

jubnzv avatar Sep 16 '22 15:09 jubnzv