raiden-contracts icon indicating copy to clipboard operation
raiden-contracts copied to clipboard

A potential overflow involving the block number.

Open pirapira opened this issue 5 years ago • 1 comments

After a while, when block.number is big enough, the following addition in TokenNetwork might overflow.

        channel.settle_block_number += uint256(block.number);

pirapira avatar May 06 '19 13:05 pirapira

At the current block mining rate, that will take 2**256 - 10296463 / 2 / 4 / 60 / 24 / 365 > 10^70 years. Even if Ethereum starts mining a few million times faster, we can still wait a few million years and have plenty of time to fix it. But adding an overflow check might be easier than explaining this in a comment.

karlb avatar Jun 19 '20 13:06 karlb