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 bugs in block polling logic and serialization #84

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

iuwqyir
Copy link
Collaborator

@iuwqyir iuwqyir commented Oct 2, 2024

TL;DR

Improved error handling and logging in the poller and serializer components.

What changed?

  • Enhanced logging in the poller to include the number of blocks being polled.
  • Added a check to skip polling when the start block is greater than the latest block.
  • Fixed a miscalculation issue in block range calculation due to pointer references.
  • Improved error handling in the serializer for nil block results.
  • Modified the serializer to use a dynamic slice instead of a fixed-size array for results.

How to test?

  1. Run the poller with various block ranges, including edge cases where the start block is greater than the latest block.
  2. Simulate scenarios where the RPC returns nil block results and verify proper error handling.
  3. Test the serializer with a large number of blocks to ensure dynamic slice allocation works correctly.
  4. Verify that the new log messages appear correctly in the debug output.

Why make this change?

These changes improve the robustness and reliability of the polling and serialization processes. By adding more detailed logging and error handling, it becomes easier to diagnose issues and prevent potential crashes. The modifications also optimize memory usage by using dynamic slices and fix a potential integer overflow bug in block range calculations.

Copy link
Collaborator Author

iuwqyir commented Oct 2, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @iuwqyir and the rest of your teammates on Graphite Graphite

@iuwqyir iuwqyir changed the title poller fixes Fix bugs in block polling logic and serialization Oct 2, 2024
@iuwqyir iuwqyir requested a review from AmineAfia October 2, 2024 12:24
@iuwqyir iuwqyir marked this pull request as ready for review October 2, 2024 12:24
Copy link
Collaborator Author

iuwqyir commented Oct 2, 2024

Merge activity

  • Oct 2, 10:26 AM EDT: @iuwqyir started a stack merge that includes this pull request via Graphite.
  • Oct 2, 10:26 AM EDT: @iuwqyir merged this pull request with Graphite.

@iuwqyir iuwqyir merged commit c54223e into main Oct 2, 2024
4 checks passed
@iuwqyir iuwqyir deleted the 10-02-poller_fixes branch October 2, 2024 14:26
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