Skip to content

feat: symbiotic setup and slash tests#1507

Open
rackstar wants to merge 7 commits intorelease-candidatefrom
feat/symbiotic-setup-and-slash-tests
Open

feat: symbiotic setup and slash tests#1507
rackstar wants to merge 7 commits intorelease-candidatefrom
feat/symbiotic-setup-and-slash-tests

Conversation

@rackstar
Copy link
Copy Markdown
Contributor

@rackstar rackstar commented Feb 6, 2026

Description

  • added symbiotic-setup
    • 70 day epoch duration
    • network address == operator address == middleware address (SAFE multisig)
    • burnerRouter contract owner == burnerRouter receiver (SAFE multisig)
    • 2 subnetworks
    • 1 operator
    • 4 vaults
  • added symbiotic-tests
    • slash tests
    • config change tests

Testing

Explain how you tested your changes to ensure they work as expected.

Checklist

  • Performed a self-review of my own code
  • Made corresponding changes to the documentation

Summary by CodeRabbit

Release Notes

  • Tests
    • Added comprehensive test suite for Symbiotic integration, covering vault deployments, staking, and subnetwork allocations with state verification.
    • Added extensive slashing scenario tests validating token flows, delegator adjustments, and state transitions across various withdrawal states.
    • Added Safe multisend transaction workflow validation for configuring network components in a single transaction.

@rackstar rackstar self-assigned this Feb 6, 2026
@rackstar rackstar added the feature New capability or change in behavior label Feb 6, 2026
@rackstar rackstar moved this to 🏗 In progress in Engineering Tracker 💻 Feb 6, 2026
@rackstar rackstar mentioned this pull request Feb 6, 2026
2 tasks
@rackstar rackstar force-pushed the feat/symbiotic-setup-and-slash-tests branch 3 times, most recently from 7702ca4 to 12d256a Compare February 11, 2026 09:52
@rackstar rackstar changed the base branch from release-candidate to feat/add-data-deadline-to-ri-cover-signature February 11, 2026 09:53
@rackstar rackstar force-pushed the feat/symbiotic-setup-and-slash-tests branch from 12d256a to 2186a02 Compare February 11, 2026 09:55
@MilGard91 MilGard91 force-pushed the feat/add-data-deadline-to-ri-cover-signature branch from ea7848a to d937277 Compare February 16, 2026 09:53
@MilGard91 MilGard91 force-pushed the feat/symbiotic-setup-and-slash-tests branch from 2186a02 to 8c00c3a Compare February 16, 2026 09:54
Base automatically changed from feat/add-data-deadline-to-ri-cover-signature to release-candidate February 17, 2026 11:30
@rackstar rackstar force-pushed the feat/symbiotic-setup-and-slash-tests branch 2 times, most recently from b582e1f to 8046746 Compare February 20, 2026 12:31
shark0der
shark0der previously approved these changes Feb 20, 2026
@github-project-automation github-project-automation bot moved this from 🏗 In progress to 👀 In review in Engineering Tracker 💻 Feb 20, 2026
@rackstar rackstar force-pushed the feat/symbiotic-setup-and-slash-tests branch from 8046746 to ee83c50 Compare March 17, 2026 08:34
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 17, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

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.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dc86ad85-87fe-463b-968d-7c34a0149889

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds three comprehensive test files for Symbiotic protocol integration. Includes setup orchestration for multi-vault deployments, registrations, staking, and subnetwork allocations; a Safe multisend workflow test; and extensive slashing scenario tests with state validation and token flow verification.

Changes

Cohort / File(s) Summary
Symbiotic Integration Setup
test/fork/symbiotic/symbiotic-setup.js
Comprehensive setup test orchestrating vault deployments, contract registrations, middleware configuration, staking, and subnetwork quota allocation with helper functions for vault creation, balance management, and deployment verification.
Symbiotic Safe Transaction Workflow
test/fork/symbiotic/symbiotic-setup-safe-tx.js
Test validating Safe multisend workflow to configure network Symbiotic components in a single transaction, encoding four contract calls and verifying middleware, opt-in status, and registry recognition.
Symbiotic Slashing Test Scenarios
test/fork/symbiotic/symbiotic-tests.js
Comprehensive slashing test suite covering multiple scenarios including active-only slashing, slashing with queued/claim-eligible withdrawals, multi-epoch sequences, state transitions, token flow validation, and config updates with extensive logging and invariant checks.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~70 minutes

Suggested labels

test

Suggested reviewers

  • roxdanila
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically identifies the main changes: adding Symbiotic setup and slash tests, which aligns with the new test files introduced.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/symbiotic-setup-and-slash-tests
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/symbiotic-setup-and-slash-tests

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

Copy link
Copy Markdown

@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: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/fork/symbiotic/symbiotic-setup-safe-tx.js`:
- Around line 75-77: The test currently asserts safeReceipt.status equals BigInt
by comparing to 1n; update the assertion to compare the numeric
TransactionReceipt.status to 1 (not 1n). Locate the code using
executeSafeTransaction, safeTx, and safeReceipt and change the expectation to
expect(safeReceipt.status).to.equal(1) so it matches ethers v6's number-typed
receipt.status.

In `@test/fork/symbiotic/symbiotic-setup.js`:
- Around line 579-582: The opt-in assertions use undefined properties
this.vault1Addr..vault4Addr; update each call to use the deployed vault target
stored on the vault objects (e.g. replace this.vault1Addr with
this.vault1.vault.target) so that
operatorVaultOptIn.isOptedIn(this.operator1.address, <vault>.vault.target) is
asserted for vault1..vault4.

In `@test/fork/symbiotic/symbiotic-tests.js`:
- Around line 1242-1263: The test relies on state mutated by a previous test
(operatorNetworkReceiver) so make the receiver override part of this test’s
setup: after setting middleware
(this.middlewareService.connect(...).setMiddleware(...)) and before calling
this.burnerRouter.triggerTransfer(this.newMiddleware.address), explicitly set
the operator/ network receiver to this.newMiddleware (the same override that
previous tests set, i.e. ensure
SAFE_MULTISIG_SLASH_RECEIVER/operatorNetworkReceiver is updated for this.network
and this.operator1) so the triggered transfer actually routes slashed funds to
this.newMiddleware; update the test to perform that receiver override as part of
its setup and then proceed with slash and triggerTransfer.
- Around line 1212-1239: The delegated-stake assertion assumes a 1:1 reduction
but delegated stake is bounded by min(activeStake, subnetworkLimit); replace the
calculation for expectedAfterDelegatedStake so it uses
Math.min(beforeVaultStake, subnetworkLimit) minus amountToSlash (obtain
subnetworkLimit from the test fixture object for subnetwork1), then compare that
to afterDelegatedStake; apply the same adjustment to the analogous assertion
block further down.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 66442732-438d-4932-9f51-05dbfa112da8

📥 Commits

Reviewing files that changed from the base of the PR and between ad21204 and ee83c50.

📒 Files selected for processing (3)
  • test/fork/symbiotic/symbiotic-setup-safe-tx.js
  • test/fork/symbiotic/symbiotic-setup.js
  • test/fork/symbiotic/symbiotic-tests.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New capability or change in behavior

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

2 participants