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

RemoveUntraceableHeaders #3750

Merged
merged 5 commits into from
Dec 13, 2024
Merged

RemoveUntraceableHeaders #3750

merged 5 commits into from
Dec 13, 2024

Conversation

roman-khimov
Copy link
Member

Problem

Keeping headers we no longer need.

Solution

Remove them along with blocks.

@roman-khimov roman-khimov added I3 Minimal impact U3 Regular enhancement Improving existing functionality S4 Routine labels Dec 13, 2024
@roman-khimov roman-khimov added this to the v0.107.2 milestone Dec 13, 2024
Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 71.87500% with 9 lines in your changes missing coverage. Please review.

Project coverage is 82.98%. Comparing base (727262a) to head (90b6a42).
Report is 23 commits behind head on master.

Files with missing lines Patch % Lines
pkg/core/dao/dao.go 50.00% 5 Missing and 1 partial ⚠️
pkg/core/blockchain.go 85.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3750      +/-   ##
==========================================
+ Coverage   82.83%   82.98%   +0.15%     
==========================================
  Files         335      335              
  Lines       46850    46782      -68     
==========================================
+ Hits        38806    38821      +15     
+ Misses       6450     6367      -83     
  Partials     1594     1594              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

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

It's too easy to forget about some part of the code that uses headers. We need to test:

  1. Chain state reset and further node synchronisation, just ensure that it goes normally. I didn't find anything in the code, but may be we missed something.
  2. Chain work with GC on/off, StateRootInheader on/off and KeepOnlyLatestState config on/off. Check that headers are removed properly, check that the node can be restarted and the rest of services work correctly.
  3. Ideally, P2P state exchange extension, but right now it's possible to test only with NeoFSBlockFetcher off (Implement headers fetching via NeoFS BlockFetcher service #3574).

docs/node-configuration.md Outdated Show resolved Hide resolved
pkg/core/dao/dao.go Show resolved Hide resolved
pkg/core/blockchain.go Outdated Show resolved Hide resolved
pkg/core/blockchain.go Outdated Show resolved Hide resolved
pkg/core/blockchain.go Outdated Show resolved Hide resolved
pkg/config/ledger_config.go Show resolved Hide resolved
pkg/core/blockchain.go Outdated Show resolved Hide resolved
With blocks available from NeoFS we can drop them from the local DB.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
It's there since 423c788, but looks like it
never changed anything, the same thing is done six lines above and tgtBlock is
not changed since.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
Transfer data is timestamp-based, previously it always had and used headers,
no we can go via a small cache (we don't want it to grow or be stored forever).
Otherwise it's unable to do the job:

    2024-12-13T12:55:15.056+0300    ERROR   failed to find block header for transfer GC     {"time": "19.066µs", "error": "key not found"}

Signed-off-by: Roman Khimov <roman@nspcc.ru>
Be a nice neighbor, try to reply with whatever headers we have, don't fail
completely because of a single missing header.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
@roman-khimov roman-khimov force-pushed the removeuntraceableheaders branch from 642416d to 90b6a42 Compare December 13, 2024 13:09
@AnnaShaleva AnnaShaleva merged commit 9834b83 into master Dec 13, 2024
33 of 34 checks passed
@AnnaShaleva AnnaShaleva deleted the removeuntraceableheaders branch December 13, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving existing functionality I3 Minimal impact S4 Routine U3 Regular
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants