Skip to content

Remove maintenance#5157

Merged
graydon merged 7 commits intostellar:masterfrom
drebelsky:remove-maintenance
Feb 28, 2026
Merged

Remove maintenance#5157
graydon merged 7 commits intostellar:masterfrom
drebelsky:remove-maintenance

Conversation

@drebelsky
Copy link
Contributor

Gets rid of automatic maintenance, the ledgerheaders table, and lastclosedledger in storestate.

Copilot AI review requested due to automatic review settings February 25, 2026 22:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the automatic/manual maintenance subsystem and the ledgerheaders table by migrating the last-closed-ledger tracking from a hash (lastclosedledger) to an encoded LedgerHeader stored directly in storestate (lastclosedledgerheader).

Changes:

  • Remove Maintainer and the maintenance command/config knobs/docs.
  • Replace ledgerheaders persistence with base64-encoded LedgerHeader data stored in storestate.
  • Add schema v27 migration to move lastclosedledger + ledgerheaderslastclosedledgerheader and drop ledgerheaders.

Reviewed changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/transactions/TransactionFrame.cpp Drops now-unused LedgerHeaderUtils include.
src/test/test.cpp Removes test-only disabling of automatic maintenance.
src/main/PersistentState.h Renames LCL persistent key enum to kLastClosedLedgerHeader.
src/main/PersistentState.cpp Updates storestate mapping key to lastclosedledgerheader.
src/main/Maintainer.h Removes automatic maintenance component.
src/main/Maintainer.cpp Removes automatic maintenance implementation.
src/main/Config.h Removes automatic maintenance config fields.
src/main/Config.cpp Deprecates maintenance config keys (warn + ignore).
src/main/CommandLine.cpp Removes catchup/standalone maintenance overrides.
src/main/CommandHandler.h Removes maintenance route handler declaration.
src/main/CommandHandler.cpp Removes maintenance route and handler implementation.
src/main/ApplicationUtils.cpp Loads LCL protocol version from storestate-encoded header.
src/main/ApplicationImpl.h Removes Maintainer member and accessor.
src/main/ApplicationImpl.cpp Stops constructing/starting Maintainer.
src/main/Application.h Removes getMaintainer() from Application API.
src/ledger/LedgerManagerImpl.cpp Loads/stores LCL header from storestate instead of ledgerheaders.
src/ledger/LedgerHeaderUtils.h Adds encode/decode helpers and hash→data lookup API.
src/ledger/LedgerHeaderUtils.cpp Implements header encode/decode and hash→data lookup; removes old APIs.
src/history/test/HistoryTests.cpp Removes test-time manual maintenance calls.
src/history/HistoryManagerImpl.cpp Drops unused LedgerHeaderUtils include.
src/herder/test/HerderTests.cpp Drops unused LedgerHeaderUtils include.
src/herder/HerderImpl.cpp Adds SCP history trimming during slot erasure.
src/database/test/DatabaseTests.cpp Adds/updates tests for storestate and ledgerheaders migration behavior.
src/database/Database.h Bumps schema version to 27.
src/database/Database.cpp Adds v27 migration to move LCL header into storestate and drop ledgerheaders.
src/bucket/test/BucketManagerTests.cpp Removes test-time manual maintenance calls.
docs/stellar-core_example.cfg Removes maintenance config docs.
docs/software/commands.md Removes maintenance command docs.
docs/quick-reference.md Removes maintenance section.
Comments suppressed due to low confidence (1)

src/ledger/LedgerHeaderUtils.cpp:125

  • getHeaderDataForHash() declares std::shared_ptr<LedgerHeader> lhPtr; but never uses it. This will trigger an unused-variable warning and can be removed.
    ZoneScoped;
    std::shared_ptr<LedgerHeader> lhPtr;

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 29 out of 29 changed files in this pull request and generated 3 comments.

bboston7
bboston7 previously approved these changes Feb 27, 2026
Copy link
Contributor

@bboston7 bboston7 left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks for putting this together!

@graydon graydon enabled auto-merge February 27, 2026 23:06
@graydon graydon added this pull request to the merge queue Feb 27, 2026
Merged via the queue into stellar:master with commit dc44d5b Feb 28, 2026
54 checks passed
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