Skip to content

Conversation

@taco-paco
Copy link
Contributor

@taco-paco taco-paco commented Oct 30, 2025

⚠️ NOTE: Use notes like this to emphasize something important about the PR.

This could include other PRs this PR is built on top of; API breaking changes; reasons for why the PR is on hold; or anything else you would like to draw attention to.

Status Type ⚠️ Core Change Issue
Hold Refactor No Link

Problem

What problem are you trying to solve?

Solution

How did you solve the problem?

Before & After Screenshots

Insert screenshots of example code output

BEFORE:
[insert screenshot here]

AFTER:
[insert screenshot here]

Other changes (e.g. bug fixes, small refactors)

Deploy Notes

Notes regarding deployment of the contained body of work. These should note any
new dependencies, new scripts, etc.

New scripts:

  • script : script details

New dependencies:

  • dependency : dependency details

Summary by CodeRabbit

  • Tests

    • Updated integration test configuration for delegation workflows to use explicit, fixed settings, improving test reliability and consistency.
  • Chores

    • CI pipeline enhanced with production build verification step to ensure build integrity during testing.
    • Debug logging added for instruction processing diagnostics.
    • Minor code formatting improvements applied.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 30, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

A new production build step for cargo build-sbf was added to the CI workflow. Debug logging was introduced for instruction processing variants. Test delegation configuration was updated to use explicit validator and commit frequency values. Minor indentation cleanup was applied.

Changes

Cohort / File(s) Summary
CI Workflow Update
.github/workflows/run-tests.yml
Added a new build-sbf step to compile production version for integration tests, positioned after test execution and before cleanup.
Debug Logging
src/lib.rs
Introduced conditional debug logging in fast_process_instruction to report processing status for specific discriminator variants (Delegate, CommitState, CommitStateFromBuffer, Finalize, Undelegate) when unit_test_config feature is enabled.
Formatting
src/processor/fast/finalize.rs
Applied indentation adjustment to the drop(commit_record_data); statement; no functional changes.
Test Configuration
tests/integration/programs/test-delegation/src/lib.rs
Imported DelegateAccountArgs and replaced default DelegateConfig initialization with explicit configuration specifying fixed validator public key and derived commit frequency in three test delegate call sites.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • tests/integration/programs/test-delegation/src/lib.rs: Verify the validator public key hardcoding and confirm the semantic equivalence of deriving commit_frequency_ms from DelegateAccountArgs::default() versus using DelegateConfig::default().

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description follows the repository's template structure but contains no substantive content—all major sections including Problem, Solution, Before & After Screenshots, Other changes, and Deploy Notes remain as template placeholders without any actual information filled in. While the metadata table (Status, Type, Core Change) is completed, the lack of real description content about what problem is being solved, how it was solved, or why the PR is on hold makes the description largely incomplete and unhelpful for reviewers trying to understand the rationale and impact of the changes. The author should provide substantive content for at least the Problem and Solution sections to explain what issue this refactor addresses and how the changes resolve it. Additionally, since the PR is marked as "Hold" in the status field, a clear note in the warning section at the top should explain the reason for holding the PR. The Deploy Notes section should be clarified or removed if no deployment-specific information is needed for this change.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "Integration tests use prod version of dlp to test against" directly aligns with the main changes in the changeset. The raw summary shows that the primary change is adding a new workflow step to compile a production version for integration tests (via cargo build-sbf) and updating integration test configurations to use this production build. The title is concise, clear, and specifically conveys the core objective without vague language or unnecessary noise, making it easy for teammates to understand the primary purpose of the changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6689bdf and 77dceb0.

⛔ Files ignored due to path filters (1)
  • tests/integration/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • .github/workflows/run-tests.yml (1 hunks)
  • src/lib.rs (1 hunks)
  • src/processor/fast/finalize.rs (1 hunks)
  • tests/integration/programs/test-delegation/src/lib.rs (3 hunks)
⏰ 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). (1)
  • GitHub Check: install
🔇 Additional comments (4)
.github/workflows/run-tests.yml (1)

88-91: LGTM! Production build step correctly positioned.

This new step ensures integration tests run against the production build (without unit_test_config feature flag), while unit tests continue to use the debug configuration. The positioning is correct: it runs after unit tests and before cleanup, ensuring the production dlp.so artifact is what gets preserved for integration tests.

src/lib.rs (1)

64-74: LGTM! Debug logging appropriately gated.

The conditional logging for fast-path instructions is correctly gated by the unit_test_config feature flag, ensuring it only appears during unit tests and not in production builds. This aligns well with the PR objective of differentiating between test and production configurations.

tests/integration/programs/test-delegation/src/lib.rs (2)

15-15: LGTM! Import added for explicit configuration.

The import of DelegateAccountArgs is necessary to access the default commit frequency value in the explicit DelegateConfig construction below.


40-43: I need to examine the full test file to see if there's test setup code and check for test configuration.

No verification needed—the hardcoded pubkey is valid test data.

The validator pubkey "tEsT3eV6RFCWs1BZ7AXTzasHqTtMnMLCB2tjQ42TDXD" is a valid Solana pubkey format (base58-encoded 32 bytes, 32-44 characters long). The naming convention ("tEsT" prefix) and consistent use across lines 42, 55, and 63 indicate this is intentional test data. The pubkey! macro validates the format at compile-time. Whether the validator account exists during test execution depends on the test setup configuration (Anchor.toml or programmatic validator initialization), which is separate from the code change itself and should be verified during test execution.

@taco-paco taco-paco changed the base branch from main to fix/return-logs-for-tests-pr October 30, 2025 07:20
@taco-paco taco-paco force-pushed the fix/return-logs-for-tests-pr branch from 75fde9a to fa8e616 Compare October 30, 2025 07:22
Copy link
Contributor

@GabrielePicco GabrielePicco left a comment

Choose a reason for hiding this comment

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

LGTM, assuming few comments are addressed before merging

DelegateConfig::default(),
DelegateConfig {
commit_frequency_ms: DelegateAccountArgs::default().commit_frequency_ms,
validator: Some(pubkey!("tEsT3eV6RFCWs1BZ7AXTzasHqTtMnMLCB2tjQ42TDXD")),
Copy link
Contributor

Choose a reason for hiding this comment

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

Should use a consts instead of hardcoding and repeating the validator pubkey

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced

src/lib.rs Outdated
| DlpDiscriminator::Finalize
| DlpDiscriminator::Undelegate
) {
msg!("Processing instruction: {:?}", discriminator);
Copy link
Contributor

@GabrielePicco GabrielePicco Oct 30, 2025

Choose a reason for hiding this comment

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

This change is unrelated to the PR. As mentioned in PR #109 I suggest to move all logs under a logging feature and to simplify it:

#[cfg(feature = "logging")]
msg!("Processing instruction: {:?}", discriminator);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed this change, redirected PR into main

@taco-paco taco-paco force-pushed the fix/integration-using-unit-test-config-flag branch from c5107ed to 471d2cc Compare October 30, 2025 09:12
@taco-paco taco-paco changed the base branch from fix/return-logs-for-tests-pr to main October 30, 2025 09:13
@taco-paco taco-paco merged commit c178510 into main Oct 30, 2025
4 checks passed
@snawaz
Copy link
Contributor

snawaz commented Oct 31, 2025

I liked this solution. Great work, @taco-paco . :-)

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.

4 participants