bor icon indicating copy to clipboard operation
bor copied to clipboard

core: remove tracing and handle err in reorg call

Open manav2401 opened this issue 1 year ago • 2 comments

Description

This PR does 2 things:

  • Removes tracing in writeBlockAndSetHead function: tracing isn't used anymore and this simplifies the code a lot
  • Fixes a bug when the reorg function returns error (when we receive an error we update the status to NonStatTy but don't return at that point. Later the status is updated irrespective of the above error and may lead to wrong processing. This PR fixes that and returns from the function immediately). This change also matches with the upstream implementation of the same function.

Changes

  • [x] Bugfix (non-breaking change that solves an issue)
  • [ ] Hotfix (change that solves an urgent issue, and requires immediate attention)
  • [ ] New feature (non-breaking change that adds functionality)
  • [ ] Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • [ ] Changes only for a subset of nodes

Breaking changes

Please complete this section if any breaking changes have been made, otherwise delete it

Nodes audience

In case this PR includes changes that must be applied only to a subset of nodes, please specify how you handled it (e.g. by adding a flag with a default value...)

Checklist

  • [x] I have added at least 2 reviewer or the whole pos-v1 team
  • [x] I have added sufficient documentation in code
  • [x] I will be resolving comments - if any - by pushing each fix in a separate commit and linking the commit hash in the comment reply
  • [ ] Created a task in Jira and informed the team for implementation in Erigon client (if applicable)
  • [ ] Includes RPC methods changes, and the Notion documentation has been updated

Cross repository changes

  • [ ] This PR requires changes to heimdall
    • In case link the PR here:
  • [ ] This PR requires changes to matic-cli
    • In case link the PR here:

Testing

  • [ ] I have added unit tests
  • [ ] I have added tests to CI
  • [ ] I have tested this code manually on local environment
  • [ ] I have tested this code manually on remote devnet using express-cli
  • [ ] I have tested this code manually on mumbai
  • [ ] I have created new e2e tests into express-cli

Manual tests

Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it

Additional comments

Please post additional comments in this section if you have them, otherwise delete it

manav2401 avatar Feb 22 '24 13:02 manav2401

Codecov Report

Attention: Patch coverage is 81.81818% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 51.50%. Comparing base (1912ac4) to head (aa3b37b). Report is 20 commits behind head on develop.

Files Patch % Lines
core/blockchain.go 81.81% 1 Missing and 1 partial :warning:
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1165      +/-   ##
===========================================
+ Coverage    51.45%   51.50%   +0.04%     
===========================================
  Files          794      794              
  Lines       131277   131240      -37     
===========================================
+ Hits         67555    67589      +34     
+ Misses       59553    59471      -82     
- Partials      4169     4180      +11     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 22 '24 14:02 codecov[bot]

Any reason why the e2e and integration tests did not run here?

marcello33 avatar Mar 18 '24 09:03 marcello33

Closing in favour of https://github.com/maticnetwork/bor/pull/1193

manav2401 avatar Apr 08 '24 05:04 manav2401