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

Fix typo in `nakamoto_tenures` table

Open obycode opened this issue 9 months ago • 1 comments

Describe the bug There is a typo in the definition of the nakamoto_tenures table:

https://github.com/stacks-network/stacks-core/blob/b7f7295775ba8571ed322846367451fc6bf44126/stackslib/src/chainstate/nakamoto/tenure.rs#L132

It didn't cause any problems because it seems that sqlite will default to NUMERIC type if it can't figure it out. Despite that, this typo should be fixed. Since this is already released with the typo, we might need to be careful about just changing the schema.

obycode avatar May 13 '24 19:05 obycode

@kantai mentioned that https://www.sqlite.org/stricttables.html would have caught this.

obycode avatar May 14 '24 00:05 obycode

Yep -- I think the appropriate thing to do in this case, is to drop the table and recreate it with a schema version number switch. Because no entries in this table exist yet, this is safe.

This should be a good first use case for the STRICT keyword in the recreated table.

kantai avatar May 14 '24 19:05 kantai

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 28 '24 00:10 blockstack-devops