Skip to content

feat(ejector): cross-domain safety check for finalization and retry params#2487

Open
ethenotethan wants to merge 5 commits intomasterfrom
ethenotethan--feat-cross-domain-invariance
Open

feat(ejector): cross-domain safety check for finalization and retry params#2487
ethenotethan wants to merge 5 commits intomasterfrom
ethenotethan--feat-cross-domain-invariance

Conversation

@ethenotethan
Copy link
Contributor

Why are these changes needed?

Adds an invariant check to the EjectionsConfig which enforces that the RetryDelay and FinalizationDelay fields are greater than or equal to the cooldown and delay params stored in the EjectionsManager contract state.

Checks

  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • I've checked the new test coverage and the coverage percentage didn't drop.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

Copilot AI review requested due to automatic review settings February 4, 2026 19:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a startup-time invariant to ensure the ejector’s configured retry/finalization delays are not shorter than the on-chain EjectionManager cooldown/delay parameters, preventing premature retry/finalization attempts.

Changes:

  • Read ejectionCooldown / ejectionDelay from the IEigenDAEjectionManager contract at bootstrap and validate config against them.
  • Add EjectorConfig.HasSufficientOnChainMirror(cooldown, finalizationDelay uint64) to enforce the invariant.
  • Add unit tests covering valid/invalid configurations and edge cases.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
ejector/main/main.go Adds on-chain parameter reads during startup and invokes the new config invariant check.
ejector/ejector_config.go Introduces HasSufficientOnChainMirror validation method for config vs on-chain parameters.
ejector/ejector_config_test.go Adds unit tests for the new validation logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return fmt.Errorf("failed to create ejection manager caller: %w", err)
}

coolDownSeconds, err := caller.EjectionCooldown(&bind.CallOpts{Context: ctx})
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

New local name coolDownSeconds is inconsistent with Go camel-casing and the surrounding naming (e.g., finalizationDelaySeconds). Consider renaming to cooldownSeconds for readability/consistency.

Suggested change
coolDownSeconds, err := caller.EjectionCooldown(&bind.CallOpts{Context: ctx})
cooldownSeconds, err := caller.EjectionCooldown(&bind.CallOpts{Context: ctx})

Copilot uses AI. Check for mistakes.
// the EjectionsManager contract's param values.
//
// If improperly set, there'd be performance degredations in the ejector's processing timeline
// where retried ejections could be attempted pre-maturely as well as finanlization claim txs
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

Spelling in this new doc comment: "finanlization" -> "finalization".

Suggested change
// where retried ejections could be attempted pre-maturely as well as finanlization claim txs
// where retried ejections could be attempted pre-maturely as well as finalization claim txs

Copilot uses AI. Check for mistakes.
Comment on lines +132 to +133
// If improperly set, there'd be performance degredations in the ejector's processing timeline
// where retried ejections could be attempted pre-maturely as well as finanlization claim txs
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The doc comment above HasSufficientOnChainMirror ends mid-sentence (line 133-134) and doesn’t fully describe the failure mode/behavior. Please complete the comment (and add punctuation) so it accurately explains what the check guarantees and what happens when it fails.

Suggested change
// If improperly set, there'd be performance degredations in the ejector's processing timeline
// where retried ejections could be attempted pre-maturely as well as finanlization claim txs
// If these values are improperly set, there can be performance degradations in the ejector's
// processing timeline where retried ejections and finalization claim transactions are attempted
// prematurely relative to the on-chain cooldown and finalization delay, leading to reverted
// transactions and wasted gas; when such a mismatch is detected, this method returns an error
// instead of allowing the ejector to run with unsafe timing parameters.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.31%. Comparing base (0ba93f1) to head (ec6d581).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2487      +/-   ##
==========================================
+ Coverage   39.30%   39.31%   +0.01%     
==========================================
  Files         536      536              
  Lines       49005    49016      +11     
==========================================
+ Hits        19261    19272      +11     
  Misses      27305    27305              
  Partials     2439     2439              
Flag Coverage Δ
litt-tests 32.99% <ø> (ø)
unit-tests 40.18% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

ethenotethan and others added 4 commits February 5, 2026 02:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…om:Layr-Labs/eigenda into ethenotethan--feat-cross-domain-invariance
@ethenotethan ethenotethan changed the title feat(ejector): cross-domain safety check for finalization and cooldown params feat(ejector): cross-domain safety check for finalization and retry params Feb 4, 2026
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