tokamak-network / tokamak-thanos

MIT License
7 stars 3 forks source link

Unnecessary transaction execution #241

Closed Zena-park closed 2 weeks ago

Zena-park commented 2 weeks ago

Describe the bug The L2 transaction is executed even when there is no actual L1 activity ( when msg.value is 0 and _data is '0x' ).

Configuration

Severity:

Impact

Unnecessary gas consumption

Recommendation

In the L2ToL1MessagePasser.initiateWithdrawal function, if msg.value is 0 and there is no _data parameter value, error handling is required.

https://github.com/tokamak-network/tokamak-thanos/blob/5ad9baac98217a0c1533969b00076d9a4443edba/packages/tokamak/contracts-bedrock/src/L2/L2ToL1MessagePasser.sol#L73-L83

nguyenzung commented 2 weeks ago

I think it is okay here. Even L1 does not prevent submit a transaction like that. And Optimism is the same compared to Thanos in this situation

Zena-park commented 2 weeks ago

Okay. I'll close the issue.