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

NODE-2622 Delete old data #3912

Merged
merged 68 commits into from
Jan 16, 2024
Merged

NODE-2622 Delete old data #3912

merged 68 commits into from
Jan 16, 2024

Conversation

vsuharnikov
Copy link
Member

@vsuharnikov vsuharnikov commented Nov 8, 2023

A new functionality for deletion of old data. It doesn't affect the main functionality of NODE.
Enabling this funcitonality starts a background cleanup and affects:

  • REST API:
    • GET /addresses/balance/$addr/$confirmations - confirmations should be <= 1000 to get a guaranteed result.
    • GET /addresses/balance
    • POST /addresses/balance
    • GET /assets/$asset/distribution/$height/limit/$limit
    • GET /debug/balances/history/$addr
    • GET /debug/stateWaves/$height
  • Explorer tool:
    • A - WAVES balance history for address
    • AA - Asset balance history for address

Changes:

  • New setting: waves.db.cleanup-interval . See more information in the config;
  • DB changes:
    • Data keys contain AddressId instead of PublicKeyHash;
    • Removed obsolete sequences: Score, BlockTransactionsFee, BlockReward, WavesAmount, HitSource, BloomFilterChecksum;
    • Added ChangedWavesBalances and LastCleanupHeight to support the new functionality;
  • Exporter now is stack-safe;
  • Improved Explorer compatibility with version-1.5.x and recent changes;
  • Fixed resource cleanup;
  • Support Apple ARM in node-it tests;
  • Added useful comments.

val updateAtKeys = new ArrayBuffer[Key[BalanceNode]]()

val changedKeyPrefix = KeyTags.ChangedWavesBalances.prefixBytes
val changedFromKey = Keys.changedWavesBalances(fromInclusive) // Doesn't matter, we need this only to parse
Copy link
Contributor

Choose a reason for hiding this comment

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

what does this comment mean?
changedFromKey is used not only for parsing but also in iterateOverWithSeek as "seek" parameter

Copy link
Member Author

Choose a reason for hiding this comment

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

It means, fromInclusive doesn't affect the parsing result. Changed the comment to make it clear.

import java.util
import java.util.concurrent.{AbstractExecutorService, TimeUnit}

object RunNowExecutorService extends AbstractExecutorService {
Copy link
Member

Choose a reason for hiding this comment

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

Is this not the same as MoreExecutors.newDirectExecutorService()?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@vsuharnikov vsuharnikov marked this pull request as ready for review January 15, 2024 11:28
@vsuharnikov vsuharnikov requested a review from phearnot as a code owner January 15, 2024 11:28
@phearnot phearnot merged commit f3cb220 into version-1.5.x Jan 16, 2024
2 checks passed
@phearnot phearnot deleted the NODE-2622-delete-old-data branch January 16, 2024 05:37
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.

4 participants