Currently, evm-semantics is built by building the KEVMTarget kdist target. This target depends on the plugin and also builds KEVM with the given plugin using the function kevm_kompile. Other projects that derive from KEVM such as kontrol and kontrol-node also build KEVM with additional k source files and another main k file and module. While these source files can be successfully added to kompile args, these source files are not tracked by the manifest that uses the Target method source. Additionally, a requirement by pyk is that all referenced source files in the method source must be available in the python module. That means that one cannot inherit from KEVM to override source and keep all referenced files in tact. At the same time, a source target dependency cannot be injected into KEVMTarget, because dependencies are returned by the Target method deps. This is why kontrol and kontrol-node builds always generate the same hash in the kdist cache. In oder to successfully build kontrol or kontrol-node, kdist must be cleaned prior to building. This causes kdist to always unnecessarily rebuild the KEVM plugin, which is slow.
To fix this, the SourceTarget pattern used in web assembly and risc-v semantics repositories can be used. This can be first implemented in evm-semantics and afterwards adapted in kontrol and kontrol-node respectively.
Currently, evm-semantics is built by building the
KEVMTargetkdist target. This target depends on the plugin and also builds KEVM with the given plugin using the functionkevm_kompile. Other projects that derive from KEVM such as kontrol and kontrol-node also build KEVM with additional k source files and another main k file and module. While these source files can be successfully added to kompile args, these source files are not tracked by the manifest that uses the Target methodsource. Additionally, a requirement by pyk is that all referenced source files in the methodsourcemust be available in the python module. That means that one cannot inherit from KEVM to overridesourceand keep all referenced files in tact. At the same time, a source target dependency cannot be injected intoKEVMTarget, because dependencies are returned by the Target methoddeps. This is why kontrol and kontrol-node builds always generate the same hash in the kdist cache. In oder to successfully build kontrol or kontrol-node, kdist must be cleaned prior to building. This causes kdist to always unnecessarily rebuild the KEVM plugin, which is slow.To fix this, the
SourceTargetpattern used in web assembly and risc-v semantics repositories can be used. This can be first implemented in evm-semantics and afterwards adapted in kontrol and kontrol-node respectively.