Skip to content

Conversation

@joyqvq
Copy link
Collaborator

@joyqvq joyqvq commented Oct 30, 2025

separated from #354

  • grpc helper and move type for committee-related structures
  • util for working with committee data

Description

Describe the changes or additions included in this PR.

Test plan

How did you test the new or updated feature?

Introduces a new seal-committee crate that provides helper utilities for:
- gRPC communication with Sui nodes
- Move type definitions for committee-related structures
- Utility functions for working with committee data

This crate serves as shared infrastructure for committee-related operations.
@joyqvq joyqvq changed the title Add seal-committee crate [commitee] add seal-committee crate with grpc and helper funcs Oct 30, 2025
/// Keys file structure for JSON/
#[derive(Serialize, Deserialize)]
pub struct KeysFile {
#[serde(
Copy link
Collaborator

Choose a reason for hiding this comment

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

since we control the format, why not use the existing ser/deser of all the types here (or add them where needed)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah we can just use the move byte literal, moving to the other pr

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah i remember the problem. the move byte deserleriazer is using x"0x... not a convention hex. its not compatible to use it for serde_json for file ser/de for enc_sk, enc_pk, signing_sk, signing_pk. its the most ergonomic if we just use hex for json. the x0x string is whats returned from grpc, so it had to be handled with its own deserializer (just for enc_pk and signing_pk).

Copy link
Collaborator

Choose a reason for hiding this comment

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

KeysFile only uses fastcrypto types, how is that related to move byte deserleriazer?

Copy link
Collaborator Author

@joyqvq joyqvq Nov 4, 2025

Choose a reason for hiding this comment

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

why not use the existing ser/deser of all the types here

oh i have an existing deserialization i added for move byte literals in seal-committee. this comment is unrelated then.

so i checked the fastcrypto ser/deser its in base64 - its slightly awkward because all move calls takes hex for vec instead. i think our options are

  1. use base64 to write, and covert it base64 -> hex in python script when exporting to env vars

  2. just store the hex (with custom ser/deser) like i do now

i find 2) is a bit cleaner since its all in rust. wdyt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

base64_to_hex() {
    echo -n "$1" | base64 -d 2>/dev/null | xxd -p -c 256 | sed 's/^/0x/'
}

ENC_PK_B64=$(jq -r '.enc_pk' .dkg.key)
SIGNING_PK_B64=$(jq -r '.signing_pk' .dkg.key)

export DKG_ENC_PK=$(base64_to_hex "$ENC_PK_B64")
export DKG_SIGNING_PK=$(base64_to_hex "$SIGNING_PK_B64")

@joyqvq joyqvq enabled auto-merge (squash) October 31, 2025 16:06
@joyqvq joyqvq merged commit bd08f8b into main Oct 31, 2025
8 checks passed
@joyqvq joyqvq deleted the joy/seal-committee-only branch October 31, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants