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

Immutable payload in iroha_crypto #2573

Closed
mversic opened this issue Aug 1, 2022 · 2 comments
Closed

Immutable payload in iroha_crypto #2573

mversic opened this issue Aug 1, 2022 · 2 comments
Assignees
Labels
crypto iroha2-dev The re-implementation of a BFT hyperledger in RUST

Comments

@mversic
Copy link
Contributor

mversic commented Aug 1, 2022

Check this comment. Payload (currently a Vec<u8>) in structures like PublicKey, PrivateKey and Signature is immutable for the lifetime of the wrapping type. This means that capacity field of the Vec is redundant and could be removed to reduce the size. A similar thing was done in #1985

@mversic mversic added iroha2-dev The re-implementation of a BFT hyperledger in RUST Red labels Aug 1, 2022
@Arjentix
Copy link
Contributor

Arjentix commented Aug 1, 2022

Probably we can somehow generalize this to no to repeate the code for Name struct

@appetrosyan appetrosyan self-assigned this Aug 11, 2022
@appetrosyan
Copy link
Contributor

This is a different situation.

In case of ConstStr we want to be able to heap-allocate objects beyond a certain length.

Keys are all stored in enums, immutable and their length is known at compile time. It's likely that the final implementation is going to be a newtype wrapping [u8; X] where X is determined for each key as a constant. (const generics are stable).

@appetrosyan appetrosyan removed the Red label Sep 12, 2022
@DCNick3 DCNick3 self-assigned this Aug 31, 2023
DCNick3 added a commit to DCNick3/iroha that referenced this issue Aug 31, 2023
…bytes values that are not changing

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Aug 31, 2023
…bytes values that are not changing

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 1, 2023
…unction args

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 1, 2023
… naming

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 1, 2023
…g attributes to lib.rs

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 1, 2023
Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 1, 2023
…n proc macros

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 1, 2023
…bytes values that are not changing

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 4, 2023
…bytes values that are not changing

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 4, 2023
…bytes values that are not changing

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 4, 2023
…bytes values that are not changing

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 4, 2023
…bytes values that are not changing

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 4, 2023
…unction args

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 4, 2023
… naming

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 4, 2023
…g attributes to lib.rs

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 4, 2023
Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 4, 2023
…n proc macros

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 4, 2023
…bytes values that are not changing

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 4, 2023
…bytes values that are not changing

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 4, 2023
…unction args

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 4, 2023
… naming

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 4, 2023
…g attributes to lib.rs

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 4, 2023
Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 4, 2023
…n proc macros

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit that referenced this issue Sep 5, 2023
Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit that referenced this issue Sep 5, 2023
Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit that referenced this issue Sep 5, 2023
…s to lib.rs

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit that referenced this issue Sep 5, 2023
Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit that referenced this issue Sep 5, 2023
Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 6, 2023
…at holds any const sequence

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 6, 2023
…at holds any const sequence

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 6, 2023
…bytes values that are not changing

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit to DCNick3/iroha that referenced this issue Sep 6, 2023
…at holds any const sequence

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
mversic pushed a commit to DCNick3/iroha that referenced this issue Sep 7, 2023
…bytes values that are not changing

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
mversic pushed a commit to DCNick3/iroha that referenced this issue Sep 7, 2023
…at holds any const sequence

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit that referenced this issue Sep 7, 2023
…s that are not changing

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
DCNick3 added a commit that referenced this issue Sep 7, 2023
…y const sequence

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
@DCNick3 DCNick3 closed this as completed Oct 17, 2023
mversic pushed a commit that referenced this issue Oct 17, 2023
Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
mversic pushed a commit that referenced this issue Oct 17, 2023
Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
mversic pushed a commit that referenced this issue Oct 17, 2023
…s to lib.rs

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
mversic pushed a commit that referenced this issue Oct 17, 2023
Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
mversic pushed a commit that referenced this issue Oct 17, 2023
Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
mversic pushed a commit that referenced this issue Oct 17, 2023
…s that are not changing

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
mversic pushed a commit that referenced this issue Oct 17, 2023
…y const sequence

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
@DCNick3 DCNick3 added the crypto label Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crypto iroha2-dev The re-implementation of a BFT hyperledger in RUST
Projects
None yet
Development

No branches or pull requests

4 participants