This issue was discovered and reported by @HonzaDajc:
While contracts stored in the chain are limited to 24576 bytes, code initialising a contract is unlimited in size. In particular, such a code may exceed 64k, and thus the limit of the 2-byte PC counter currently used by the LFVM. Such a case was encountered in the Ethereum mainnet history.
The Tosca VM implementations need to be adapted to be able to handle larger input codes.
Two proposals that have been proposed by @HonzaDajc on how to handle the problem:
extend the LFVM format from a 2-byte instruction + 2-byte data to a 2-byte instruction + 4-byte data format to support the PC instruction which requires the 4-byte program counter as an immediate parameter
introduce a rule in Fantom that init code may not exceed 64k
This issue was discovered and reported by @HonzaDajc:
While contracts stored in the chain are limited to 24576 bytes, code initialising a contract is unlimited in size. In particular, such a code may exceed 64k, and thus the limit of the 2-byte PC counter currently used by the LFVM. Such a case was encountered in the Ethereum mainnet history.
The Tosca VM implementations need to be adapted to be able to handle larger input codes.