Skip to content

Commit 0ae7558

Browse files
committed
feat: add blockhash index to metadata_table Clarity VM table
1 parent 9c5d822 commit 0ae7558

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
1010
### Changed
1111
- Add index for StacksBlockId to nakamoto block headers table (improves node performance)
1212
- Remove the panic for reporting DB deadlocks (just error and continue waiting)
13+
- Add index to `metadata_table` in Clarity DB on `blockhash`
1314

1415
## [3.0.0.0.1]
1516

1617
### Changed
1718
- Add index for StacksBlockId to nakamoto block headers table (improves node performance)
1819
- Remove the panic for reporting DB deadlocks (just error and continue waiting)
1920
- Various test fixes for CI (5353, 5368, 5372, 5371, 5380, 5378, 5387, 5396, 5390, 5394)
20-
- Various log fixes:
21+
- Various log fixes:
2122
- don't say proceeding to mine blocks if not a miner
2223
- misc. warns downgraded to debugs
2324
- 5391: Update default block proposal timeout to 10 minutes

clarity/src/vm/database/sqlite.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,12 @@ impl SqliteConnection {
248248
)
249249
.map_err(|x| InterpreterError::SqliteError(IncomparableError { err: x }))?;
250250

251+
conn.execute(
252+
"CREATE INDEX IF NOT EXISTS md_blockhashes ON metadata_table(blockhash)",
253+
NO_PARAMS,
254+
)
255+
.map_err(|x| InterpreterError::SqliteError(IncomparableError { err: x }))?;
256+
251257
Self::check_schema(conn)?;
252258

253259
Ok(())

0 commit comments

Comments
 (0)