Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

feat: add chain ID to handles #474

Merged
merged 1 commit into from
Apr 8, 2025
Merged

Conversation

dartdart26
Copy link
Collaborator

Add a 64 bit chain ID unsigned value (in big endian) to the handle, making the handle format the following, in order from first to last byte:

  • 21 bytes from hashing the ciphertext
  • 1 byte index
  • 8 bytes of chain ID
  • 1 byte of ciphertext type
  • 1 byte of version

Resolves: #436

Implementation taken from the following PR from @goshawk-3: https://github.com/zama-ai/httpz-backend/pull/458/files#

Changing the chain ID type from i32 to u64 throughout the codebase will be done in a separate commit.

@dartdart26 dartdart26 requested a review from a team as a code owner April 8, 2025 13:43
@cla-bot cla-bot bot added the cla-signed label Apr 8, 2025
@dartdart26 dartdart26 requested a review from jatZama April 8, 2025 13:44
@dartdart26 dartdart26 self-assigned this Apr 8, 2025
Copy link
Member

@jatZama jatZama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dartdart26
Copy link
Collaborator Author

You can ignore most of the lines as they are due to fmt. Only look at the handle changes (3-4 lines).

Reminds me we need to enforce fmt and clippy once we are done.

Add a 64 bit chain ID unsigned value (in big endian) to the handle,
making the handle format the following, in order from first to last byte:

 * 21 bytes from hashing the ciphertext
 * 1 byte index
 * 8 bytes of chain ID
 * 1 byte of ciphertext type
 * 1 byte of version

Resolves: #436

Implementation taken from the following PR from @goshawk-3:
https://github.com/zama-ai/httpz-backend/pull/458/files#

Changing the chain ID type from i32 to u64 throughout the codebase will
be done in a separate commit.
@dartdart26 dartdart26 force-pushed the petar/chain-id-in-handle branch from 029898c to 7f7a502 Compare April 8, 2025 14:30
@dartdart26 dartdart26 merged commit af72a16 into new-types Apr 8, 2025
5 checks passed
@dartdart26 dartdart26 deleted the petar/chain-id-in-handle branch April 8, 2025 15:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants