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.
[x] Add GadgetEnvironment trait to decouple and reorganize the entire repository
[x] Remove pallet_tx, replace with GadgetEnvironment::TransactionManager
[x] Remove anything tangle-related from common and instead place inside a new crate that holds multiple feature-flagged GadgetEnvironment implementations
[ ] Remove as many of the substrate dependencies from core/common as possible
[ ] Remove and Replace the v1 macros that auto-implemented FullProtocolConfig and ProtocolConfig with v2 versions
Afterward, we can work on v2-specific code to use the v2 branch of Tangle:
[ ] Ensure TangleEnvironment and TangleExtEnvironment use the new blueprints API instead of the old jobs API
[ ] Add in a singular stub or simple protocol that tests the use of the TangleExtEnvironment and the new v2 macros
[ ] Add integration test in the pipeline for the stub or simple protocol above
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 isAbstractGadget::on_event_received(&self, event: AbstractGadget::Event)
Currently, we have a pre-defined
TangleEnvironment
andTangleExtEnvironment
(one for a live chain, the other for a testing externalities environment, respectively). These help showcase leveraging theGadgetEnvironment
trait in the current setup.Yet, there are still some leftover artifacts from v1 that need to be removed.
GadgetEnvironment
trait to decouple and reorganize the entire repositorypallet_tx
, replace withGadgetEnvironment::TransactionManager
common
and instead place inside a new crate that holds multiple feature-flaggedGadgetEnvironment
implementationsFullProtocolConfig
andProtocolConfig
with v2 versionsAfterward, we can work on v2-specific code to use the v2 branch of Tangle:
TangleEnvironment
andTangleExtEnvironment
use the new blueprints API instead of the old jobs APITangleExtEnvironment
and the new v2 macros