8000 grpc: backport block prunning fixes (#1271) to v0.38.x-experimental by cason · Pull Request #1473 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

grpc: backport block prunning fixes (#1271) to v0.38.x-experimental #1473

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

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

cason
Copy link
Contributor
@cason cason commented Oct 11, 2023

Partially addresses #1419:

  • commit 6fc2c37 depends on the gRPC endpoints so will be done at the end

This is part of the block pruning mechanism, it was not included in #1422 because it depends on #1471.


PR checklist

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments

* state: Invert logic of whether retain heights are set to be more readable

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor findMinRetainHeight logic for clarity and to respect config

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Rename findMinRetainHeight to findMinBlockRetainHeight for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Rename Pruner.SetApplicationRetainHeight to SetApplicationBlockRetainHeight for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Rename pruner SetCompanionRetainHeight to SetCompanionBlockRetainHeight for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor - shorten local variable name

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor - rename local method name for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor - remove redundant condition

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor - use helper instead of redefining logic

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor - shorten local variable names

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor - shorten local variable names

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor Pruner.SetApplicationBlockRetainHeight logic

The application retain height should be set regardless of what the
companion retain height is. Pruning should take place based on whichever
of the two values is lower. There is no need to consider the companion
retain height in this logic.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor Pruner.SetCompanionBlockRetainHeight logic

Similar refactor to that done for
Pruner.SetApplicationBlockRetainHeight. There is no need to consider the
application retain height during this function call.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor Pruner.SetABCIResRetainHeight logic

Aligns the logic of this method similar to that in the other retain
height setter methods. Also fixes a logic bug where setting the retain
height would skip updating the metrics.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor - shorten local variable names

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Simplify pruner logic assuming retain heights are always set

We can simplify the pruner logic if we assume that the initial retain
heights are always set on node startup.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* node: Tell pruner whether companion is enabled

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Expand error message detail

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state+store: Align tests with new logic

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor - shorten local variable names

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* rpc/grpc: Return trace IDs in error responses from pruning service

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* node: Refactor/expand pruning service initialization logic

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* test/e2e: Minor cosmetic tweaks to gRPC tests

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* test/e2e: Enable data companion pruning

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* node: Refactor - extract pruner creation as function

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* test/e2e: Only enable companion-based pruning on full nodes and validators

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Only start ABCI results pruning routine when data companion is enabled

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Fix TestMinRetainHeight logic

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* node: Fix companion retain height initialization logic

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* test/e2e: Expand testing framework

Allows explicit control over whether or not pruning should take a data
companion into account for full nodes or validators in our E2E
framework.

This allows greater flexibility in the E2E framework to test nodes both
with and without data companion-related functionality.

Expands our standard CI manifest to expect data companions attached to
two of the nodes.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Rename background routines

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* node: Apply change from code review

Signed-off-by: Thane Thomson <connect@thanethomson.com>

---------

Signed-off-by: Thane Thomson <connect@thanethomson.com>
@cason cason changed the title grpc: backport #1271 to v0.38.x-experimental grpc: backport PrunningService fixes (#1271) to v0.38.x-experimental Oct 11, 2023
@cason cason changed the title grpc: backport PrunningService fixes (#1271) to v0.38.x-experimental grpc: backport block prunning fixes (#1271) to v0.38.x-experimental Oct 11, 2023
@cason cason self-assigned this Oct 11, 2023
@cason cason added this to the 2023-Q4 milestone Oct 11, 2023
@cason cason added the grpc Anything r 8000 elating to the gRPC API label Oct 11, 2023
@cason cason marked this pull request as ready for review October 11, 2023 13:45
@cason cason requested a review from a team as a code owner October 11, 2023 13:45
@cason cason requested review from jmalicevic and hvanz October 11, 2023 14:02
Copy link
Contributor
@jmalicevic jmalicevic left a comment

Choose a reason for hiding this comment

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

Identical to origin PR.

@cason cason merged commit 10edde8 into v0.38.x-experimental Oct 11, 2023
@cason cason deleted the cason/backport-pr1271-v0.38-2 branch October 11, 2023 14:47
lasarojc pushed a commit that referenced this pull request Nov 13, 2023
* state: Invert logic of whether retain heights are set to be more readable



* state: Refactor findMinRetainHeight logic for clarity and to respect config



* state: Rename findMinRetainHeight to findMinBlockRetainHeight for clarity



* state: Rename Pruner.SetApplicationRetainHeight to SetApplicationBlockRetainHeight for clarity



* state: Rename pruner SetCompanionRetainHeight to SetCompanionBlockRetainHeight for clarity



* state: Refactor - shorten local variable name



* state: Refactor - rename local method name for clarity



* state: Refactor - remove redundant condition



* state: Refactor - use helper instead of redefining logic



* state: Refactor - shorten local variable names



* state: Refactor - shorten local variable names



* state: Refactor Pruner.SetApplicationBlockRetainHeight logic

The application retain height should be set regardless of what the
companion retain height is. Pruning should take place based on whichever
of the two values is lower. There is no need to consider the companion
retain height in this logic.



* state: Refactor Pruner.SetCompanionBlockRetainHeight logic

Similar refactor to that done for
Pruner.SetApplicationBlockRetainHeight. There is no need to consider the
application retain height during this function call.



* state: Refactor Pruner.SetABCIResRetainHeight logic

Aligns the logic of this method similar to that in the other retain
height setter methods. Also fixes a logic bug where setting the retain
height would skip updating the metrics.



* state: Refactor - shorten local variable names



* state: Simplify pruner logic assuming retain heights are always set

We can simplify the pruner logic if we assume that the initial retain
heights are always set on node startup.



* node: Tell pruner whether companion is enabled



* state: Expand error message detail



* state+store: Align tests with new logic



* state: Refactor - shorten local variable names



* rpc/grpc: Return trace IDs in error responses from pruning service



* node: Refactor/expand pruning service initialization logic



* test/e2e: Minor cosmetic tweaks to gRPC tests



* test/e2e: Enable data companion pruning



* node: Refactor - extract pruner creation as function



* test/e2e: Only enable companion-based pruning on full nodes and validators



* state: Only start ABCI results pruning routine when data companion is enabled



* state: Fix TestMinRetainHeight logic



* node: Fix companion retain height initialization logic



* test/e2e: Expand testing framework

Allows explicit control over whether or not pruning should take a data
companion into account for full nodes or validators in our E2E
framework.

This allows greater flexibility in the E2E framework to test nodes both
with and without data companion-related functionality.

Expands our standard CI manifest to expect data companions attached to
two of the nodes.



* state: Rename background routines



* node: Apply change from code review



---------

Signed-off-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Thane Thomson <connect@thanethomson.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grpc Anything relating to the gRPC API
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants
0