You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DApp developers will get the following error message, if there are too many local variables.
Stack too deep, try removing local variables.
This is a common issue for stack-based virtual machine, specifically FastVM and EVM. Only the top N stack items can be read/written; therefore, all high level languages on top of it has to limit the number of local variables which are stored on the stack.
Both Aion and Ethereum's solidity have the same limit on number of local stack items where local variables can occupate. However, the actual number of local variables are typically less in Aion's platfrom, because some local variable may take more than one stack item. For example, variable of address type will take two 128-bit stack items in Aion, while only one 256-bit stack item in Ethereum.
I believe the only solution to make Aion Solidity support more local variables is to update the FastVM by:
Introduce DUP17-DUP32 and SWAP17-SWAP32;
OR add new opcodes DUPX and SWAPX which take on argument specifying the N-th stack item to operate on.
OR add new opcodes DUP + (1 byte offset) and SWAP + (1 byte offset) which take a number of arguments as specified in the next byte.
The text was updated successfully, but these errors were encountered:
solution one would have the lowest cost. DUPX's max depth is up to 256*16 bytes = 4KB, cache miss should be under consideration. data access from ddr will cost much more.
DApp developers will get the following error message, if there are too many local variables.
This is a common issue for stack-based virtual machine, specifically FastVM and EVM. Only the top N stack items can be read/written; therefore, all high level languages on top of it has to limit the number of local variables which are stored on the stack.
Both Aion and Ethereum's solidity have the same limit on number of local stack items where local variables can occupate. However, the actual number of local variables are typically less in Aion's platfrom, because some local variable may take more than one stack item. For example, variable of
address
type will take two 128-bit stack items in Aion, while only one 256-bit stack item in Ethereum.I believe the only solution to make Aion Solidity support more local variables is to update the FastVM by:
DUP17
-DUP32
andSWAP17
-SWAP32
;DUPX
andSWAPX
which take on argument specifying the N-th stack item to operate on.DUP + (1 byte offset)
andSWAP + (1 byte offset)
which take a number of arguments as specified in the next byte.The text was updated successfully, but these errors were encountered: