Skip to content

Commit

Permalink
Merge pull request #5436 from stacks-network/fix/metadata-table-block…
Browse files Browse the repository at this point in the history
…hash-index

feat: add blockhash index to metadata_table Clarity VM table
  • Loading branch information
hstove authored Nov 8, 2024
2 parents f0e434f + 4d93dd0 commit 7dc541f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
### Changed
- Add index for StacksBlockId to nakamoto block headers table (improves node performance)
- Remove the panic for reporting DB deadlocks (just error and continue waiting)
- Add index to `metadata_table` in Clarity DB on `blockhash`
- Add `block_commit_delay_ms` to the config file to control the time to wait after seeing a new burn block, before submitting a block commit, to allow time for the first Nakamoto block of the new tenure to be mined, allowing this miner to avoid the need to RBF the block commit.

## [3.0.0.0.1]
Expand All @@ -18,7 +19,7 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
- Add index for StacksBlockId to nakamoto block headers table (improves node performance)
- Remove the panic for reporting DB deadlocks (just error and continue waiting)
- Various test fixes for CI (5353, 5368, 5372, 5371, 5380, 5378, 5387, 5396, 5390, 5394)
- Various log fixes:
- Various log fixes:
- don't say proceeding to mine blocks if not a miner
- misc. warns downgraded to debugs
- 5391: Update default block proposal timeout to 10 minutes
Expand Down
6 changes: 6 additions & 0 deletions clarity/src/vm/database/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ impl SqliteConnection {
)
.map_err(|x| InterpreterError::SqliteError(IncomparableError { err: x }))?;

conn.execute(
"CREATE INDEX IF NOT EXISTS md_blockhashes ON metadata_table(blockhash)",
NO_PARAMS,
)
.map_err(|x| InterpreterError::SqliteError(IncomparableError { err: x }))?;

Self::check_schema(conn)?;

Ok(())
Expand Down

0 comments on commit 7dc541f

Please sign in to comment.