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

SIMD-0201: Create a Cluster Sysvar #201

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

blockiosaurus
Copy link

No description provided.

@blockiosaurus blockiosaurus changed the title SIMD-XXXX: Create a Cluster Sysvar SIMD-0201: Create a Cluster Sysvar Nov 22, 2024
Comment on lines +44 to +54
#[repr(C)]
pub struct ClusterDetails {
/// The genesis hash for the cluster, guaranteed for mainnet but
/// possibly variable for other cluster types.
pub genesis_hash: Hash,
/// A named tag for the SVM chain on which the program is executing.
pub blockchain: String,
/// Cluster Type
pub cluster_type: ClusterType,
}
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I would advocate for a static layout here. Can we accomplish the stated goal with IDs? Something like:

genesis_hash: [u8; 32] // (Hash)
blockchain: [u8; 8]
cluster: [u8; 8]

I guess that introduces the problem of where to "register" chain IDs, but I think we were going to have that problem anyway, right?

Copy link
Author

Choose a reason for hiding this comment

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

I think it'd be nice to have the cluster identifier be typed but that could easily be accomplished with helpers in the SDK.

I think the static type makes sense. The chain ID is really for continuity for Devnet resets and debugging so relying on an external registry also works!

@Jac0xb
Copy link

Jac0xb commented Dec 28, 2024

This would definitely be nice to have

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