Skip to content

feat(keystore): Implement eth2util/keystore#218

Merged
iamquang95 merged 35 commits into
mainfrom
iamquang95/eth2util/keystore
Feb 19, 2026
Merged

feat(keystore): Implement eth2util/keystore#218
iamquang95 merged 35 commits into
mainfrom
iamquang95/eth2util/keystore

Conversation

@iamquang95
Copy link
Copy Markdown
Collaborator

@iamquang95 iamquang95 commented Feb 10, 2026

Fix: #167

This include: https://github.com/NethermindEth/charon-rs/pulls

Notice that crypto dependencies need to be built with optimize level 3, otherwise the test will be really slow (~20s)

The keystorev4 is based on https://github.com/sigp/lighthouse/tree/stable/crypto/eth2_keystore and https://eips.ethereum.org/EIPS/eip-2335

@iamquang95 iamquang95 changed the title Implement eth2util/keystore feat(keystore): Implement eth2util/keystore Feb 11, 2026

/// A share in the context of a Charon cluster, alongside its index.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct IndexedKeyShare {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Shouldn't it be in the eth2util/keystore (as it's done in the go implementation)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It's because of the cyclic dependency, the cluster depends on eth2utils
And to implement these methods in eth2utils it has to depend on cluster
Anw, these methods are all cluster related, then I move them to the cluster

Comment thread crates/cluster/src/manifest/cluster.rs Outdated
Comment thread crates/cluster/src/manifest/cluster.rs Outdated
Comment thread crates/cluster/src/manifest/cluster.rs Outdated
Comment on lines +120 to +121
/// validator public key associated to no keyshare.
pub fn keyshares_to_validator_pubkey(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also seems like it should be in the eth2util/keystore

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Comment thread crates/cluster/Cargo.toml Outdated
Comment thread crates/eth2util/src/keystore/load.rs Outdated
Comment thread crates/eth2util/src/keystore/load.rs Outdated
Comment thread crates/eth2util/src/keystore/load.rs Outdated
Comment thread crates/eth2util/src/keystore/load.rs Outdated
Comment thread crates/cluster/src/manifest/cluster.rs Outdated
Copy link
Copy Markdown
Collaborator

@varex83 varex83 left a comment

Choose a reason for hiding this comment

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

Will take a look at crypto part later, after checking the specs

Copy link
Copy Markdown
Collaborator

@varex83 varex83 left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread crates/eth2util/src/keystore/keystorev4.rs Outdated
Comment thread crates/eth2util/src/keystore/keystorev4.rs Outdated
Copy link
Copy Markdown
Collaborator

@emlautarom1 emlautarom1 left a comment

Choose a reason for hiding this comment

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

Generally LGTM, some small things only due to potential concurrency issues.

I did not review keystorev4 since it's a bit outside my set of skills. Couple of questions on this:

  • Did you come up with this implementation?
  • If not, from where?
  • Do you know anyone who could take a look at it and validate it?

I'm leaning on the fact that we've ported tests from Go to claim that it's OK but again I cannot fully validate it myself.

Comment thread crates/cluster/src/manifest/cluster.rs Outdated
Comment thread crates/cluster/src/manifest/cluster.rs Outdated
Comment thread crates/eth2util/src/keystore/store.rs Outdated
Comment thread crates/eth2util/src/keystore/store.rs Outdated
Comment thread crates/eth2util/src/keystore/store.rs Outdated
Comment thread crates/eth2util/src/keystore/load.rs
Comment thread crates/eth2util/src/keystore/load.rs Outdated
@iamquang95
Copy link
Copy Markdown
Collaborator Author

@emlautarom1

I did not review keystorev4 since it's a bit outside my set of skills. Couple of questions on this:
Did you come up with this implementation?
If not, from where?
Do you know anyone who could take a look at it and validate it?

As in the description, the keystorev4 implementation is based on https://github.com/sigp/lighthouse/tree/stable/crypto/eth2_keystore and https://eips.ethereum.org/EIPS/eip-2335.

Copy link
Copy Markdown
Collaborator

@emlautarom1 emlautarom1 left a comment

Choose a reason for hiding this comment

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

@iamquang95 I missed the link in the PR description, my bad! All good then.

@iamquang95 iamquang95 merged commit 05aba27 into main Feb 19, 2026
5 checks passed
@iamquang95 iamquang95 deleted the iamquang95/eth2util/keystore branch February 19, 2026 07:56
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.

Implement eth2util/keystore

3 participants