stacks-network / stacks-network/stacks-core
Drop the unused `overrides` table from the burnchain DB
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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