Skip to content

fix: misc bugs found by AI#1733

Open
akaladarshi wants to merge 3 commits intomasterfrom
akaladarshi/fix-misc-bugs
Open

fix: misc bugs found by AI#1733
akaladarshi wants to merge 3 commits intomasterfrom
akaladarshi/fix-misc-bugs

Conversation

@akaladarshi
Copy link
Copy Markdown
Contributor

While taking the code from the builtin actor into the fil-actor-state for the V18 actor update, coderabbit AI suggested some fixes/comments here.

I have fixed couple of them rest were about adding the checks for negative and zero but I verified most of them didn't find anything worth changing but will post in the comments if anybody thinks they are worth it. Also It turns out the changes were not that big.

@github-project-automation github-project-automation bot moved this to 📌 Triage in FilOz Apr 10, 2026
@akaladarshi
Copy link
Copy Markdown
Contributor Author

Here the document suggests

/// It is possible for balance to fall below the sum of PCD, LF and
/// InitialPledgeRequirements, and this is a bad state (IP Debt)

But the code actually doesn't allow the balance to fall below the sum of PCD, LF and InitialPledgeRequirements, so should the comments be updated.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.52%. Comparing base (68baa3c) to head (86a57a6).

Files with missing lines Patch % Lines
actors/power/src/state.rs 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1733   +/-   ##
=======================================
  Coverage   90.52%   90.52%           
=======================================
  Files         139      139           
  Lines       27693    27695    +2     
=======================================
+ Hits        25069    25071    +2     
  Misses       2624     2624           
Files with missing lines Coverage Δ
actors/evm/shared/src/uints.rs 98.35% <100.00%> (ø)
actors/evm/src/state.rs 85.71% <ø> (ø)
runtime/src/runtime/mod.rs 89.28% <ø> (ø)
runtime/src/runtime/policy.rs 100.00% <ø> (ø)
runtime/src/util/message_accumulator.rs 96.84% <ø> (ø)
runtime/src/util/set_multimap.rs 97.36% <100.00%> (+0.07%) ⬆️
actors/power/src/state.rs 86.84% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@akaladarshi
Copy link
Copy Markdown
Contributor Author

While validating power state validate_power_state here we are missing upper bound check on the self.faulty_power.qa.

Let me know if this is a real concern i can create a separate issue or change it in this PR.

@akaladarshi
Copy link
Copy Markdown
Contributor Author

in amout_vested

let elapsed = curr_epoch - self.start_epoch;

could give us the negative value but I couldn't verify since the function is not used anywhere dead_code (should we remove this?)

@akaladarshi
Copy link
Copy Markdown
Contributor Author

AddPairKey encoding is not implemented, we are not using it anywhere but still it panics.

@akaladarshi akaladarshi marked this pull request as ready for review April 14, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📌 Triage

Development

Successfully merging this pull request may close these issues.

2 participants