NethermindEth / near-sffl

https://nffl.nethermind.io/
MIT License
6 stars 3 forks source link

Enable Go race detector #256

Closed emlautarom1 closed 2 weeks ago

emlautarom1 commented 2 weeks ago

Current Behavior

Currently no static analysis tools are being used as part of our build process (either local or CI).

New Behavior

As part of #215, we add Go's race detector to our unit and integration tests.

Breaking Changes

This does not introduce any breaking change. The only expected effect is longer CI testing time due to additional checks being performed

Observations

At the moment it's impossible to add the race detector to the integration_test.go test due to an unknown error. To reproduce, first increase the context timeout (~500 seconds should be enough):

https://github.com/NethermindEth/near-sffl/blob/50e67050a6dbc4c7b774fbcd0acd11e63d592ca6/tests/integration/integration_test.go#L54

Then, if you run the test you'll see that it fails and in the logs you'll see the following error:

integration_test.go:119: Error updating state root: execution reverted: revert: Signature is invalid

Which points to this line:

https://github.com/NethermindEth/near-sffl/blob/50e67050a6dbc4c7b774fbcd0acd11e63d592ca6/tests/integration/integration_test.go#L119

I haven't been able to figure out why adding the race detector makes a signature invalid (maybe something related to timings?)