Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kevinlewi
Copy link
Contributor

This adds the ability for the whatsapp-kt-auditor example to audit a specific epoch, rather than loading all proofs first and then picking the epoch (which can be much slower)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 19, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.03%. Comparing base (3ce5335) to head (43bf51e).
⚠️ Report is 26 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #460      +/-   ##
==========================================
+ Coverage   88.61%   89.03%   +0.42%     
==========================================
  Files          39       38       -1     
  Lines        9109     7600    -1509     
==========================================
- Hits         8072     6767    -1305     
+ Misses       1037      833     -204     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kevinlewi kevinlewi force-pushed the kt_auditor_epochs branch 2 times, most recently from 9fdd42c to 6a2c0f7 Compare July 22, 2025 00:58
@kevinlewi kevinlewi marked this pull request as ready for review July 22, 2025 01:41
@kevinlewi kevinlewi requested review from cryo28 and dillongeorge July 22, 2025 01:42
@kevinlewi kevinlewi mentioned this pull request Jul 22, 2025
}

pub(crate) async fn get_proof_from_epoch(url: &str, epoch: u64) -> Result<EpochSummary> {
let params: Vec<(String, String)> = vec![
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that we need to explicitly denote the type here.

("prefix".to_string(), format!("{}/", epoch)),
];

let (keys, truncated_result) = get_xml(url, &params).await.unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to propagate the error instead of unwrapping here, otherwise we can lose useful context.

if keys.is_empty() {
bail!("Could not find epoch {}", epoch);
}
Ok(keys[0].clone())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just call Vec::remove here.

Comment on lines 137 to 140
if let Some(epoch_summary) = maybe_proof {
do_epoch_audit(epoch_summary).await?;
} else {
Err("Epoch is out of available range")
bail!("Could not find epoch {}", epoch);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use let-else here to clean this up a bit:

let Some(epoch_summary) = maybe_proof else {
    bail!("Could not find epoch {epoch}");
};

do_epoch_audit(epoch_summary).await?

@kevinlewi kevinlewi force-pushed the kt_auditor_epochs branch from 6a2c0f7 to 43bf51e Compare July 31, 2025 21:03
@kevinlewi kevinlewi merged commit d6f66af into facebook:main Aug 4, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants