-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(core): make crypto module into crate (#1800)
## Summary Breaks out `astria_core::crypto` to crate `astria-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, which `astria-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 - Move the module `astria_core::crypto` into new create `astria-core-crypto` and reexport under the `astria_core::crypto` alias (not breaking to consumers) - Remove the tight coupling between the crypto and address parts of the stack by removing the `SigningKey::try_address` (rarely used and only inside a few tests) method and moving `ADDRESS_LENGTH` to a thin `astria-core-consts` crate (this is a breaking change for users of `SigningKey::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 use `Address::builder` instead of `SigningKey::try_address` and otherwise also left unchanged. ## Changelogs Changelogs updated. ## Breaking Changelist - These changes leave all services untouched. - These changes would be breaking the public API of `astria-core` due to the removal fo `SigningKey::try_address` but we don't provide any stability guarantees for it. ## Related Issues Part of #1798
- Loading branch information
1 parent
471ee91
commit 401dfb5
Showing
14 changed files
with
127 additions
and
47 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "astria-core-consts" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
//! Public constants that are used throughout the Astria stack. | ||
pub const ADDRESS_LENGTH: usize = 20; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- markdownlint-disable no-duplicate-heading --> | ||
|
||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## Unreleased | ||
|
||
### Added | ||
|
||
- Initial release [#1800](https://github.com/astriaorg/astria/pull/1800) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[package] | ||
name = "astria-core-crypto" | ||
version = "0.1.0" | ||
edition = "2021" | ||
rust-version = "1.81.0" | ||
license = "MIT OR Apache-2.0" | ||
readme = "README.md" | ||
repository = "https://github.com/astriaorg/astria" | ||
homepage = "https://astria.org" | ||
|
||
[dependencies] | ||
astria-core-consts = { path = "../astria-core-consts" } | ||
|
||
base64 = { workspace = true } | ||
rand = { workspace = true } | ||
sha2 = { workspace = true } | ||
thiserror = { workspace = true } | ||
|
||
ed25519-consensus = { version = "2.1.0", default-features = false, features = [ | ||
"std", | ||
] } | ||
zeroize = { version = "1.7.0", features = ["zeroize_derive"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters