refactor(core): make crypto module into crate #1800
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Breaks out
astria_core::crypto
to crateastria-core-crypto
.Background
One needs to import the entire kitchensink that is
astria-core
even if one only wants to use a fraction of its types. That leads to extremely long compilation times because all of its dependencies need to be compiled.This patch is the start to breaking out parts of
astria-core
into their own free standing crates, whichastria-core
then reexports.A useful sideeffect of this change is that the coupling between the different parts of astria-core is reduced (for example, by removing the rarely used utility method
SigningKey::try_address
, allowing to decouple address and crypto logic).Changes
astria_core::crypto
into new createastria-core-crypto
and reexport under theastria_core::crypto
alias (not breaking to consumers)SigningKey::try_address
(rarely used and only inside a few tests) method and movingADDRESS_LENGTH
to a thinastria-core-consts
crate (this is a breaking change for users ofSigningKey::try_address
).Testing
Tests for astria core's crypto refinement types were moved to
astria-core-crypto
and left unchanged. Sequencer tests were updated to useAddress::builder
instead ofSigningKey::try_address
and otherwise also left unchanged.Changelogs
Changelogs updated.
Breaking Changelist
astria-core
due to the removal foSigningKey::try_address
but we don't provide any stability guarantees for it.Related Issues
Part of #1798