[go: up one dir, main page]

SORU: EVM: make signature operations safe

Context

Fixes #5338 (closed)

Current signature verification is unsafe: it will panics on invalid inputs (eg pre-eip 155, inconsistent signature values). There has been significant unsatisfaction with the state of the file signature.rs, feedback encouraged to achieve better quality.

In essence, modify problematic functions to now return a Result<>, so an error can be returned without panicking.

Remark: U256 arithmetic operation overflow also generate panic.

Manually testing the MR

cd src/kernel_evm
cargo test signatures::test

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Pierre-Emmanuel CORNILLEAU

Merge request reports

Loading