Vote extensions is arbitrary information which can be inserted into a block. This feature is part of ABCI 2.0, which is available for use in the SDK 0.50 release and part of the 0.38 CometBFT release.More information about vote extensions can be seen here.
We’ll go through the creation of a simple price oracle module focusing on the vote extensions implementation, ignoring the details inside the price oracle itself.We’ll go through the implementation of:
ExtendVote to get information from external price APIs.
VerifyVoteExtension to check that the format of the provided votes is correct.
PrepareProposal to process the vote extensions from the previous block and include them into the proposal as a transaction.
ProcessProposal to check that the first transaction in the proposal is actually a “special tx” that contains the price information.
PreBlocker to make price information available during FinalizeBlock.
If you would like to see the complete working oracle module please see here