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

refactor(core): make crypto module into crate #1800

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

SuperFluffy
Copy link
Member

@SuperFluffy SuperFluffy commented Nov 11, 2024

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

@github-actions github-actions bot added the sequencer pertaining to the astria-sequencer crate label Nov 11, 2024
@SuperFluffy SuperFluffy force-pushed the ENG-1003/crypto-to-crate branch 2 times, most recently from 04b35cd to 4e0a4f2 Compare November 11, 2024 14:50
@SuperFluffy SuperFluffy marked this pull request as ready for review November 11, 2024 14:50
@SuperFluffy SuperFluffy requested a review from a team as a code owner November 11, 2024 14:50
@SuperFluffy SuperFluffy changed the title refactor(core): move crypto module into crate refactor(core): make crypto module into crate Nov 11, 2024
@SuperFluffy SuperFluffy added core pertaining to the astria-core crate refactor code refactoring or maintainence labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core pertaining to the astria-core crate refactor code refactoring or maintainence sequencer pertaining to the astria-sequencer crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant