feat(ejector): cross-domain safety check for finalization and retry params#2487
feat(ejector): cross-domain safety check for finalization and retry params#2487ethenotethan wants to merge 5 commits intomasterfrom
Conversation
There was a problem hiding this comment.
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/ejectionDelayfrom theIEigenDAEjectionManagercontract 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.
ejector/main/main.go
Outdated
| return fmt.Errorf("failed to create ejection manager caller: %w", err) | ||
| } | ||
|
|
||
| coolDownSeconds, err := caller.EjectionCooldown(&bind.CallOpts{Context: ctx}) |
There was a problem hiding this comment.
New local name coolDownSeconds is inconsistent with Go camel-casing and the surrounding naming (e.g., finalizationDelaySeconds). Consider renaming to cooldownSeconds for readability/consistency.
| coolDownSeconds, err := caller.EjectionCooldown(&bind.CallOpts{Context: ctx}) | |
| cooldownSeconds, err := caller.EjectionCooldown(&bind.CallOpts{Context: ctx}) |
ejector/ejector_config.go
Outdated
| // 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 |
There was a problem hiding this comment.
Spelling in this new doc comment: "finanlization" -> "finalization".
| // 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 |
ejector/ejector_config.go
Outdated
| // 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 |
There was a problem hiding this comment.
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.
| // 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…om:Layr-Labs/eigenda into ethenotethan--feat-cross-domain-invariance
Why are these changes needed?
Adds an invariant check to the
EjectionsConfigwhich enforces that theRetryDelayandFinalizationDelayfields are greater than or equal to thecooldownanddelayparams stored in theEjectionsManagercontract state.Checks