stacks-core icon indicating copy to clipboard operation
stacks-core copied to clipboard

Update SQLITE Version to support `STRICT` tables

Open ASuciuX opened this issue 1 year ago • 1 comments

According to the docs, the first sqlite_version that supports STRICT is 3.37.0. From the stacks-core, the sqlite_version is 3.33.0 and the tests were failing with this output:

Migrating chainstate schema from version 4 to 5: fix nakamoto tenure typo
thread 'chainstate::nakamoto::tests::test_make_miners_stackerdb_config' panicked at stackslib/src/net/mod.rs:2452:14:
called `Result::unwrap()` on an `Err` value: DBError(SqliteError(SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some("near \"STRICT\": syntax error"))))

The rusqlite version has to be updated so that the sqlite used supports strict tables. The sqlite version can be checked in two ways:

  1. by running a query as displayed in this PR
  2. by importing the version from the rusqlite https://docs.rs/rusqlite/latest/rusqlite/fn.version.html

ASuciuX avatar May 28 '24 14:05 ASuciuX

How to check after upgrading the rusqlite version (and sqlite version implicitly) that there are no breaking changes when communicating with other nodes having the old version. Is it enough to run unit + integration tests?

Is it enough to update the version and start migrating the tables to have STRICT?

Answer: After the sqlite version upgrade by running replay blocks with index range subcommand to select a random sample and test it multiple times.

ASuciuX avatar Jul 01 '24 14:07 ASuciuX

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

blockstack-devops avatar Oct 27 '24 00:10 blockstack-devops