Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: hardcode the filter list, change command line args #4096

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

aatifsyed
Copy link
Contributor

Summary of changes

  • Hardcode the blocklist, remove the filter-list file.
  • CLI now accepts multiple filters
  • CLI is self-documenting
Usage: forest-tool api compare [OPTIONS] [SNAPSHOT_FILES]...

Arguments:
  [SNAPSHOT_FILES]...
          Snapshot input paths. Supports `.car`, `.car.zst`, and `.forest.car.zst`

Options:
      --forest <FOREST>
          Forest address
          
          [default: /ip4/127.0.0.1/tcp/2345/http]

....

Filtering:
      --include <INCLUDE>
          Include methods that may be excluded by the default exclusions.
          
          The current default exclusions are:
                - Filecoin.ChainGetParentReceipts
                - Filecoin.ChainGetPath
                - Filecoin.ChainGetTipSetAfterHeight
                - Filecoin.MinerGetBaseInfo
                - Filecoin.StateAccountKey
                - Filecoin.StateListMessages
                - Filecoin.StateSearchMsg
                - Filecoin.StateSearchMsgLimited
                - Filecoin.StateVMCirculatingSupplyInternal
                - Filecoin.StateWaitMsg
          These methods are potentially broken, and should not be used until the root cause is resolved.

      --exclude <EXCLUDE>
          Exclude methods in addition to the default exclusions

      --select <SELECT>
          Ignore the default exclusions, and run only these methods

Changes introduced in this pull request:

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

@aatifsyed aatifsyed requested a review from a team as a code owner March 21, 2024 15:04
@aatifsyed aatifsyed requested review from lemmih and LesnyRumcajs and removed request for a team March 21, 2024 15:04
@LesnyRumcajs
Copy link
Member

What problem does this change solve?

@aatifsyed
Copy link
Contributor Author

Unifies filtering for RPC methods - slightly cleaner than plumbing around a single file to the integration tests that use it.

The rest is all UX and cruft

@LesnyRumcajs
Copy link
Member

Unifies filtering for RPC methods - slightly cleaner than plumbing around a single file to the integration tests that use it.

The rest is all UX and cruft

I appreciate the effort put into this implementation - it looks solid and well-tested. That said, from my perspective, it seems significantly more complex than the one with a simple filter list and as such, more difficult to maintain and use. I also find it counter-productive to re-write features that were just implemented; I believe there are items with higher priority in the backlog.

That said, I won't block it; this tool is used exclusively by Forest maintainers so if they prefer it this way, I'm okay with that.

@LesnyRumcajs LesnyRumcajs removed their request for review March 21, 2024 21:11
@hanabi1224
Copy link
Contributor

hanabi1224 commented Mar 22, 2024

@aatifsyed We will need a separate BLOCK_LIST for offline RPC server (forest-tool api serve), the current test is problematic and passes with errors. It should fail for RPC methods like Filecoin.NetAddrsListen because it's not connected to the p2p network. Hope this is well supported as well.

See https://github.com/ChainSafe/forest/actions/runs/8378304107/job/22942969692?pr=4086#step:7:144

@aatifsyed aatifsyed marked this pull request as draft April 2, 2024 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants