Endblocker
EndBlocker
EndBlocker
is the function that calls at the end of each block. In x/gov
module it is responsible for handling
proposals, especially changing their states and execute them if needed. For OversightCommittee
flow we are going to
change the stages when the Proposal
is about to be executed.
Normally, when VotingPeriod
is ended and there are enough VotingPower
to move the Proposal
to the execution stage,
EndBlocker
makes next phases:
- Vote routine
- Execution routine
Vote routine
Vote routine includes all the voting steps and calculations, like:
- Remove all the
Votes
related to theProposal
from the state. TallyResult
is calculated on this phase.
Execution routine
Execution routine is responsible for the following:
- Execute messages, attached to the
Proposal
, by passing them toMsgRouter
- Mark
Proposal
asPASSED
in case of successful execution orFAILED
in case of unsuccessful.
Proposal status delayed
For OversightCommittee
flow we are introducing another state for the Proposal
- ProposalStatusDelayed
. It includes
all the previous steps, except real message execution and moving Proposal
to final states, like PASSED
or FAILED
.
The main points, regarding new state:
- All the steps from Voting routine are done
- Actions related to deposit are executed, like
burn deposit
orreturn to proposer
.
Having this modified EndBlocker
changes Proposal
's status to ProposalStatusDelayed
and returns it back into
ActiveProposalsQueue
but with shifted VotingPeriodEnd
by Grace Period
from OversightCommitteeParams
.
When the shifted VotingPeriodEnd
is reached, the Proposal
goes to the Execution routine.