Skip to content

Commit c098e0b

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

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,
@@ -1265,7 +1268,6 @@ fn get_basename(repo_url: &str) -> anyhow::Result<String> {
12651268

12661269
#[allow(clippy::too_many_arguments)]
12671270
pub async fn verify_from_repo(
1268-
remote: bool,
12691271
relative_mount_path: String,
12701272
connection: &RpcClient,
12711273
repo_url: String,
@@ -1280,15 +1282,12 @@ pub async fn verify_from_repo(
12801282
skip_prompt: bool,
12811283
path_to_keypair: Option<String>,
12821284
compute_unit_price: u64,
1283-
mut skip_build: bool,
1285+
skip_build: bool,
12841286
container_id_opt: &mut Option<String>,
12851287
temp_dir_opt: &mut Option<String>,
12861288
check_signal: &dyn Fn(&mut Option<String>, &mut Option<String>),
12871289
config_path: Option<String>,
12881290
) -> anyhow::Result<()> {
1289-
// Set skip_build to true if remote is true
1290-
skip_build |= remote;
1291-
12921291
// Get source code from repo_url
12931292
let base_name = get_basename(&repo_url)?;
12941293

@@ -1367,24 +1366,6 @@ pub async fn verify_from_repo(
13671366
)
13681367
.await?;
13691368

1370-
if remote {
1371-
check_signal(container_id_opt, temp_dir_opt);
1372-
let genesis_hash = get_genesis_hash(connection)?;
1373-
if genesis_hash != MAINNET_GENESIS_HASH {
1374-
return Err(anyhow!("Remote verification only works with mainnet. Please omit the --remote flag to verify locally."));
1375-
}
1376-
1377-
let uploader = get_address_from_keypair_or_config(
1378-
path_to_keypair.as_ref(),
1379-
config_path.clone(),
1380-
)?;
1381-
println!("Sending verify command to remote machine with uploader: {uploader}");
1382-
println!(
1383-
"\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"
1384-
);
1385-
send_job_with_uploader_to_remote(connection, &program_id, &uploader).await?;
1386-
}
1387-
13881369
Ok(())
13891370
} else {
13901371
println!("Program hashes do not match ❌");

0 commit comments

Comments
 (0)