EVM version is in the scope of metadata and so can be defined by a different standard.
If EVM versions were numbered or well-defined, perhaps they could be signaled via the salt. But I don’t think they are that important. It would make code harder to find and result in unnecessary duplication.
In that case the part of the ERC part about metadata would be irrelevant as CALMs would have to have CBOR attached.
I am fine with that since I assume CALM optimisations will prefer to optimise for run time gas costs (while the deployment / replicate costs can be slightly higher due to CBOR attached).
Does anyone has an opposite view on this assumption? (in the case of replicable CALMs among chains)
Signaling / declaring the EVM compatibility version is key for multichain replications.
Imagine someone blindly replicates CALM contract with CLZ opcodes onto chains that do not have that assuming it will work there in the same way.
Wrt to signal via salt - interesting - there are not that many evm versions (assuming not to be thousands in the future either). Impact on the tooling would be to iterate over set of evm version constants in order to find the exact address, where CALM is deployed.
@vbaranov would that work for explorers? (note, CBOR metadata can still be there, the salt approach is to derive the EVM version directly from the chain runtime)
ad3) capability based declarations - I like it in general, however I am not sure it can be practically achieved - declaring PUSH0 requirement is easy, once we get into larger set of opcodes (like e.g. EOF related) - how could that be declared? I think we would end up with some sort of capability release naming anyway.
Another aspect to be considered into the standard besides EVM version:
Calls / Delegate Calls
Should the ERC limit CALMs not allowing to call another contracts?
Again for the sake of the EVM capabilities - let’s assume 1 CALM is compiled with paris target, but it calls another CALM that is of the very recent version having CLZ opcode. After the replication to the “paris capable” chain - some behaviour of CALM 1 with calls will be broken there.
No; just warn about it in Security Considerations.
Strongly agree.
They could just as easily make this mistake with CBOR. The tooling has to be version-aware either way. There would be fewer problems if the tooling determined the EVM version itself rather than depending on signal.
There may be some limitations to compatibility detection. For example, if two different L2’s had utilized the same precompile address for different purposes, it might be hard to detect which one was intended. More generally, it won’t be possible for tooling to resolve every conceivable deviation. Nevertheless, I think it would be worse if tooling relied on self-identification and such self-identification was wrong.
I don’t think it is important for this ERC to solve evm versioning because the issue is broader than this standard. I recommend we just mention it in Security Considerations.