Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: zetaclient should check 'IsSupported' flag to pause/unpause a specific chain #1969

Merged
merged 7 commits into from
Apr 3, 2024

Conversation

ws4charlie
Copy link
Contributor

@ws4charlie ws4charlie commented Apr 1, 2024

Description

  1. Some basic refactor to simplify and unify names of loggers and functions.
  2. zetaclient will be able to pause/unpause a specific chain by checking the IsSupported flag in chain parameters.

What will be paused for EVM chain if IsSupported == false

  • - intx observation (Zeta, ERC20, Gas)
  • - intx tracker processing
  • - outtx keysign
  • - outtx tracker processing (outtx inclusion/confirmation)
  • - gas price watching
  • - RPC status watching

What will be paused for Bitcoin if IsSupported == false

  • - intx observation (BTC)
  • - intx tracker processing
  • - outtx keysign
  • - outtx tracker processing (outtx inclusion/confirmation)
  • - UTXO watching
  • - gas price watching
  • - RPC status watching

Closes: 1883

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Checklist:

  • I have added unit tests that prove my fix feature works

Copy link

github-actions bot commented Apr 1, 2024

!!!WARNING!!!
nosec detected in the following files: zetaclient/bitcoin/bitcoin_client.go, zetaclient/bitcoin/inbound_tracker.go, zetaclient/evm/evm_client.go, zetaclient/evm/inbounds.go

Be very careful about using #nosec in code. It can be a quick way to suppress security warnings and move forward with development, it should be employed with caution. Suppressing warnings with #nosec can hide potentially serious vulnerabilities. Only use #nosec when you're absolutely certain that the security issue is either a false positive or has been mitigated in another way.

Only suppress a single rule (or a specific set of rules) within a section of code, while continuing to scan for other problems. To do this, you can list the rule(s) to be suppressed within the #nosec annotation, e.g: /* #nosec G401 */ or //#nosec G201 G202 G203
Broad #nosec annotations should be avoided, as they can hide other vulnerabilities. The CI will block you from merging this PR until you remove #nosec annotations that do not target specific rules.

Pay extra attention to the way #nosec is being used in the files listed above.

@github-actions github-actions bot added the nosec label Apr 1, 2024
Copy link

codecov bot commented Apr 1, 2024

Codecov Report

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

Project coverage is 62.96%. Comparing base (fca927f) to head (965b945).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1969      +/-   ##
===========================================
- Coverage    63.08%   62.96%   -0.13%     
===========================================
  Files          233      233              
  Lines        13381    13407      +26     
===========================================
  Hits          8442     8442              
- Misses        4540     4566      +26     
  Partials       399      399              
Files Coverage Δ
zetaclient/zetacore_observer.go 17.82% <0.00%> (-0.27%) ⬇️
zetaclient/zetabridge/zetacore_bridge.go 0.00% <0.00%> (ø)
zetaclient/bitcoin/inbound_tracker.go 0.00% <0.00%> (ø)
zetaclient/evm/inbounds.go 69.32% <48.27%> (-0.59%) ⬇️
zetaclient/evm/evm_client.go 14.77% <7.86%> (-0.12%) ⬇️
zetaclient/bitcoin/bitcoin_client.go 16.43% <6.66%> (-0.21%) ⬇️

Copy link
Contributor

@kevinssgh kevinssgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a lot of renaming of variables and functions. Also moving the supported check to the client goroutines.

Overall looks good to me. Left some minor comments but approved anyway.

@ws4charlie ws4charlie merged commit ae29968 into develop Apr 3, 2024
20 of 21 checks passed
@ws4charlie ws4charlie deleted the fix-chain-IsSupported branch April 3, 2024 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zetaclient should check 'IsSupported' flag to be able to pause/unpause a specific chain
3 participants