Skip to content

Commit 63f919d

Browse files
committed
docs: update README and main.rs to reflect deprecation of --remote flag and provide new workflow instructions
1 parent 1bbfa13 commit 63f919d

File tree

3 files changed

+12
-27
lines changed

3 files changed

+12
-27
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ solana-verify verify-from-repo -u $NETWORK_URL --program-id $PROGRAM_ID https://
3838
solana-verify remote submit-job --program-id $PROGRAM_ID --uploader $THE_PUBKEY_THAT_UPLOADED_YOUR_BUILD_DATA
3939
```
4040

41+
> The legacy `--remote` flag on `verify-from-repo` has been deprecated. Upload your PDA with programs upgrade authority, then run the `remote submit-job` command to queue OtterSec's worker. For a full walkthrough of the PDA workflow, see the [Solana verified builds guide](https://solana.com/docs/programs/verified-builds).
42+
4143
## Documentation
4244

43-
For detailed instructions and best practices, please refer to the [official Solana documentation on verified builds](https://solana.com/developers/guides/advanced/verified-builds).
45+
For detailed instructions and best practices, please refer to the [official Solana documentation on verified builds](https://solana.com/docs/programs/verified-builds).
4446

4547
## Security Considerations
4648

src/api/client.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ pub async fn send_job_with_uploader_to_remote(
9797
// Check that PDA exists before sending job
9898
let genesis_hash = get_genesis_hash(connection)?;
9999
if genesis_hash != MAINNET_GENESIS_HASH {
100-
return Err(anyhow!("Remote verification service only supports mainnet. You're currently connected to a different network.\n\nTo use remote verification:\n• Connect to mainnet with: --url mainnet\n• Or remove the --remote flag to verify locally"));
100+
return Err(anyhow!(format!(
101+
"Remote verification service only supports mainnet. You're currently connected to a different network.\n\nTo submit a remote job:\n• Connect to mainnet with: --url mainnet\n• Upload your verify PDA via `solana-verify verify-from-repo`\n• Run `solana-verify remote submit-job --program-id {program_id} --uploader {uploader}`\n\nLearn more: https://solana.com/docs/programs/verified-builds"
102+
)));
101103
}
102104
get_program_pda(connection, program_id, Some(uploader.to_string()), None).await?;
103105

src/main.rs

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use signal_hook::{
1313
};
1414
use solana_cli_config::{Config, CONFIG_FILE};
1515
use solana_loader_v3_interface::{get_program_data_address, state::UpgradeableLoaderState};
16-
use solana_program::get_address_from_keypair_or_config;
1716
use solana_rpc_client::rpc_client::RpcClient;
1817
use solana_sdk::pubkey::Pubkey;
1918
use solana_transaction_status_client_types::UiTransactionEncoding;
@@ -448,6 +447,11 @@ async fn main() -> anyhow::Result<()> {
448447
let mount_path = sub_m.value_of("mount-path").map(|s| s.to_string()).unwrap();
449448
let repo_url = sub_m.value_of("repo-url").map(|s| s.to_string()).unwrap();
450449
let program_id = sub_m.value_of("program-id").unwrap();
450+
if remote {
451+
return Err(anyhow!(
452+
"The --remote flag has been deprecated. Upload your verify PDA with programs upgrade authority, then queue the remote worker with `solana-verify remote submit-job --program-id {program_id} --uploader <UPLOADER>`. See https://solana.com/docs/programs/verified-builds for the full workflow."
453+
));
454+
}
451455
let base_image = sub_m.value_of("base-image").map(|s| s.to_string());
452456
let library_name = sub_m.value_of("library-name").map(|s| s.to_string());
453457
let bpf_flag = sub_m.is_present("bpf");
@@ -470,7 +474,6 @@ async fn main() -> anyhow::Result<()> {
470474

471475
println!("Skipping prompt: {skip_prompt}");
472476
verify_from_repo(
473-
remote,
474477
mount_path,
475478
&connection,
476479
repo_url,
@@ -1291,7 +1294,6 @@ fn get_basename(repo_url: &str) -> anyhow::Result<String> {
12911294

12921295
#[allow(clippy::too_many_arguments)]
12931296
pub async fn verify_from_repo(
1294-
remote: bool,
12951297
relative_mount_path: String,
12961298
connection: &RpcClient,
12971299
repo_url: String,
@@ -1306,15 +1308,12 @@ pub async fn verify_from_repo(
13061308
skip_prompt: bool,
13071309
path_to_keypair: Option<String>,
13081310
compute_unit_price: u64,
1309-
mut skip_build: bool,
1311+
skip_build: bool,
13101312
container_id_opt: &mut Option<String>,
13111313
temp_dir_opt: &mut Option<String>,
13121314
check_signal: &dyn Fn(&mut Option<String>, &mut Option<String>),
13131315
config_path: Option<String>,
13141316
) -> anyhow::Result<()> {
1315-
// Set skip_build to true if remote is true
1316-
skip_build |= remote;
1317-
13181317
// Get source code from repo_url
13191318
let base_name = get_basename(&repo_url)?;
13201319

@@ -1393,24 +1392,6 @@ pub async fn verify_from_repo(
13931392
)
13941393
.await?;
13951394

1396-
if remote {
1397-
check_signal(container_id_opt, temp_dir_opt);
1398-
let genesis_hash = get_genesis_hash(connection)?;
1399-
if genesis_hash != MAINNET_GENESIS_HASH {
1400-
return Err(anyhow!("Remote verification only works with mainnet. Please omit the --remote flag to verify locally."));
1401-
}
1402-
1403-
let uploader = get_address_from_keypair_or_config(
1404-
path_to_keypair.as_ref(),
1405-
config_path.clone(),
1406-
)?;
1407-
println!("Sending verify command to remote machine with uploader: {uploader}");
1408-
println!(
1409-
"\nPlease note that if the desired uploader is not the provided keypair, you will need to run `solana-verify remote submit-job --program-id {program_id} --uploader <uploader-address>.\n"
1410-
);
1411-
send_job_with_uploader_to_remote(connection, &program_id, &uploader).await?;
1412-
}
1413-
14141395
Ok(())
14151396
} else {
14161397
println!("Program hashes do not match ❌");

0 commit comments

Comments
 (0)