- The stage implements the trait required by the next stage.
- The stage uses the same trait for the previous stage as the current stage to be swapped out.
L1Retrieval stage.
Example
In the current, post-Holocene hardforkDerivationPipeline, the bottom three
stages of the pipeline are as follows (from top down).
In this set of stages, the IndexedTraversal or PollingTraversal stage sits at the bottom.
It implements the L1Retrieval trait called the
L1RetrievalProvider. This provides generic methods that
allow the L1Retrieval stage to call those methods on the generic
previous stage that implements this provider trait.
As we go up a level, the same trait abstraction occurs. The L1Retrieval
stage implements the provider trait that the FrameQueue stage requires.
This trait is the FrameQueueProvider.
Now that we understand the trait abstractions, let’s swap out the
L1Retrieval stage for a custom DapRetrieval stage.
L1RetrievalProvider is used as a trait bound so the
IndexedTraversal or PollingTraversal stage can be used seamlessly as the “prev” stage in the pipeline.
Concretely, an instantiation of the DapRetrieval stage could be the following.