Skip to content

Conversation

@MegaRedHand
Copy link
Contributor

@MegaRedHand MegaRedHand commented May 5, 2025

What Changed?

This PR contains the second iteration of the high-level modules.

Centralized TaskManager trait

All traits related to interaction with the TaskManager contract were merged into the TaskManager trait. Another TaskManagerDefs trait was introduced for types and constants associated with the contract.

Examples

Existing examples were reorganized to be inside a single crate (incredible-squaring). Two more examples mimicking AVSs were added: incredible-dot-product and awesome-vault-service.

damiramirez and others added 2 commits April 30, 2025 18:01
### What Changed?
Rewrite aggregator logic.

- Added a generic `TaskProcessor` trait to encapsulate custom task
handling logic.
- Added a contract wrapper interface `TaskManagerContract` to simplify
integration with the user’s binding.
- Made both `Task` and `TaskResponse` generic
- Provided an `IndexingTaskProcessor` struct that implements
`TaskProcessor` out of the box.

Note: This PR currently breaks the example, it no longer compiles due to
changes in the aggregator logic. We should merge the [example
PR](lambdaclass#10) here.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it

---------

Co-authored-by: Pablo Deymonnaz <deymonnaz@gmail.com>
Co-authored-by: Pablo Deymonnaz <pdeymon@fi.uba.ar>
### What Changed?

This PR changes some types to be
`SignedTaskResponse<TaskResponse<Output>>` . We were running into an RPC
communication issue between the operator and aggregator due to a type
mismatch during parsing. Both sides now send and expect
`SignedTaskResponse<TaskResponse<Output>>`.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it

---------

Co-authored-by: Pablo Deymonnaz <deymonnaz@gmail.com>
@MegaRedHand MegaRedHand changed the title feat(v2): generic task processor (#465) v2: milestone 1 May 5, 2025
MegaRedHand and others added 27 commits May 5, 2025 13:23
Fixes #

### What Changed?

This PR moves all v2 examples to a single crate. It also changes the
aggregator example to start an aggregator only.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it

---------

Co-authored-by: Damian Ramirez <damian.ramirez@lambdaclass.com>
Fixes #

### What Changed?

This PR adds an `OperatorConfig` struct used for operator configuration.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
Fixes #

### What Changed?

This PR merges the traits used by the `TaskSpammer` and `Aggregator` in
a single one.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
### What Changed?
This PR introduces new traits to generalize the challenger.

- `TaskManagerContract` trait acts as a wrapper around the user’s
contract. The user must provide the function call that invokes the
challenge.
- `ChallengerTaskProcessor` trait is responsible for handling the logic
when a `NewTaskCreated` or `TaskResponded` event is received.
- `ChallengerTaskProcessor` struct implements `ChallengerTaskProcessor`.
This default struct encapsulates the logic for managing tasks and
handling events.
- `Challenger` starts the service and subscribes to the events.
- Update the IS example with new version


### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it

---------

Co-authored-by: Pablo Deymonnaz <deymonnaz@gmail.com>
…trait (#481)

### What Changed?

This PR consolidates the challenger’s `TaskManager` trait into the task
processor `TaskManager` trait, unifying them into a single trait instead
of two.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
``
Fixes #

### What Changed?

This PR removes three unneeded generic parameters from the
`TaskManagerContract` trait.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
…ctor only (#484)

### What Changed?

This PR simplifies the `TaskManagerContract` trait to only store the
selector of the "new task" and "task responded" events.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
### What Changed?
This PR adds a helper function that combines correct and incorrect
response logic into a single closure and introduces a feature flag to
enable it, since it is intended for testing purposes only.


### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
### What Changed?

This PR disables doctests for the `incredible-squaring` example bindings
to fix test failures.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
### What Changed?

This PR adds a macro to implement the `TaskManagerContract` trait. It
also renames the trait to `TaskManager`.

The change reduces the example's code by ~150 lines.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…r` (#496)

### What Changed?
This PR moves the logic for obtaining non-signing operator public keys
from the `IndexingTaskProcessor` into the `aggregator`. With this
change, users no longer need to implement it themselves.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
Fixes #

### What Changed?

This PR splits the `TaskManager` trait into `TaskManagerDefs`, which
includes type definitions and constants, and the `TaskManager` trait
which requires the `Defs` and implements the other methods.

This simplifies the macro by reducing its parameters to a type
implementing `TaskManagerDefs`, and another which is an Alloy contract
instance.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
### What Changed?

This PR makes the functions received by the Operator and Challenger more
similar.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it

---------

Co-authored-by: Damian Ramirez <damian.ramirez@lambdaclass.com>
### What Changed?
This PR introduces a mini AVS called `Incredible Dot Product`. The goal
of this example is to show users how to create an AVS and use its code
as a foundation for building additional functionality. We want to
highlight the developer experience.

---

<img width="1678" alt="image"
src="https://github.com/user-attachments/assets/4aec8b4c-808a-44d8-ba08-4393d9a952ab"
/>


### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it

---------

Co-authored-by: Pablo Deymonnaz <deymonnaz@gmail.com>
### What Changed?
This PR removes `serde` serialization from `TaskResponse`,
`SignedTaskResponse` and generics. Now we use abi encoding and decoding.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
### What Changed?

This PR changes the function that the operator receives to process a
task from sync to async.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
### What Changed?

- Renamed crate `task-processor` to `task-manager`.  
- Moved the task processor trait and its standard implementation
(`IndexingTaskProcessor`) into the `aggregator` crate.
- Updated other crates to use the new import paths.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
### What Changed?
This PR updates the Challenger so it now accepts an async task
verification function.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
### What Changed?

This PR adds a config for the `challenger`

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
### What Changed?

This PR adds a new example `awesome-vault-service`.

- The AVS stores key-value tuples like a dictionary.
- Operators store the key-value tuples with the latest values for each
element. On each task, they output the number of items and the hash of
the concatenated items.


### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it

---------

Co-authored-by: Tomás Grüner <47506558+MegaRedHand@users.noreply.github.com>
### What Changed?

Thi PR removes completed task from the `aggregator` and `challenger`

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it

---------

Co-authored-by: Tomás Grüner <47506558+MegaRedHand@users.noreply.github.com>
### What Changed?

This PR moves the decode logic into its own file and adds the event type
aliases there.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it

---------

Co-authored-by: Tomás Grüner <47506558+MegaRedHand@users.noreply.github.com>
Fixes #

### What Changed?
<!-- Describe the changes made in this pull request -->

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
### What Changed?
This PR adds a new `ResponseCalculator` trait to encapsulate the
`compute_response` logic.
- Adds a new `response_calculator.rs` file to the `task_manager` crate.
- Adds a standard `FunctionResponseCalculator` struct that implements
`ResponseCalculator`.
- Moves `failing_response_calculator` from the `operator` crate into
`task_manager`.
- Moves the `operator-testing` feature from the `operator` crate into
`task_manager`.
- Updates all examples to use the new version.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
…ator config (#510)

Fixes #

### What Changed?
This PR updates the operator config from BlsKeyPair to string. Now we
need the BLS PK.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
### What Changed?

This PR removes hardcoded values and parse config from TOML in
`/examples`

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
### What Changed?

This PR bumps the MSRV and Rust compiler version to 1.82.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
### What Changed?

Add on-startup registration check for EigenLayer operators

- Verifies whether the operator is already registered on EigenLayer.
- If not registered, uses the provided `OperatorRegistrationConfig` to
perform the registration.

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
### What Changed?
Pass the logger as a parameter to the Aggregator, so users has the
flexibility to use our logger or configure their own as they prefer

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it
@MegaRedHand MegaRedHand marked this pull request as ready for review May 19, 2025 14:32
Fixes #

### What Changed?
<!-- Describe the changes made in this pull request -->

### Reviewer Checklist

- [ ] New features are tested and documented
- [ ] PR updates the changelog with a description of changes
- [ ] PR has one of the `changelog-X` labels (if applies)
- [ ] Code deprecates any old functionality before removing it

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Pablo Deymonnaz <deymonnaz@gmail.com>
Co-authored-by: Pablo Deymonnaz <pdeymon@fi.uba.ar>
Co-authored-by: Tomás Grüner <47506558+MegaRedHand@users.noreply.github.com>
Co-authored-by: supernovahs <91280922+supernovahs@users.noreply.github.com>
Co-authored-by: supernovahs <supernovahs@proton.me>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Maximo Palopoli <96491141+maximopalopoli@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants