stacks-network / stacks-network/stacks-core

Drop the unused `overrides` table from the burnchain DB

Open
#7,340 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
3.1k
Forks
762
Avg merge
4d 6h
Merged PRs (30d)
76

Description

The overrides table in the burnchain DB (stackslib/src/burnchains/db.rs:285) looks like a band-aid from the past. Its schema comment describes an mechanism to override a reward cycle's affirmation map (e.g. to avoid a deep reorg from a hidden anchor block), but it appears to be dead:

  • There is no reader outside tests.
  • Only writer is test-only - #[cfg(test)] BurnchainDB::test_insert_override_row (db.rs:1043).

This came out in https://github.com/stacks-network/stacks-core/pull/7317#discussion_r3420200694, where rather than copy its always-empty rows we reclassified it as a schema-only table in the snapshot copy. If the table is deprecated, we should drop it instead (and also remove it from the snapshot)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in stackslib/src/burnchains/db.rs at the overrides table definition around line 285 and inspect the test-only test_insert_override_row helper around line 1043. Search the snapshot-copy code for handling of this table, then remove the deprecated table and its snapshot treatment. Run the relevant burnchain database tests to confirm the schema and snapshot behavior remain correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
blockchain, databases
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.