Skip to content

chore(shed): update trace-finding in lotus-shed miner fees & fees-inspect with a better top-down filter#13204

Merged
rjan90 merged 3 commits intomasterfrom
copilot/fix-13203
Jul 8, 2025
Merged

chore(shed): update trace-finding in lotus-shed miner fees & fees-inspect with a better top-down filter#13204
rjan90 merged 3 commits intomasterfrom
copilot/fix-13203

Conversation

Copy link
Contributor

Copilot AI commented Jul 8, 2025

This PR implements a better top-down filtering approach for trace-finding in the lotus-shed miner fees and lotus-shed miner fees-inspect commands, as requested in the issue.

Problem

Previously, both commands used a bottom-up filtering approach that would trace any execution involving the target miner address. This resulted in noisy output with many irrelevant traces that didn't follow the actual cron execution flow.

Solution

The new implementation adds hierarchical trace filtering that follows the expected cron execution flow:

  • Depth 0: SystemActorAddr (f00) → CronActorAddr (f03) method 2 (EpochTick)
  • Depth 1: CronActorAddr (f03) → StoragePowerActorAddr (f04) method 5 (OnEpochTickEnd)
  • Depth 2+: StoragePowerActorAddr (f04) → miner actors method 12 (OnDeferredCronEvent), plus any miner-related calls

This matches the actual protocol flow described in the issue:

f00->f03[2]:0                         # System calls Cron EpochTick
    f03->f04[5]:0                     # Cron calls Power OnEpochTickEnd
        f04->f02[3]:0                 # Power calls Reward ThisEpochReward
        f04->f01083949[12]:0          # Power calls Miner OnDeferredCronEvent
            f01083949->f099[0]:...    # Miner pays fees to burn address
            f01083949->f04[4]:0       # Miner reports back to Power
        f04->f02[4]:0                 # Power calls Reward again
    f03->f05[9]:0                     # Cron calls Market actor

Changes Made

  1. Updated printExec function in the fees command with depth-based filtering logic
  2. Updated traceBurns function in the fees-inspect command with the same filtering approach
  3. Preserved existing behavior for deeper trace levels (depth >= 2) where miner interactions occur
  4. Added comprehensive filtering for shallow depths (0 and 1) to focus on the cron execution path

Benefits

  • Cleaner output: Filters out unrelated execution traces that don't follow the cron flow
  • Faster processing: Skips irrelevant trace branches early in the recursion
  • Better debugging: Highlights the actual execution path that leads to fee payments
  • Protocol consistency: Matches the designed cron execution flow

Testing

  • Validated actor addresses match expected values (f00=System, f03=Cron, f04=Power)
  • Verified method numbers correspond to expected calls (2=EpochTick, 5=OnEpochTickEnd, 12=OnDeferredCronEvent)
  • Tested filtering logic with various valid/invalid trace scenarios
  • Confirmed code compiles and follows existing style patterns

Fixes #13203.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/filecoin-project/filecoin-ffi/releases/tags/v1.33.1-dev
    • Triggering command: curl --retry 3 --location REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: rvagg <495647+rvagg@users.noreply.github.com>
Copilot AI changed the title [WIP] Update trace-finding in lotus-shed miner fees & fees-inspect with a better top-down filter Update trace-finding in lotus-shed miner fees & fees-inspect with a better top-down filter Jul 8, 2025
Copilot AI requested a review from rvagg July 8, 2025 03:08
Copilot finished work on behalf of rvagg July 8, 2025 03:08
…ariable

Co-authored-by: rvagg <495647+rvagg@users.noreply.github.com>
Copilot AI requested a review from rvagg July 8, 2025 03:21
Copilot finished work on behalf of rvagg July 8, 2025 03:21
@rvagg rvagg marked this pull request as ready for review July 8, 2025 03:45
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

@github-project-automation github-project-automation bot moved this from 📌 Triage to ⌨️ In Progress in FilOz Jul 8, 2025
Copy link
Member

@rvagg rvagg left a comment

Choose a reason for hiding this comment

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

lovely

@rvagg rvagg changed the title Update trace-finding in lotus-shed miner fees & fees-inspect with a better top-down filter chore(shed): update trace-finding in lotus-shed miner fees & fees-inspect with a better top-down filter Jul 8, 2025
@rvagg rvagg added the skip/changelog This change does not require CHANGELOG.md update label Jul 8, 2025
@github-actions github-actions bot dismissed their stale review July 8, 2025 03:46

PR title now matches the required format.

@rvagg rvagg requested a review from rjan90 July 8, 2025 03:55
@github-project-automation github-project-automation bot moved this from ⌨️ In Progress to ✔️ Approved by reviewer in FilOz Jul 8, 2025
@rjan90 rjan90 merged commit 2cc7413 into master Jul 8, 2025
102 of 105 checks passed
@rjan90 rjan90 deleted the copilot/fix-13203 branch July 8, 2025 06:51
@github-project-automation github-project-automation bot moved this from ✔️ Approved by reviewer to 🎉 Done in FilOz Jul 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip/changelog This change does not require CHANGELOG.md update

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

Update trace-finding in lotus-shed miner fees & fees-inspect with a better top-down filter

3 participants