-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ejector #493
Ejector #493
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏👏👏
One general question. It's fine for this PR as we want this functionality asap, but I'm not sure if dataapi
is the right place to host this method. dataapi
is meant to serve (readonly) data, and we eventually want to make it available for external parties to run as well.
"github.com/Layr-Labs/eigensdk-go/logging" | ||
) | ||
|
||
// The caller should ensure "stakeShare" is in range (0, 1]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
stakeShareToSLA converts stake share to the enforced SLA metric.
`stakeShare` must be in range (0, 1].
so that it gets registered by godoc
disperser/dataapi/ejector.go
Outdated
} | ||
} | ||
|
||
func (e *ejector) eject(ctx context.Context, nonsigningRate *OperatorsNonsigningPercentage, mode string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mode
isn't used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it'll be used after fixing the TODO to update metrics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this isn't needed even after fixing TODO -- removed it!
@@ -0,0 +1,124 @@ | |||
package dataapi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a test for ejector
// @Failure 404 {object} ErrorResponse "error: Not found" | ||
// @Failure 500 {object} ErrorResponse "error: Server error" | ||
// @Router /ejector/ejection [get] | ||
func (s *server) EjectOperatorsHandler(c *gin.Context) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a test on server_test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I few questions. I'd encourage us to try to merge this today, even if some of the smaller issues need a followup PR.
disperser/dataapi/ejector.go
Outdated
case stakeShare > 0.1: | ||
return 0.975 | ||
case stakeShare > 0.05: | ||
return 0.95 | ||
default: | ||
return 0.9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update to new SLA
@@ -292,6 +301,68 @@ func (s *server) Shutdown() error { | |||
return nil | |||
} | |||
|
|||
// EjectOperatorsHandler godoc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the plan for how this will be automated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
call it from grafana
disperser/dataapi/ejector.go
Outdated
sla := stakeShareToSLA(stakeShare) | ||
perf := (1 - sla) / nonsigningRate | ||
return perf / (1.0 + perf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit uncertain about whether this scoring will give us the right ordering across SLA classes. Interested to know if there was a rationale for this particular scoring. I'll put some further thought into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The breakdown will be:
1 - sla
is the error budget,nonsingingRate / (1 - sla)
is how badly it has burnt the error budget- the inverse is indicating perf
- then normalize it
a control plane restructuring will be needed later. For now this will be permissioned at upper layer as well as inside the server (with the secrete token) |
Why are these changes needed?
Make an Ejector API for automated ejection of nonsigners based on objective onchain nonsigning rates and protocol SLA: https://docs.eigenlayer.xyz/eigenda/operator-guides/requirements/protocol-SLA.
Checks