-
Notifications
You must be signed in to change notification settings - Fork 67
refactor: TaskGenerator
rewrite
#635
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
Conversation
type TaskGenerator struct { | ||
// Type is generic over the task input type | ||
type TaskManager[Input any] interface { | ||
CreateNewTask(opts *bind.TransactOpts, input Input, quorumThresholdPercentage uint32, quorumNumbers []byte) (*gethtypes.Transaction, 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.
I don't like that this requires the implementor to return the Transaction
because it limits the kind of things they could do inside of this. However, one could hack around this restriction by simply returning an empty transaction and nil error, and using a custom TxManager
that ignores all transactions.
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's a good catch. However, I think we can leave this change for a future change.
I left some TODOs in the code, but they can be addressed later. The main idea is whole. |
I added a configuration struct with the quorum parameters, logger, and time between tasks (which I changed to be of type I also tried doing a refactor to split the interface in two, which I found too complex for now (so I reverted it), but we might want to revisit it later: adc5dd2 |
Fixes # .
What Changed?
This PR rewrites the
TaskGenerator
to reduce the amount of code an AVS would need to write.Reviewer Checklist