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

Split tokens into a separate crate #4214

Closed
mversic opened this issue Jan 18, 2024 · 6 comments
Closed

Split tokens into a separate crate #4214

mversic opened this issue Jan 18, 2024 · 6 comments
Labels
iroha2-dev The re-implementation of a BFT hyperledger in RUST question Further information is requested

Comments

@mversic
Copy link
Contributor

mversic commented Jan 18, 2024

We should explore ways how to move smart_contract/default/tokens.rs into a separate crate that can be imported by both iroha_executor and iroha_client. The big problem to consider here is how to have that crate swappable because we want, not just default tokens, but also user defined tokens to be provided by this crate.

The solution we find for tokens will be a foundation for creating executor_data_model crate which will contain all structures that are shared by iroha_executor and iroha_client such as custom expression system.

I somehow don't feel this is possible to do. I think that every executor will define it's own executor_data_model crate which will then be imported by the client. When a user creates their own executor, they will also make their own executor_data_model which can (but doesn't have to) re-export iroha_default_executor_data_model

@mversic mversic added iroha2-dev The re-implementation of a BFT hyperledger in RUST question Further information is requested labels Jan 18, 2024
@mversic
Copy link
Contributor Author

mversic commented Jan 18, 2024

so in essence we can define iroha_default_executor_data_model but users of iroha will have to define their own data model crates

@Arjentix
Copy link
Contributor

I also think that would be the best approach.

Just the last note I have in mind.
Currently tokens are stored in the iroha_executor crate, not iroha_default_executor. I think we want to affiliate them with iroha_default_executor now, so iroha_default_executor_data_model sounds good to me.

@0x009922
Copy link
Contributor

I have a concern about swappable data model in general. Currently, probably the main reason to use an SDK is to safely build data model types. If data model is not static, then Iroha users (other devs) will have to build their own SDKs, which seems like a huge overhead.

Not entirely sure if my concern is 100% related to this issue.

@mversic
Copy link
Contributor Author

mversic commented Jan 19, 2024

Not entirely sure if my concern is 100% related to this issue.

Yes, your concern is related and valid

@Arjentix
Copy link
Contributor

Regarding SDK problem I think we should provide support for default types as we do now. But if users will decide that they need some kind of expressions or anything else they should be able to combine our SDK and their own data model

@mversic
Copy link
Contributor Author

mversic commented Jul 8, 2024

closed as part of #4791

@mversic mversic closed this as completed Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iroha2-dev The re-implementation of a BFT hyperledger in RUST question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants