refactor(block): allow pruning when da disabled#3075
Conversation
|
The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).
|
|
Claude finished @julienrbrt's task in 1m 23s —— View job Code Review
Overall this is a clean, well-scoped change. The core approach — using
|
Summary of ChangesHello @julienrbrt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the block pruning logic to enable nodes to prune blocks regardless of whether Data Availability (DA) is configured. Previously, pruning was strictly tied to DA inclusion, which prevented non-DA nodes from managing their storage. The changes introduce a conditional pruning mechanism that adapts based on DA enablement, ensuring efficient disk space management for all node types while maintaining data integrity for DA-enabled setups. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the pruning mechanism to allow it to function even when the Data Availability (DA) layer is disabled. This is achieved by passing the DA address to the pruner, which then conditionally checks for DA inclusion height before pruning. If DA is disabled (no address provided), pruning proceeds based on the store height. The changes are well-implemented, include thorough tests for both DA-enabled and DA-disabled scenarios, and update the documentation accordingly. My only suggestion is to correct the changelog entry to accurately reflect the changes in this PR.
|
|
||
| ### Changes | ||
|
|
||
| - Store pending blocks separately from executed blocks key. [#3073](https://github.com/evstack/ev-node/pull/3073) |
There was a problem hiding this comment.
This changelog entry appears to be from a different pull request. This PR's changes are about allowing pruning when the DA layer is disabled. Please update the changelog to reflect the correct changes.
| - Store pending blocks separately from executed blocks key. [#3073](https://github.com/evstack/ev-node/pull/3073) | |
| - Allow pruning when the Data Availability (DA) layer is disabled. |
There was a problem hiding this comment.
nope, the changelog is unrelated to this pr (that do not require any)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3075 +/- ##
==========================================
+ Coverage 61.04% 61.10% +0.05%
==========================================
Files 113 113
Lines 11440 11444 +4
==========================================
+ Hits 6984 6993 +9
+ Misses 3674 3663 -11
- Partials 782 788 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
alpe
left a comment
There was a problem hiding this comment.
nice work. minor nits and comments
| } | ||
|
|
||
| // Never prune blocks that are not DA included | ||
| upperBound = min(storeHeight, currentDAIncluded) |
block/internal/pruner/pruner_test.go
Outdated
| func TestPrunerPruneBlocksWithoutDA(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| ctx := context.Background() |
There was a problem hiding this comment.
nit: here and others: use t.Context() instead
| _, _, err := stateStore.GetBlockData(ctx, h) | ||
| require.NoError(t, err, "expected block data at height %d to still exist (no pruning should have happened)", h) | ||
| } | ||
| } |
There was a problem hiding this comment.
it would be good to also test store height < da incl height for regression
… regression test Co-authored-by: julienrbrt <29894366+julienrbrt@users.noreply.github.com>
* Initial plan * Implement PR #3075 review comments: update test context usage and add regression test Co-authored-by: julienrbrt <29894366+julienrbrt@users.noreply.github.com> * Remove invalid regression test - DA inclusion height cannot exceed store height Co-authored-by: julienrbrt <29894366+julienrbrt@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: julienrbrt <29894366+julienrbrt@users.noreply.github.com>
|
Overview
follow-up of #2984 (ref #2984 (comment))