Skip to content

idl: Store deployment addresses for other clusters#2892

Merged
acheroncrypto merged 5 commits into
otter-sec:masterfrom
acheroncrypto:idl-store-deployment-addresses
Apr 6, 2024
Merged

idl: Store deployment addresses for other clusters#2892
acheroncrypto merged 5 commits into
otter-sec:masterfrom
acheroncrypto:idl-store-deployment-addresses

Conversation

@acheroncrypto

@acheroncrypto acheroncrypto commented Apr 6, 2024

Copy link
Copy Markdown
Collaborator

Problem

It's currently not possible to store program address information for other clusters.

Solution

Initially, I thought of making the top-level address field an enum:

pub enum IdlAddress {
    Multiple {
        mainnet: Option<String>,
        testnet: Option<String>,
        devnet: Option<String>,
        localnet: Option<String>,
    },
    #[untagged]
    Single(String),
}

This way, we could support both string address as a default and an object type for more detailed (cluster based) information. However, the program's IDL may also exist in other clusters, which makes the current IDL (the one we got the other deployment addresses from) useless (because the IDL in the cluster should be fetched). For this reason, it made more sense to store this information in the metadata field compared to the top-level address field:

pub struct IdlDeployments {
    pub mainnet: Option<String>,
    pub testnet: Option<String>,
    pub devnet: Option<String>,
    pub localnet: Option<String>,
}

Summary of changes

Add metadata.deployments field that optionally stores deployment addresses in mainnet, testnet, devnet and localnet.

@vercel

vercel Bot commented Apr 6, 2024

Copy link
Copy Markdown

@acheroncrypto is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

@acheroncrypto acheroncrypto added the idl related to the IDL, either program or client side label Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

idl related to the IDL, either program or client side

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant