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: p2p alerts are not filterred in block chain info #3802

Merged
merged 1 commit into from
Jan 17, 2023

Conversation

doitian
Copy link
Member

@doitian doitian commented Jan 17, 2023

What problem does this PR solve?

Problem Summary:

The alerts returned in RPC get_blockchain_info will return all the alerts.

The expected behavior is that is should filter based on the alert version range requirements.

Related: #3800 (comment)

What is changed and how it works?

What's Changed:

The root cause is that when launcher passes client version to alert notifier, it uses the full format such as 0.107.0-rc1 (1b3e6b1 2023-01-12). However, the notifier internal uses semver to parse the version directly. If it fails, it will consider all alerts as effective.

The solution: The launcher pass the short version format to alert notifier.

Check List

Tests

  • Manual test (add detailed scripts or steps below)
    • Build the ckb
    • Run a testnet node, and call rpc get_blockchain_info
    • The alerts MUST be empty, since the built ckb version is not ckb v0.105.*.

Release note

Title Only: Include only the PR title in the release note.

The root cause is that when launcher passes client version to alert
notifier, it uses the full format such as `0.107.0-rc1 (1b3e6b1
2023-01-12)`. However, the notifier internal uses semver to parse the
version directly. If it fails, it will consider all alerts as effective.

The solution: The launcher pass the short version format to alert
notifier.
@doitian doitian requested a review from a team as a code owner January 17, 2023 08:04
@doitian doitian requested review from zhangsoledad and removed request for a team January 17, 2023 08:04
@doitian doitian merged commit 5c92ec7 into nervosnetwork:develop Jan 17, 2023
@doitian doitian deleted the bugfix/filter-alerts branch January 17, 2023 09:20
@doitian doitian mentioned this pull request Jan 17, 2023
2 tasks
bors bot added a commit that referenced this pull request Jan 18, 2023
3803: [hotfix 0.107.x] fix: p2p alerts are not filterred in block chain info r=zhangsoledad a=doitian

Rebase #3802 to v0.107.*

Merge #3804 first, which has upgraded tokio for https://rustsec.org/advisories/RUSTSEC-2023-0001

Co-authored-by: ian <[email protected]>
Co-authored-by: zhangsoledad <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants