Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rusqlite version (and sqlite) #4948

Merged
merged 13 commits into from
Jul 8, 2024
Merged

Update rusqlite version (and sqlite) #4948

merged 13 commits into from
Jul 8, 2024

Conversation

ASuciuX
Copy link
Contributor

@ASuciuX ASuciuX commented Jul 3, 2024

Description

Updates rusqlite to latest version 0.31.0. That updates the sqlite version used by it from 3.33.0 to 3.45.0.

Applicable issues

Additional info (benefits, drawbacks, caveats)

Checklist

  • update rusqlite version to 0.31.0
  • update changed methods
    • NO_PARAMS: got removed from rusqlite. create const equivalent in stacks_commons where sqlite related data was defined
    • get_raw renamed to get_ref
    • query and query_rows header updated constraints on the generic type P: 0.24.2 vs 0.31.0
  • use params! macro in all implementations the same way instead of having &[&variable as &dyn ToSql] / params! / rusqlite::params! across the codebase
    • explicitly define the type &[&dyn ToSql] where params! is used
  • update ToSql to be use rusqlite::Types::ToSql everywhere instead of a combination of use rusqlite::Types::ToSql and use rusqlite::ToSql
  • pass tests running RUST_BACKTRACE=1 BITCOIND_TEST=1 cargo nextest run --test-threads 1
    • fixed these 2 tests from stacks-signer are failing
      Summary [1733.775s] 5141 tests run: 5141 passed (2 slow), 195 skipped
      
  • run stacks-inspect with index range for blocks to check no breaking changes
    • last 1k blocks - from 2.5.0.0.5-latest archive
    • first 1k blocks
    • range
      • 99,990 to 100,000
      • 150,000 to 150,400
      • 132,000 to 132,300
      • 116,200 to 116,800

@ASuciuX ASuciuX added this to the Nakamoto-3.0.x milestone Jul 3, 2024
@ASuciuX ASuciuX self-assigned this Jul 3, 2024
@ASuciuX ASuciuX requested review from a team as code owners July 3, 2024 19:46
@ASuciuX ASuciuX marked this pull request as draft July 3, 2024 19:46
kantai
kantai previously approved these changes Jul 4, 2024
Copy link
Member

@kantai kantai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, but it looks like you need to run cargo fmt-stacks

@ASuciuX ASuciuX marked this pull request as ready for review July 4, 2024 20:09
@ASuciuX ASuciuX linked an issue Jul 4, 2024 that may be closed by this pull request
their role is to be aware of the current underline sqlite version in order to know the sqlite features available
@ASuciuX
Copy link
Contributor Author

ASuciuX commented Jul 5, 2024

How to check if nakamoto tenure table is empty?

If it is, this migration can be done to have it with STRICT cdf3398.
Otherwise, what should be done?

@kantai
Copy link
Member

kantai commented Jul 5, 2024

How to check if nakamoto tenure table is empty?

If it is, this migration can be done to have it with STRICT cdf3398.
Otherwise, what should be done?

There's an open PR (#4930) which drops and recreates the tenure table.
If this PR (#4948) merges before #4930, we can add the STRICT keyword to that PR. If #4930 merges first, we can add it in this PR.

@ASuciuX
Copy link
Contributor Author

ASuciuX commented Jul 5, 2024

Done, I removed the nakamoto tenure table recreation from this PR.

kantai
kantai previously approved these changes Jul 5, 2024
@ASuciuX
Copy link
Contributor Author

ASuciuX commented Jul 6, 2024

I've canceled the mutants workflow as it already run here and it will get into timeout with the same mutants caught https://github.com/stacks-network/stacks-core/actions/runs/9809500036.

jferrant
jferrant previously approved these changes Jul 8, 2024
clarity/Cargo.toml Outdated Show resolved Hide resolved
@jbencin
Copy link
Contributor

jbencin commented Jul 8, 2024

Can you a quick benchmark with hyperfine stacks-inspect replay-block ... before merging? I'm curious if this changes anything

@ASuciuX
Copy link
Contributor Author

ASuciuX commented Jul 8, 2024

Can you a quick benchmark with hyperfine stacks-inspect replay-block ... before merging? I'm curious if this changes anything

  • stacks-inspect-new is using the latest commit from this PR
  • stacks-inspect-old is using the commit before the first one from this PR 1f5d9d48a6896bc956bd4873279dd5df0e3ac812
hyperfine -w 3 -r 10 "./stacks-inspect-new replay-block ~/mainnet-archive-4-july range 99990 100000" "./stacks-inspect-old replay-block ~/mainnet-archive-4-july range 99990 100000"
Benchmark 1: ./stacks-inspect-new replay-block ~/mainnet-archive-4-july range 99990 100000
  Time (mean ± σ):     10.554 s ±  0.043 s    [User: 9.354 s, System: 1.145 s]
  Range (min … max):   10.502 s … 10.640 s    10 runs

Benchmark 2: ./stacks-inspect-old replay-block ~/mainnet-archive-4-july range 99990 100000
  Time (mean ± σ):     10.606 s ±  0.120 s    [User: 9.414 s, System: 1.137 s]
  Range (min … max):   10.490 s … 10.795 s    10 runs

@kantai kantai added this pull request to the merge queue Jul 8, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 8, 2024
@ASuciuX ASuciuX added this pull request to the merge queue Jul 8, 2024
Merged via the queue into develop with commit 05c78e6 Jul 8, 2024
1 check passed
@blockstack-devops
Copy link
Contributor

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

@stacks-network stacks-network locked as resolved and limited conversation to collaborators Oct 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Status: Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Update SQLITE Version to support STRICT tables
5 participants