The most ugly piece of code in go-ethereum code base , IMHO, is the following
https://github.com/ethereum/go-ethereum/blob/master/core/vm/evm.goOf course , it is there for a reason.
Virtual machines guarantee that the code is executed the same on all computers, no matter the system, and that it is executed deterministically.
I am trying to understand if it is possible to get rid of virtual machines. The answer would definitely be yes, if we can guarantee deterministic execution. Nondeterministic execution seems to be hard for existing consensus mechanisms. I looked at Ethereum, Avalanche, Solana. Do you know any consensus mechanism that would allow nondeterministic execution? ( to clarify, the state after consensus must be the same across nodes, it is only nondeterministic how it is chosen.) Note that although Avalanche consensus does terminate even in nondeterministic situation, practically it does not seem to usable because one can pollute the system with multiple nondeterministic transactions, which would make consensus time unreasonably large.
I am trying to understand if it is possible to isolate a process from sources of nondeterminism.
There are typical sources
1. /dev/urandom
2. time
We should include system variables here, but lets suppose we fix the system.
One more source could be system files. Lets say we use chroot to jail the process. This should be done carefully: naive use does not exclude /dev/urandom , and as a result e.g. RSA key generation has access to randomness. But lets assume that we dealt with this issue.
Also, the stack can be a source of randomness. In some languages, it is possible to get info about the stack. But lets say, we blocked these possibilities.
What else is there?