Skip to content

Commit 7dc541f

Browse files
authored
Merge pull request #5436 from stacks-network/fix/metadata-table-blockhash-index
feat: add blockhash index to metadata_table Clarity VM table
2 parents f0e434f + 4d93dd0 commit 7dc541f

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,6 +10,7 @@ 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
- 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.
1415

1516
## [3.0.0.0.1]
@@ -18,7 +19,7 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
1819
- Add index for StacksBlockId to nakamoto block headers table (improves node performance)
1920
- Remove the panic for reporting DB deadlocks (just error and continue waiting)
2021
- Various test fixes for CI (5353, 5368, 5372, 5371, 5380, 5378, 5387, 5396, 5390, 5394)
21-
- Various log fixes:
22+
- Various log fixes:
2223
- don't say proceeding to mine blocks if not a miner
2324
- misc. warns downgraded to debugs
2425
- 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)