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

Replace immutable strings with ConstString #2073

Closed
mversic opened this issue Apr 8, 2022 · 3 comments
Closed

Replace immutable strings with ConstString #2073

mversic opened this issue Apr 8, 2022 · 3 comments
Assignees
Labels
Chore This is a small task that can be done at any point in time and is easier than others good first issue Good for newcomers iroha2-dev The re-implementation of a BFT hyperledger in RUST Optimization Something isn't working as well as it should

Comments

@mversic
Copy link
Contributor

mversic commented Apr 8, 2022

In some places, namely data_model and crypto library there are immutable structures which store Strings that can never be modified. Examples include PublicKey, PrivateKey, IpfsPath, ...

Grep the codebase for Strings and make use of the newly added ConstString instead of std::String where applicable to reduce the memory footprint. #1985

@mversic mversic added iroha2-dev The re-implementation of a BFT hyperledger in RUST Optimization Something isn't working as well as it should labels Apr 8, 2022
@mversic mversic changed the title Immutable owned strings Replace immutable strings with ConstString Jul 6, 2022
@mversic mversic added good first issue Good for newcomers Chore This is a small task that can be done at any point in time and is easier than others labels Jul 6, 2022
@ales-tsurko ales-tsurko self-assigned this Jul 15, 2022
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 18, 2022
Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
@ales-tsurko
Copy link
Contributor

ales-tsurko commented Jul 18, 2022

It's impossible to make it for crypto (because of the cyclic dependencies) untill either #2386 or #2392 is done. Will open a PR for iroha_data and its dependencies though.

ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 18, 2022
…odel

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 18, 2022
…odel

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 19, 2022
…odel

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 19, 2022
…odel

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 19, 2022
…odel

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 19, 2022
…odel

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 19, 2022
…odel

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
@mversic
Copy link
Contributor Author

mversic commented Jul 19, 2022

It's impossible to make it for crypto (because of the cyclic dependencies) untill either #2386 or #2392 is done. Will open a PR for iroha_data and its dependencies though.

would it be possible to extract data_model/primitives into a separate lib as part of this PR? This will also be useful for the upcoming refactor.

@ales-tsurko
Copy link
Contributor

It's impossible to make it for crypto (because of the cyclic dependencies) untill either #2386 or #2392 is done. Will open a PR for iroha_data and its dependencies though.

would it be possible to extract data_model/primitives into a separate lib as part of this PR? This will also be useful for the upcoming refactor.

Yeah, I can do that.

ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 19, 2022
…odel

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 19, 2022
…te crate

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 19, 2022
… crate

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 19, 2022
…ared crate

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 19, 2022
…ared crate

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 19, 2022
Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 20, 2022
…odel

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 20, 2022
…ared crate

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 20, 2022
Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 20, 2022
Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 21, 2022
Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 21, 2022
…odel

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 21, 2022
…ared crate

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 21, 2022
Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 21, 2022
Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 22, 2022
…odel

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 22, 2022
…ared crate

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 22, 2022
Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit to ales-tsurko/iroha that referenced this issue Jul 22, 2022
Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
ales-tsurko added a commit that referenced this issue Jul 22, 2022
…in (#2505)

* [feature] #2073: Prefer ConstString over String for data_model

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>

* [feature] #2073: Encapsulate iroha_data_primitives into shared crate

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>

* [feature] #2073: Use ConstString in crypto

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>

* [feature] #2073: Rename data_primitives crate into primitives

Signed-off-by: Ales Tsurko <ales.tsurko@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chore This is a small task that can be done at any point in time and is easier than others good first issue Good for newcomers iroha2-dev The re-implementation of a BFT hyperledger in RUST Optimization Something isn't working as well as it should
Projects
None yet
Development

No branches or pull requests

2 participants