EIP-1051: Arithmetic overflow detection for the EVM

This may be too late, but I have some toughth on thi EIP wich is one crucial to join security and effiency

I like how signed and unsigned are treated separetely
how you can perform a batch of operations and the flags only need to be checked at the end (with some exception if you mix signed and unsigned operations)

but I also have some remarks:

The ovf flag should trigger in the operations EXP and SHL

an signed sum of a positive and a negative number should not trigger the signed and should trigger the unsigned flag. The specification says “The sovf flag is set whenever the ovf flag is set, and additionally in the following circumstances”

Division by zero, and this include operations div, mod, sdiv, smod, addmodm, mulmod as well; should be treated in the flags

The signed division -(2**255) / -1 should trigger the sovf flag

The flags related to signed multiplication is wrong, it should trigger when the modulo of the ideal multiplication is bigger equal than 2**255

The signed flag should trigger with the SHL operation, this is trickier to define when

Hello Renan. At this point I think somebody would need to resurrect this proposal, as we haven’t heard from @Arachnid in a long while. If you want to that would be a good thing.

1 Like

What is the besr course of action here? do I make a new proposal or do I update this one?

I’ve written this proposal EIP: math checking