Skip to content

Farmer piece cache percentage is based on remaining pieces, which is confusing after a restart #3614

@teor2345

Description

@teor2345

When I start my farmer with multiple farms totalling 10s of terabytes, it checks the previous piece cache, then starts downloading pieces.

Before I restarted it, it logged around 5% complete:

2025-07-02T00:58:40.328135Z  INFO subspace_networking::node_runner: dsn: actively using 1/75 known peers                                                                                            
2025-07-02T00:58:53.420955Z  INFO subspace_farmer::farmer_cache: Piece cache sync 5.09% complete

But after I restart, I see it return to close to zero:

2025-07-02T06:38:05.317096Z  INFO subspace_farmer::farmer_cache: Piece cache sync 0.00% complete
2025-07-02T06:38:05.593328Z  INFO subspace_farmer::farmer_cache: Piece cache sync 0.08% complete
2025-07-02T06:39:15.750174Z  INFO subspace_networking::node_runner: dsn: actively using 1/74 known peers
...
2025-07-02T06:43:45.821057Z  INFO subspace_networking::node_runner: dsn: actively using 6/74 known peers
2025-07-02T06:44:08.850549Z  INFO subspace_farmer::farmer_cache: Piece cache sync 0.16% complete
2025-07-02T06:44:15.826408Z  INFO subspace_networking::node_runner: dsn: actively using 7/74 known peers
2025-07-02T06:44:45.833070Z  INFO subspace_networking::node_runner: dsn: actively using 25/74 known peers
2025-07-02T06:45:15.839039Z  INFO subspace_networking::node_runner: dsn: actively using 5/74 known peers
2025-07-02T06:45:21.214139Z  INFO subspace_farmer::farmer_cache: Piece cache sync 0.25% complete
...
2025-07-02T07:01:56.966927Z  INFO subspace_farmer::farmer_cache: Piece cache sync 0.33% complete
...
2025-07-02T08:00:48.108130Z  INFO subspace_farmer::farmer_cache: Piece cache sync 0.41% complete
...
2025-07-02T09:15:43.067294Z  INFO subspace_farmer::farmer_cache: Piece cache sync 0.49% complete
...
2025-07-02T10:33:23.546940Z  INFO subspace_farmer::farmer_cache: Piece cache sync 0.57% complete
...
2025-07-02T19:59:57.485356Z  INFO subspace_networking::node_runner: dsn: actively using 19/73 known peers

A reset to zero would make sense if the percentage was based on the remaining pieces. But that's obviously not the case, because it reaches 0.16% almost immediately.

Perhaps it is based on the remaining unplotted pieces? If that's the case, then we could re-word the logs to make that clearer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfarmerFarming library/app

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions