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

feat(tool): forest-tool api generate-test-snapshot #5074

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

hanabi1224
Copy link
Contributor

@hanabi1224 hanabi1224 commented Dec 11, 2024

Summary of changes

This PR includes changes in #5034

Changes introduced in this pull request:

  • forest-tool api generate-test-snapshot
  • forest-tool api test
  • a few RPC unit tests (to be expanded with the manual steps below)

(Will use a separate PR to add below steps to dev docs)

Step 1: generating RPC test dumps

forest-tool api compare --dump-dir /var/tmp/rpc-dumps ...

Step 2: generate RPC test snapshots

forest-tool api generate-test-snapshot --db ~/.local/share/forest/calibnet/0.23.0 --chain calibnet --out-dir /var/tmp/rpc-snapshots /var/tmp/test-dumps/filecoin_stategetallallocations*.json

Step 2(b): zstd compress test snapshots

cd /var/tmp/rpc-snapshots
zstd *.json

Step 3: verify test snapshots

forest-tool api test /var/tmp/rpc-snapshots/*.json or forest-tool api test /var/tmp/rpc-snapshots/*.zst

Step 3(b): update unit test

  • upload test snapshots to DO space
  • update test_snapshots.txt
  • cargo test --lib -- --test rpc_regression_tests --nocapture

Reference issue to close (if applicable)

Closes #5034

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • 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.

@hanabi1224 hanabi1224 force-pushed the hm/forest-tool-api-generate-test-snapshot branch from 7696c1a to f496aed Compare December 11, 2024 15:10
@hanabi1224 hanabi1224 force-pushed the hm/forest-tool-api-generate-test-snapshot branch from f496aed to 91e4716 Compare December 11, 2024 23:46
@hanabi1224 hanabi1224 marked this pull request as ready for review December 12, 2024 09:28
@hanabi1224 hanabi1224 requested a review from a team as a code owner December 12, 2024 09:28
@hanabi1224 hanabi1224 requested review from lemmih and sudo-shashank and removed request for a team December 12, 2024 09:28
@hanabi1224 hanabi1224 changed the title [WIP] feat(tool): forest-tool api generate-test-snapshot feat(tool): forest-tool api generate-test-snapshot Dec 12, 2024
}

fn setting_keys(&self) -> anyhow::Result<Vec<String>> {
// HACKHACK: may need some care
Copy link
Contributor Author

@hanabi1224 hanabi1224 Dec 12, 2024

Choose a reason for hiding this comment

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

We could deal with these HACKHACK later when they are used by some RPC methods and the snap generation flow fails since everything here is offline

Copy link
Contributor

@lemmih lemmih left a comment

Choose a reason for hiding this comment

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

The format of the memory-db is not stable. If someone changes the memory-db internals, this code will fail. We'll either have to deal with it right now or in the future. I vote to deal with it right now.

@hanabi1224 hanabi1224 marked this pull request as draft December 13, 2024 12:24
Copy link

cloudflare-workers-and-pages bot commented Dec 16, 2024

Deploying forest-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: f69ad6e
Status: ✅  Deploy successful!
Preview URL: https://5597b3fc.forest-824.pages.dev
Branch Preview URL: https://hm-forest-tool-api-generate.forest-824.pages.dev

View logs

@hanabi1224 hanabi1224 marked this pull request as ready for review December 16, 2024 08:27
@hanabi1224
Copy link
Contributor Author

The format of the memory-db is not stable. If someone changes the memory-db internals, this code will fail. We'll either have to deal with it right now or in the future. I vote to deal with it right now.

@lemmih Switched to Forest CAR DB as discussed.

@hanabi1224 hanabi1224 force-pushed the hm/forest-tool-api-generate-test-snapshot branch from 827e63a to 18089eb Compare December 16, 2024 08:31
@hanabi1224 hanabi1224 requested a review from elmattic December 17, 2024 01:57
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.

2 participants