aionnetwork / AVM

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

[CLOSED] Determine how to handle StringConcatFactory energy charge #298

Closed aionbot closed 5 years ago

aionbot commented 5 years ago

Issue created by aionick (on Thursday Oct 25, 2018 at 22:16 GMT)

The StringConcatFactory makes an energy charge in its avm_makeConcatWithConstants method.

The issue with this is that when a dapp is run the fist time (using a long-lived avm) and then is executed again by the kernel for its second verification round, this charge is only made the first time around because the second time the avm finds the dapp in its hot dapp cache. However, the kernel expects the two runs to produce identical results.

Discussing this with Jeff, it seems the solution is probably just removing this charge altogether and adding in a unit test to verify charging consistency. Deciding to keep the energy charging around might involve some very complex logic to hold this all together.

aionbot commented 5 years ago

Comment by aionick (on Friday Oct 26, 2018 at 13:54 GMT)

Looks like LambdaMetaFactory may be in the same boat