webb-tools / gadget

A framework for building modular AVS and Tangle Blueprints: https://docs.tangle.tools/developers/blueprints.
https://tangle.tools
MIT License
5 stars 1 forks source link

[TASK] Gadget repo migration to v2 #171

Open tbraun96 opened 1 month ago

tbraun96 commented 1 month ago

For the repository to be ready to support the execution of blueprints, more generalization, decoupling, and refactoring is needed. With the completion of #154, we introduced the GadgetEnvironment trait which is implicated and used in virtually every other trait, thus allowing us to abstract away and generalize further without significant difficulty.

We removed the notion of finality notifications; now, we have events instead. These events can be anything defined in GadgetEnvironment::Event, and are expected to have an associated stream to receive these events (e.g., a web server, another blockchain's published blocks, FinalityNotifications, etc). The associated function that handles these events is AbstractGadget::on_event_received(&self, event: AbstractGadget::Event)

Currently, we have a pre-defined TangleEnvironment and TangleExtEnvironment (one for a live chain, the other for a testing externalities environment, respectively). These help showcase leveraging the GadgetEnvironment trait in the current setup.

Yet, there are still some leftover artifacts from v1 that need to be removed.

Afterward, we can work on v2-specific code to use the v2 branch of Tangle:

drewstone commented 5 days ago

Status update @tbraun96 ?