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

[Feature]: Bump the version of our stacks-core dependency #411

Closed
1 task done
djordon opened this issue Aug 9, 2024 · 1 comment · Fixed by #444
Closed
1 task done

[Feature]: Bump the version of our stacks-core dependency #411

djordon opened this issue Aug 9, 2024 · 1 comment · Fixed by #444
Labels
sbtc bootstrap signer The sBTC Bootstrap Signer.

Comments

@djordon
Copy link
Contributor

djordon commented Aug 9, 2024

Feature - Bump the version of our stacks-core dependency

1. Description

The signer binary pulls in crates from the a fork of the stacks-core repo but from a slightly modified version of the develop branch. This code is likely out of date with the latest Nakamoto changes so we will likely need to update it.

1.1 Context & Purpose

We need the latest version of stacks-core crates so that there is no discrepancy of the types when we communicate with stacks core.

We currently cannot rely on the official stacks-core crates because of a dependency conflict with sqlx. Our sqlx dependency pulls in sqlite as a dependency because the macros and/or migrate features pull it in, and our libstacks dependency pulls in sqlite as well. There is a conflict because the versions don't match and they need to match exactly (because sqlite is basically a C dependency). There is no way around this conflict without doing one of the following:

  1. Maintain our own version of stacks-core with a version of rusqlite that is compatible with the version used by sqlx. This is what we currently do.
  2. Update stacks-core's to a version of rusqlite that is compatible with the version used by sqlx.
  3. Refactor stacks-core so that the sqlite dependency is always optional. It's supposed to be optional for many of the crates there, just not for the libstacks crate.
  4. Change sqlx so that we do not pull in the sqlite dependency ever (either the official crate our by fixing it and using our own version).
  5. Remove our sqlite dependency from sqlx by not using the features that pull in sqlite.

I don't want to do (1) anymore but it's the lowest amount of work. I'd love to do (3) but that is probably out of the question. (5) is the second lowest lift, but requires us to give up on all sqlx macros.

2. Technical Details:

2.1 Acceptance Criteria:

  • Use the latest version of the stacks-core crates.

3. Related Issues and Pull Requests (optional):

@djordon djordon added the sbtc bootstrap signer The sBTC Bootstrap Signer. label Aug 9, 2024
@djordon djordon added this to the sBTC Code Complete milestone Aug 16, 2024
@djordon
Copy link
Contributor Author

djordon commented Aug 22, 2024

A few of notes:

  1. The issue that we have with a sqlite conflict is a well known sqlx issue [KNOWN ISSUE] Unexpected/unwanted crates in Cargo.lock launchbadge/sqlx#3211 that is actually caused by a cargo bug Disabled optional weak dependencies end up in Cargo.lock rust-lang/cargo#10801.
  2. stacks-core recently updated their dependencies (on the develop branch) to use the latest rusqlite, which pulls in the latest libsqlite-sys. The latest version of sqlx, version 0.8.0, uses the same libsqlite-sys version.
  3. We need to remove the migrate, json, and time sqlx features in order to not make it seem like we don't pull in libsqlite-sys. After refactor: automatically set created_at columns #436 was merged, we don't actually use the json and time features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sbtc bootstrap signer The sBTC Bootstrap Signer.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant