graph-node icon indicating copy to clipboard operation
graph-node copied to clipboard

Enable graft validation checks for debug

Open shuaibbapputty opened this issue 1 year ago • 3 comments

Closes https://github.com/graphprotocol/graph-node/issues/5197

Fix graft validation checks

  • Removed the conditional compilation for reorg threshold checks in debug builds

This will be good to go as we have reorg_threshold set to 0 on debug builds. https://github.com/graphprotocol/graph-node/blob/b0c89526fd932393f3e43350ee664404eb858040/graph/src/env/mod.rs#L238-L241

shuaibbapputty avatar Aug 06 '24 05:08 shuaibbapputty

@lutter @incrypto32 would appreciate a review of this PR.

shuaibbapputty avatar Aug 07 '24 14:08 shuaibbapputty

Interesting. This used to fail CI; do you have any idea where the reorg threshold is set to 0 when we run tests?

lutter avatar Aug 07 '24 16:08 lutter

Yep, this used to fail before. The reason for the change in behavior is that at the time the issue was opened, the cfg!(debug_assertions) macro wasn't being used to set the reorg threshold in debug mode.

And now, while running tests (which are typically in debug mode), the cfg!(debug_assertions) macro is being applied, and the reorg threshold is set to 0 by default. unless explicitly set by "ETHEREUM_REORG_THRESHOLD" env var

shuaibbapputty avatar Aug 08 '24 01:08 shuaibbapputty