From e35b3962d9da36101dd9bc696a6c62feaecd6455 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 4 May 2023 16:31:30 -0400 Subject: [PATCH] docs: update spec (#90) --- SPEC.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/SPEC.md b/SPEC.md index 30a11be..d71156c 100644 --- a/SPEC.md +++ b/SPEC.md @@ -120,6 +120,36 @@ the sender's sequence number. The global index prioritizes transactions based on `ctx.Priority()` and the auction index prioritizes transactions based on the bid. +### Configuration + +The `AuctionMempool` mempool implementation accepts a `AuctionFactory` +interface that allows the mempool to be generic across many Cosmos SDK +applications, such that it allows the ability for the application developer to +define their business logic in terms of how to perform things such as the following: + +* Getting tx signers +* Getting bundled tx signers +* Retrieving bid information + + +```go +// AuctionFactory defines the interface for processing auction transactions. +// It is a wrapper around all of the functionality that each application chain +// must implement in order for auction processing to work. +type AuctionFactory interface { + // WrapBundleTransaction defines a function that wraps a bundle transaction + // into a sdk.Tx. Since this is a potentially expensive operation, we allow + // each application chain to define how they want to wrap the transaction + // such that it is only called when necessary (i.e. when the transaction is + // being considered in the proposal handlers). + WrapBundleTransaction(tx []byte) (sdk.Tx, error) + + // GetAuctionBidInfo defines a function that returns the bid info from an + // auction transaction. + GetAuctionBidInfo(tx sdk.Tx) (*AuctionBidInfo, error) +} +``` + ### PrepareProposal After the proposer of the next block has been selected, the CometBFT client will