Stack underflow for opcode `CREATE2`
【问题分类】
- bug
- P2P网络相关(包含libp2p,liquid)
- 链账户身份与权限相关(证书问题、public、多签投票问题)
- 核心交易引擎相关(交易池、DAG)
- 共识相关
- 智能合约相关
- 存储相关
- SDK相关
- 长安链CMC工具
- 长安链管理台
- 长安链浏览器
- 长安链合约IDE
- 长安链web签名插件
- 跨链相关
- 轻节点相关
- 隐私计算相关
- 密码学相关
- 环境依赖
- 其他补充:
【问题描述】(请对问题进行描述,方便定位问题)
According to EIP-1014 and evm opcode, the opcode CREATE2
(0xf0
) should take 4
stack elements.
However, in https://git.chainmaker.org.cn/chainmaker/vm-evm/-/blob/master/evm-go/instructions/closure.go#L95 , the requireStackDepth
is set to 2
instead of 4
.
In https://git.chainmaker.org.cn/chainmaker/vm-evm/-/blob/master/evm-go/instructions/closure.go#L450 , the function commonCreate
directly pops 3 elements from stack.
This operation will raise a stack underflow error because the number of elements in the stack is insufficient to fulfill the requirements of the operation.
Affected versions include vm-evm before commit a217d2bb5f1f368b1520256fcd805420ed13913b.