Skip to content

Conversation

danlaine
Copy link
Collaborator

@danlaine danlaine commented Oct 9, 2025

This PR replaces panics and assertions with error return values. This allows the caller to decide how to handle the error.

There are still some pub functions in the commonware-storage that may panic, such as those on commonware-storage::mmr::BitMap. (The underlying bitmap panics when given invalid values, so we'd have to change that in order to return errors in mmr::BitMap. Probably not worth it, at least right now.)

@danlaine danlaine self-assigned this Oct 9, 2025
@danlaine danlaine added this to Tracker Oct 9, 2025
@danlaine danlaine moved this to In Progress in Tracker Oct 9, 2025
Copy link

cloudflare-workers-and-pages bot commented Oct 9, 2025

Deploying monorepo with  Cloudflare Pages  Cloudflare Pages

Latest commit: cd9a635
Status: ✅  Deploy successful!
Preview URL: https://d41824d4.monorepo-eu0.pages.dev
Branch Preview URL: https://danlaine-panic-to-error.monorepo-eu0.pages.dev

View logs

@danlaine danlaine marked this pull request as ready for review October 9, 2025 21:51
@danlaine danlaine moved this from In Progress to Ready for Review in Tracker Oct 10, 2025
Copy link

codecov bot commented Oct 13, 2025

Codecov Report

❌ Patch coverage is 94.83871% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.16%. Comparing base (9c7abdc) to head (cd9a635).

Files with missing lines Patch % Lines
storage/src/adb/current/unordered.rs 72.72% 3 Missing ⚠️
storage/src/mmr/grafting.rs 82.35% 3 Missing ⚠️
storage/src/mmr/mem.rs 90.00% 3 Missing ⚠️
storage/src/mmr/proof.rs 25.00% 3 Missing ⚠️
storage/src/adb/any/variable/mod.rs 97.05% 2 Missing ⚠️
storage/src/adb/immutable/mod.rs 98.41% 1 Missing ⚠️
storage/src/adb/keyless.rs 98.11% 1 Missing ⚠️
@@            Coverage Diff             @@
##             main    #1847      +/-   ##
==========================================
+ Coverage   92.10%   92.16%   +0.05%     
==========================================
  Files         307      307              
  Lines       79648    79879     +231     
==========================================
+ Hits        73362    73617     +255     
+ Misses       6286     6262      -24     
Files with missing lines Coverage Δ
storage/src/adb/mod.rs 95.45% <ø> (ø)
storage/src/mmr/bitmap.rs 95.48% <100.00%> (+0.51%) ⬆️
storage/src/adb/immutable/mod.rs 97.16% <98.41%> (+1.57%) ⬆️
storage/src/adb/keyless.rs 94.57% <98.11%> (+0.20%) ⬆️
storage/src/adb/any/variable/mod.rs 97.15% <97.05%> (+1.33%) ⬆️
storage/src/adb/current/unordered.rs 92.57% <72.72%> (ø)
storage/src/mmr/grafting.rs 86.32% <82.35%> (+0.07%) ⬆️
storage/src/mmr/mem.rs 91.98% <90.00%> (+0.13%) ⬆️
storage/src/mmr/proof.rs 94.84% <25.00%> (-0.13%) ⬇️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9c7abdc...cd9a635. Read the comment docs.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

2 participants