Skip to content

feat(cluster): add load_cluster_lock (backport Charon #4130)#523

Open
emlautarom1-agent[bot] wants to merge 3 commits into
mainfrom
worktree-load-cluster-lock
Open

feat(cluster): add load_cluster_lock (backport Charon #4130)#523
emlautarom1-agent[bot] wants to merge 3 commits into
mainfrom
worktree-load-cluster-lock

Conversation

@emlautarom1-agent

@emlautarom1-agent emlautarom1-agent Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds pluto_cluster::load::load_cluster_lock, a direct cluster-lock loader and verifier that mirrors Charon's cluster.LoadClusterLock (cluster/load.go). It reads the lock file, JSON-decodes it into a Lock, and verifies its hashes and signatures — the loading path the run command needs to obtain a cluster. A load_cluster_lock_and_verify convenience wrapper (mirroring cluster.LoadClusterLockAndVerify) is also provided for standalone tools that have no execution-layer endpoint to inject.

This is required as a consequence of Charon #4130, which removed the cluster manifest and replaced the manifest-DAG loading path with direct lock loading. cluster.LoadClusterLock did not exist in Charon v1.7.1 (there, the cluster was materialised from a manifest DAG), so this function is the backported piece Pluto needs.

Pluto is dropping support for manifest files. That decision was taken some time ago, which is why the manifest-related modules (cluster/manifest, cluster/manifestpb) were never ported to production use and remain as un-ported legacy. Because Pluto has no manifest-based loader, this direct lock loader is the only loading path — there is intentionally no manifest-file fallback like the one v1.7.1 carried.

Out of scope

  • The Cluster-Uuid P2P header that #4130 also introduced (relay load-balancing) is not ported here — a separate concern, not needed until relay support lands.

emlautarom1-agent Bot and others added 2 commits July 3, 2026 14:07
Introduces cluster::load::load_cluster_lock, mirroring Charon's
cluster.LoadClusterLock which replaced the manifest-DAG loading path
when the manifest was removed (#4130). Reads and JSON-decodes the
cluster lock file, then verifies hashes and signatures; with no_verify
both checks still run but failures are downgraded to warnings.
emlautarom1-agent[bot]

This comment was marked as outdated.

Mirrors Charon's cluster.LoadClusterLockAndVerify: reads and verifies a
lock with a default no-op execution-layer client, for standalone tools
that have no execution-layer endpoint to inject.
@emlautarom1 emlautarom1 marked this pull request as ready for review July 4, 2026 01:33

@emlautarom1 emlautarom1 left a comment

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.

Manually checked, mostly boilerplate code to make the wiring easier.

pub async fn load_cluster_lock_and_verify(
lock_file_path: impl AsRef<Path>,
) -> Result<Lock, LoadError> {
let eth1 = EthClient::new("").await.map_err(LoadError::Eth1)?;

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.

new("") is a no-op eth client, so it can not verify EIP-1271 smart-contract operator

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.

This is intentional, it follows what Charon does:

https://github.com/ObolNetwork/charon/pull/4130/changes#diff-518182b12c285fd619114196f2e858632a192d492f042c8222504db5c34907d4R17-R18

In practice, this does not matter at the moment since this function is only used by commands that are out of scope in our roadmap.

@emlautarom1 emlautarom1 requested a review from iamquang95 July 6, 2026 21:42
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.

2 participants