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

The declared program id does not match the actual program id #110

Open
cxp-13 opened this issue Dec 18, 2024 · 5 comments
Open

The declared program id does not match the actual program id #110

cxp-13 opened this issue Dec 18, 2024 · 5 comments

Comments

@cxp-13
Copy link

cxp-13 commented Dec 18, 2024

I want to verify program on devnet and follow with the verified tutorial(https://solana.com/developers/guides/advanced/verified-builds#what-are-verified-builds) but get error when execute command solana-verify verify-from-repo -u https://devnet.helius-rpc.com/?api-key=f84a6f24-1feb-4290-bc2f-4fc95cf5e7f0 --program-id 7ZigWsEmK5JAW2mgKP19yRhcwt3gTpFMfkttXG7Hj9MF https://github.com/orbitlen/solana-contract

The program can normally be searched on solscan(https://solscan.io/account/7ZigWsEmK5JAW2mgKP19yRhcwt3gTpFMfkttXG7Hj9MF?cluster=devnet)

Console:

Finished building program
Program Solana version: v1.18.26
Docker image Solana version: v1.18.26
13eb80ccdb8f9f8a39eedbc1b09614810cb863a20ca1a887a265f1419ad2bd3f
Executable file found at path: "/tmp/solana-verify/44ce27cd-bc81-4493-9313-6d7992fa89b6/solana-contract//target/deploy/orbit_len.so"
Fetching on-chain program data for program ID: 7ZigWsEmK5JAW2mgKP19yRhcwt3gTpFMfkttXG7Hj9MF
Executable Program Hash from repo: 13eb80ccdb8f9f8a39eedbc1b09614810cb863a20ca1a887a265f1419ad2bd3f
On-chain Program Hash: 13eb80ccdb8f9f8a39eedbc1b09614810cb863a20ca1a887a265f1419ad2bd3f
Program hash matches ✅
Do you want to upload the program verification to the Solana Blockchain? (y/n) y
Uploading the program verification params to the Solana blockchain...
Using connection url: https://devnet.helius-rpc.com/?api-key=f84a6f24-1feb-4290-bc2f-4fc95cf5e7f0
Error { request: Some(SendTransaction), kind: RpcError(RpcResponseError { code: -32002, message: "Transaction simulation failed: Error processing Instruction 0: custom program error: 0x1004", data: SendTransactionPreflightFailure(RpcSimulateTransactionResult { err: Some(InstructionError(0, Custom(4100))), logs: Some(["Program verifycLy8mB96wd9wqq3WDXQwM4oU6r42Th37Db9fC invoke [1]", "Program log: AnchorError occurred. Error Code: DeclaredProgramIdMismatch. Error Number: 4100. Error Message: The declared program id does not match the actual program id.", "Program verifycLy8mB96wd9wqq3WDXQwM4oU6r42Th37Db9fC consumed 2934 of 200000 compute units", "Program verifycLy8mB96wd9wqq3WDXQwM4oU6r42Th37Db9fC failed: custom program error: 0x1004"]), accounts: None, units_consumed: Some(2934), return_data: None, inner_instructions: None }) }) }
Error uploading program: Err(Failed to send transaction to the network.)
@ngundotra
Copy link
Collaborator

Hi @cxp-13 what version of the CLI are you using?

@cxp-13
Copy link
Author

cxp-13 commented Dec 19, 2024

Hi @cxp-13 what version of the CLI are you using?

cxp@R9000P:~/solana_learn/hackathon/orbit_len$ solana-verify -V solana-verify 0.3.1

@ngundotra
Copy link
Collaborator

Got it. Sorry, currently this tool only supports mainnet use. The devnet program may be redeployed in near future, but for now, please only write PDAs and submit verification jobs for mainnet use.

If you want to skip writing a PDA for devnet, just enter n when you are prompted to write to the chain.

@cxp-13
Copy link
Author

cxp-13 commented Dec 21, 2024

Got it. Sorry, currently this tool only supports mainnet use. The devnet program may be redeployed in near future, but for now, please only write PDAs and submit verification jobs for mainnet use.

If you want to skip writing a PDA for devnet, just enter n when you are prompted to write to the chain.

no, actually I don't get what you mean by skipping writing PDA for Devnet, I just try to verify my program on Explore like EVM development.

@nazreen
Copy link

nazreen commented Dec 30, 2024

@cxp-13 , "write PDA" is exactly what is needed to support Verification status on the explorers. Things are currently very different than EVM land over in Solana.

The PDA is required as it will record on chain the repo URL and the commit hash.
OtterSec's API, which is what will do the building to compare the hashes, will refer to the contents of this PDA.

So the only verification you can do right now on Devnet is to compare the program hashes through a local (re)build.

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

No branches or pull requests

3 participants