Skip to content

Conversation

@hanabi1224
Copy link
Contributor

@hanabi1224 hanabi1224 commented Aug 21, 2025

Summary of changes

Changes introduced in this pull request:

  • CI test for forest-cli state compute with --n-epochs argument

Reference issue to close (if applicable)

Closes #5953

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.

Summary by CodeRabbit

  • Tests
    • Clarified test output to indicate state compute at epoch 0.
    • Added explicit validation of state root CID with clear failure message on mismatch.
    • Added a batch state-compute test that selects a recent historical epoch (with a guard to avoid negative epochs), runs multiple iterations, and provides verbose output.
    • Preserved existing mempool/test flow; new batch test runs after it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 21, 2025

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between fe91a34 and a615a51.

📒 Files selected for processing (1)
  • scripts/tests/calibnet_other_check.sh (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/tests/calibnet_other_check.sh
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: tests
  • GitHub Check: tests-release
  • GitHub Check: Build Ubuntu
  • GitHub Check: cargo-publish-dry-run
  • GitHub Check: Build MacOS
  • GitHub Check: Build forest binaries on Linux AMD64
  • GitHub Check: All lint checks
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (rust)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hm/test-state-compute

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@hanabi1224 hanabi1224 force-pushed the hm/test-state-compute branch from d67aca0 to fe91a34 Compare August 21, 2025 13:04
@hanabi1224 hanabi1224 marked this pull request as ready for review August 21, 2025 13:37
@hanabi1224 hanabi1224 requested a review from a team as a code owner August 21, 2025 13:37
@hanabi1224 hanabi1224 requested review from LesnyRumcajs and akaladarshi and removed request for a team August 21, 2025 13:37
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
scripts/tests/calibnet_other_check.sh (1)

19-25: Normalize the CLI output and validate CID to avoid false negatives

Some environments may emit trailing whitespace or quotes; normalizing and validating the CID prevents spurious failures and speeds up diagnosis.

Apply this diff:

-echo "Test subcommand: state compute at epoch 0"
-cid=$($FOREST_CLI_PATH state compute --epoch 0)
+echo "Test subcommand: state compute at epoch 0"
+# Normalize output to a single unquoted line and validate format to fail fast.
+cid="$($FOREST_CLI_PATH state compute --epoch 0 | tr -d '\r' | head -n1 | sed -e 's/^"//' -e 's/"$//')"
+if ! [[ "$cid" =~ ^bafy[[:alnum:]]+$ ]]; then
+  echo "Unexpected output from 'state compute --epoch 0': $cid"
+  exit 1
+fi
 # Expected state root CID, same reported as in Lotus. This should break only if the network is reset.
 if [ "$cid" != "bafy2bzacecgqgzh3gxpariy3mzqb37y2vvxoaw5nwbrlzkhso6owus3zqckwe" ]; then
   echo "Unexpected state root CID: $cid"
   exit 1
 fi
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 18edbdb and fe91a34.

📒 Files selected for processing (1)
  • scripts/tests/calibnet_other_check.sh (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: hanabi1224
PR: ChainSafe/forest#5930
File: build.rs:64-77
Timestamp: 2025-08-13T09:43:20.301Z
Learning: hanabi1224 prefers hard compile-time errors in build scripts rather than runtime safeguards or collision detection, believing it's better to fail fast and fix root causes of issues like malformed snapshot names.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: tests-release
  • GitHub Check: Build forest binaries on Linux AMD64
  • GitHub Check: tests
🔇 Additional comments (1)
scripts/tests/calibnet_other_check.sh (1)

19-25: Good addition: hard fail on CID mismatch for epoch 0

Exiting with status 1 on CID mismatch makes the test meaningful and will catch regressions early.

exit 1
fi
start_epoch=$(( head_epoch > 900 ? head_epoch - 900 : 0 ))
$FOREST_CLI_PATH state compute --epoch "$start_epoch" -n 10 -v
Copy link
Member

Choose a reason for hiding this comment

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

how long does it take?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

<10s

@akaladarshi akaladarshi added this pull request to the merge queue Aug 22, 2025
Merged via the queue into main with commit 80d0375 Aug 22, 2025
45 of 46 checks passed
@akaladarshi akaladarshi deleted the hm/test-state-compute branch August 22, 2025 10:05
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.

Tests for forest-cli state compute

4 participants