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

Prevent blocks from being skipped by ender #639

Merged
merged 3 commits into from
Oct 17, 2023

Conversation

Christopher-Li
Copy link
Contributor

Changelist

[Describe or list the changes made in this PR]

Test Plan

[Describe how this PR was tested (if applicable)]

Author/Reviewer Checklist

  • If this PR has changes that result in a different app state given the same prior state and transaction list, manually add the state-breaking label.
  • If this PR isn't state-breaking but has changes that modify behavior in PrepareProposal or ProcessProposal, manually add the label proposal-breaking.
  • If this PR is one of many that implement a specific feature, manually label them all feature:[feature-name].
  • If you wish to for mergify-bot to automatically create a PR to backport your change to a release branch, manually add the label backport/[branch-name].
  • Manually add any of the following labels: refactor, chore, bug.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 17, 2023

Walkthrough

The changes primarily focus on the block-cache.ts and its associated test file. The shouldSkipBlock function in block-cache.ts has been modified to include logging and a change in return value for a condition. Correspondingly, the test cases in block-cache.test.ts have been updated to reflect these changes.

Changes

File Path Summary
.../ender/src/caches/block-cache.ts Added logging in shouldSkipBlock function and changed a return value from false to true in a condition.
.../ender/__tests__/caches/block-cache.test.ts Updated test cases to match the changes in shouldSkipBlock function. Modified expected value for a condition from true to false.

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • Mention @coderabbitai in any review comment for bot assistance.
  • Note: Review comments are made on code diffs or files, not on the PR overview.

Pause Incremental Reviews

  • Insert @coderabbitai: ignore in the PR description to halt the bot's ongoing reviews. Remove the line to resume.
  • Additionally, enter @coderabbitai pause to halt the bot's ongoing reviews as any issue or review comment. To
    resume reviews, enter @coderabbitai resume as any issue or review comment.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Commits Files that changed from the base of the PR and between f0f134c and 382c9f6.
Files selected for processing (1)
  • indexer/services/ender/src/caches/block-cache.ts (2 hunks)
Additional comments (Suppressed): 2
indexer/services/ender/src/caches/block-cache.ts (2)
  • 54-63: The logging statement added here is a good addition for traceability and debugging. However, the return value of the shouldSkipBlock function has been changed from false to true when isNextBlock(blockHeight) is true. This is a significant change in the logic of the function. Ensure that this change is intentional and that it doesn't introduce any unexpected behavior in the parts of the codebase that use this function.

  • 84-87: The return value of the shouldSkipBlock function has been changed from false to true in this block as well. As with the previous comment, ensure that this change is intentional and that it doesn't introduce any unexpected behavior in the parts of the codebase that use this function.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Commits Files that changed from the base of the PR and between 382c9f6 and 2728550.
Files selected for processing (1)
  • indexer/services/ender/tests/caches/block-cache.test.ts (1 hunks)
Additional comments (Suppressed): 1
indexer/services/ender/__tests__/caches/block-cache.test.ts (1)
  • 60-63: The expected result for the condition block.height >= currentBlockHeight + 1 with refresh has been changed from true to false. This change aligns the test case with the updated behavior of the shouldSkipBlock function. Ensure that this change in behavior is intentional and correctly reflects the desired functionality.
- [false, 'block.height >= currentBlockHeight + 1 with refresh', '5', true],
+ [false, 'block.height >= currentBlockHeight + 1 with refresh', '5', false],

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Commits Files that changed from the base of the PR and between 2728550 and 387cbad.
Files selected for processing (1)
  • indexer/services/ender/tests/caches/block-cache.test.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • indexer/services/ender/tests/caches/block-cache.test.ts

@Christopher-Li Christopher-Li merged commit f4da098 into main Oct 17, 2023
11 checks passed
@Christopher-Li Christopher-Li deleted the cl_prevent_block_skipping branch October 17, 2023 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants