aionnetwork / AVM

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

[CLOSED] Split KernelInterface into top-level and reentrant variants #276

Closed aionbot closed 5 years ago

aionbot commented 5 years ago

Issue created by jeff-aion (on Thursday Oct 11, 2018 at 18:35 GMT)

The KernelInterface contains some unused calls but also some calls which only make sense at the root level of the VM (that is, never during reentrant calls or during DApp execution).

In order to avoid maintaining, and designing around, these unused paths, we should remove them and then split the interface into ICommonKernel (the base kernel with common capabilities) and IRootKernel (the expanded interface used in the root of the VM).

aionbot commented 5 years ago

Comment by jeff-aion (on Thursday Oct 11, 2018 at 20:43 GMT)

After looking into the now-pruned KernelInterface, I realized that the split I was hoping to impose is not actually feasible. I had originally only been thinking about the reentrant case, where a great deal of what the kernel offers is cached in-memory, within the running DApp heap.

In general, however, the cross-call does need the entire interface as it typically isn't reentrant but just an ordinary call into another DApp. Therefore, the pruning done in b0f3d05 is all that can be done under this item.