chore: prepare split into protocol and standards#2184
Conversation
4c28b3e to
9128ed2
Compare
mmagician
left a comment
There was a problem hiding this comment.
the latter [
WellKnownComponent] should be defined inmiden-standards.
I wonder whether this will still be needed once we split out into miden-standards. WellKnownComponent is not really used much anyway (currently only inside tests, and as part of AccountComponentInterface logic afaics), and once we remove/refactor AccountComponentInterface, then we might be able to remove WellKnownComponent entirely.
It's not entirely clear to me yet how miden-standards crate will look like, but I imagine that any component exposed there would already be a "well-known component" by definition, and if needed, users would be able to import those via e.g.
use miden_standards::components::BasicWalletBut I think this can wait until the split is fully realized and we see how things look. For now the PR LGTM, thanks for breaking up the split into "preparation" and the split proper - makes reviewing much easier!
I agree! To facilitate the split into protocol and standards, this change is needed for now, but we can definitely reevaluate later. Adding one more change here: Moving |
I think this is related to #1855. Since we seem to cover it here, I'll assign it to you as well. |
|
While working on the next PR, I noticed I forgot to move |
This PR implements a few changes before tackling #1563. Builds on top of #2158.
Specifically:
AccountComponentInterfaceandWellKnownComponent.miden-protocolwhile the latter should be defined inmiden-standards.AccountComponentInterfacein its current form, but a minimal fix is still needed to unblock this issue.AccountComponentInterfacewill live inmiden-protocolwhileAccountComponentInterfaceExtwill be defined inmiden-standardsproviding the integration withWellKnownComponent.AccountInterfaceandWellKnownNotethroughAccountInterface::is_compatible_with.NoteConsumptionCheckeror somewhere else? If not, we could remove it. Similar to the above approach, though, for now this is fixed as part of the extension trait.build.rswill need to be shared between thebuild.rsfiles in the protocol and standards crate, for instance the error constants generation or walking masm files in a directory. The best approach seems to be to use aninclude!eventually.publish = falsewould make the crates that depend on that itself unpublishable, and adding a build-crate seems overkill.include!it in both protocol and standardsbuild.rsfiles.testingonly anyway). Tx kernel, protocol lib and standards. The main reason to split protocol out of tx kernel is that protocol errors do not necessarily need to fit into the tx kernel categories, and splitting them out allows us to validate that tx kernel errors do fit into a pre-defined category.