Repository navigation
Conversation
|
@xternet is attempting to deploy a commit to the OtterSec Team on Vercel. A member of the Team first needs to authorize it. |
| @@ -1,5 +1,7 @@ | |||
| # Changelog | |||
|
|
|||
| - cli: Honor account-file, directory and genesis fixtures on the Surfpool test backend. | |||
There was a problem hiding this comment.
This should be added under Unreleased
|
|
||
| ```toml | ||
| [surfpool] | ||
| extra_args = ["--no-studio"] |
There was a problem hiding this comment.
Surfpool rejects any flag if given twice. This example breaks anchor test since Anchor already passes --no-studio on every run.
| flags.push("--no-studio".to_string()); | ||
| } | ||
|
|
||
| if let Some(extra_args) = surfpool_config.as_ref().and_then(|c| c.extra_args.as_ref()) { |
There was a problem hiding this comment.
Setting extra_args = ["--no-deploy"] without --skip-deploy passes both --no-deploy and --legacy-anchor-compatibility.
Reject --no-deploy, --legacy-anchor-compatibility, and --anchor-test-config-path in extra_args. Update the documentation to clarify that these flags are not allowed because Anchor sets them through --skip-deploy.
| block_production_mode = "clock" | ||
| ``` | ||
|
|
||
| ### `extra_args` |
There was a problem hiding this comment.
Please update the documentation so that both documentation (v1 & v2) matches.
| url = "https://anchor.projectserum.com" | ||
| ``` | ||
|
|
||
| ### Account and genesis fixtures on Surfpool |
There was a problem hiding this comment.
We should move this section up, before ## toolchain.
| let text = parts[0] | ||
| .as_str() | ||
| .ok_or_else(|| anyhow!("invalid account data"))?; | ||
| match parts[1].as_str() { |
There was a problem hiding this comment.
Can we also add support for base64+zstd
| for (address, image) in images { | ||
| let key: Pubkey = address.parse()?; | ||
| let actual = client | ||
| .get_account_with_commitment(&key, CommitmentConfig::processed())? |
There was a problem hiding this comment.
Can we use get_multiple_accounts_with_commitment here instead of get_account_with_commitment
| let data_state = UpgradeableLoaderState::ProgramData { | ||
| slot: 0, | ||
| upgrade_authority_address: Some(if program.upgradeable == Some(true) { | ||
| cfg.wallet_kp()?.pubkey() |
There was a problem hiding this comment.
We are reading cfg.wallet_kp()?.pubkey() once per genesis entry. Read it once before the loop and reuse it.
| if flags.first().map(String::as_str) != Some("--snapshot") { | ||
| return Ok(()); | ||
| } | ||
| { |
There was a problem hiding this comment.
nit: The bare { … } block here doesn’t seem to do anything here. Could you remove the braces and format the code.
| if !elf.starts_with(b"\x7fELF") { | ||
| bail!("Genesis program {} is not an ELF file", path.display()); | ||
| } | ||
| { |
There was a problem hiding this comment.
nit: The bare { … } block here doesn’t seem to do anything here. Could you remove the braces and format the code.
|
Another thing I noticed is the same fixture files are parsed three different ways.
It would be better to extract the logic into a helper function and reuse it across all three places. |
|
Please don't use LLMs to write PR descriptions or documentation without reviewing the generated content first. Refer to the PR guidelines for more details. |
Share fixture parsing, bound compressed data decoding, and batch account verification. Reject managed launch arguments, reuse the genesis authority, and correct the fixture documentation and examples.
|
Thanks for the review. Fixed in cfa76dd: ✅ Shared fixture parsing and base64+zstd support. Local checks pass: 171 tests in each Solana configuration, 4 integration cases, build, formatting and Clippy. Also carried into #5222 and tested. |
|
@xternet docs-v2 formatting was changed completely. |
|
Can we isolate all tests into a |
|
Done. Tests are now grouped by behavior in |
|
|
||
| fn image(owner: String, data: &[u8], executable: bool) -> Value { | ||
| json!({"owner":owner,"data":STANDARD.encode(data),"lamports":rent_exempt_minimum(data.len() as u64), | ||
| "executable":executable,"rentEpoch":RENT_EPOCH_NEVER,"parsedData":null}) |
There was a problem hiding this comment.
here assigns RENT_EPOCH_NEVER to both program and program-data accounts; whereas verify does not compare rentEpoch, so the mismatch passes verification.
| } | ||
|
|
||
| if let Some(extra_args) = surfpool_config.as_ref().and_then(|c| c.extra_args.as_ref()) { | ||
| flags.extend(extra_args.iter().cloned()); |
There was a problem hiding this comment.
setting extra_args = ["--no-studio"] cause duplicate args in extra_args; but it shouldnt allow duplicate runtime flags --no-studio or --port right? causing surfpool startup failures
When using Surfpool,
--skip-deployshould skip program deployment, not configured test fixtures.[surfpool].extra_args; reject Anchor-managed flags.SurfpoolConfigliterals needextra_args; normal deployment is unchanged.