aionnetwork / AVM

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

[CLOSED] Contract Creation to not push code but return it #273

Closed aionbot closed 5 years ago

aionbot commented 5 years ago

Issue created by aionick (on Tuesday Oct 09, 2018 at 21:47 GMT)

Currently the avm does two things during contract creation that the kernel does not expect:

I tried for a few hours today to simply have the kernel handle these two differences but it soon became clear that what I thought would be a few close-by changes would turn into multiple remote changes that just would be very awkward in the kernel and put us in one of those shotgun patch-up situations where we couldn't be sure we had even taken care of all the cases. This is mostly because the kernel takes a lot of liberties in how it treats its repository, flushing and overwriting it to account for the multiple stages of the transaction processing, and so bending the kernel to account for the avm would mean lots of patching up of these sorts of things (which the fast vm would still require).

The avm has to change its behaviour so that it does the following:

aionbot commented 5 years ago

Comment by aionick (on Friday Oct 12, 2018 at 15:31 GMT)

Now handled by commit 142035c in integration_kernel. This, possibly temporary, solution is simply for the kernel to intercept the avm's putCode call and to only perform the actual write upon SUCCESS. I don't mind this solution, especially during the alpha2 release. It may be better, however, to actually have the avm obey this success condition.