Skip to content

Conversation

@thomas-nguy
Copy link
Collaborator

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

@thomas-nguy thomas-nguy requested a review from a team as a code owner November 21, 2025 13:37
@thomas-nguy thomas-nguy requested review from XinyuCRO and calvinaco and removed request for a team November 21, 2025 13:37
@github-actions

This comment has been minimized.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 21, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@JayT106 JayT106 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@calvinaco calvinaco left a comment

Choose a reason for hiding this comment

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

I believe the original place to update the h.lastBlockList is actually ok - more precisely: it's not the best place...but it's not posing any problems.

If we put it at the end only after block list is successfully updated:

  1. if the new block list is empty, h.lastBlockList never get updated. This is minor as it will early return immediately.
  2. There're a few reasons blocklist may fail to be decrypted but they are not going to be recovered in next SetBlockList call.
    1. Node identity is incorrect. Node identity cannot be updated in run-time, only via restart. So the decrypt would always fail in SetBlockList.
    2. Blocklist is corrupted, either encryption error or invalid content. Still SetBlockList will continue to fail until another blocklist update.

In terms of code readability and cleanliness, moving h.lastBlockList updates to any place returning nil (including inside the empty check) is appropriate. But practically it is not creating any issues if I am not mistaken.

@thomas-nguy
Copy link
Collaborator Author

Blocklist is corrupted, either encryption error or invalid content. Still SetBlockList will continue to fail until another blocklist update.

Currently if the blocklist cannot be decrypted, it will fail only at the next block but from the next block, the error will be ignored. Is it your expected behavior?

@thomas-nguy thomas-nguy marked this pull request as draft November 24, 2025 10:04
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.

3 participants