Using `onEdge` on our codebase


#1

Run onEdge tooling on our codebase


Relevant People: @adam, @jakubgs, @pedro, @roman, @gravityblast, @dmitrys

Status: incomplete

Blog Aritcle Url


  • OnEdge is a Go-tool to check for incorrect treatment of the defer-panic-recover process in Go when dealing with errors.

  • They found that you can cause serious issues (e.g. blockchain fork) if this is not done right (e.g. making global state changes in the middle of the pattern)

  • Based on how much recover() is used in status-go this shouldn’t take long to implement use.

  • A deeper look may show that we aren’t using the defer-panic-recover paradigm well.

Useful Links

Introducing the Go Race Detector - The Go Blog

defer, panic, and recover - The Go Blog

trailofbits/on-edge

Places recover() is used in Status-go

  1. api/backend.go line 138

  2. rpc/client.go line 202

defer is used 118 times in Status-go

Here is the search:

status-im/status-go