aionnetwork / AVM

Enabling Java code to run in a blockchain environment
https://theoan.com/
MIT License
49 stars 25 forks source link

Energy consumption in debug mode might be different #345

Open aion-shidokht opened 5 years ago

aion-shidokht commented 5 years ago

In debug mode, line numbers are preserved which leads to additional labels being created. Thus, the code blocks detected are smaller. In certain scenarios where a method's logic is not fully executed, debug mode's energy consumption is lower than the normal mode. Depending on where a method's execution is stopped and an exception is thrown, the energy consumed is different in debug mode. With the current implementation the user is charged only for what is executed.

fulldecent commented 5 years ago

Is it possible to please provide a minimal test case?