-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
enhancementNew feature or requestNew feature or request
Description
There are two main StateTransition functions: preBlock (empty slot) and perBlock. However, their construction somewhat clumsy and non-uniform accross code base.
E.g.
initialTransition = new InitialStateTransition(chainStartEvent, spec);
perSlotTransition = new PerSlotTransition(spec);
perBlockTransition = new PerBlockTransition(spec);
perEpochTransition = new PerEpochTransition(spec);
extendedSlotTransition =
new ExtendedSlotTransition(perEpochTransition, perSlotTransition, spec);
emptySlotTransition = new EmptySlotTransition(extendedSlotTransition);
In order to improve readability and reduce code duplication, refactor StateTransition construction.
There can be (at least) two steps:
1 there exists already StateTransitions class with appropriate helper functions (preBlockTransition and blockTransition). The only problem is that some benchmarking code overloads some methods to gather statistics.
2 Incapsulate state transition logic in a Stepper class, having two methods: processSlots and processBlock (or something like this).
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request