@@ -19,6 +19,8 @@ There are fix critical steps to building a test app that uses the Block SDK:
|
||||
5. Setting the antehandlers - used for transaction validation - for each lane.
|
||||
6. Setting the proposal handlers - used for block creation and verification - for the application to utilize the Block SDK's Prepare and Process Proposal handlers.
|
||||
|
||||
**IMPORTANT NOTE:** It is recommended that applications use the **`NewDefaultProposalHandler`** when constructing their Prepare and Process Proposal handlers. This is because the priority nonce mempool - the underlying storage device of transactions - has non-deterministic ordering of transactions on chains with multiple fees. The use of the `NewDefaultProposalHandler` ensures that the ordering of transactions on proposal construction follows the ordering logic of the lanes, which is deterministic, and that process proposal optimistically assumes that the ordering of transactions is correct.
|
||||
|
||||
### 1. Signer Extractor
|
||||
|
||||
The signer extractor is responsible for extracting signers and relevant information about who is signing the transaction. We recommend using the default implementation provided by the Block SDK.
|
||||
|
||||
+10
-1
@@ -262,11 +262,20 @@ func New(
|
||||
|
||||
// Step 6: Create the proposal handler and set it on the app. Now the application
|
||||
// will build and verify proposals using the Block SDK!
|
||||
proposalHandler := abci.NewProposalHandler(
|
||||
//
|
||||
// NOTE: It is recommended to use the default proposal handler by constructing
|
||||
// using the NewDefaultProposalHandler function. This will use the correct prepare logic
|
||||
// for the lanes, but the process logic will be a no-op. To read more about the default
|
||||
// proposal handler, see the documentation in readme.md in this directory.
|
||||
//
|
||||
// If you want to customize the prepare and process logic, you can construct the proposal
|
||||
// handler using the New function and setting the useProcess flag to true.
|
||||
proposalHandler := abci.New( // use NewDefaultProposalHandler instead for default behavior (RECOMMENDED)
|
||||
app.Logger(),
|
||||
app.TxConfig().TxDecoder(),
|
||||
app.TxConfig().TxEncoder(),
|
||||
mempool,
|
||||
true,
|
||||
)
|
||||
app.App.SetPrepareProposal(proposalHandler.PrepareProposalHandler())
|
||||
app.App.SetProcessProposal(proposalHandler.ProcessProposalHandler())
|
||||
|
||||
Reference in New Issue
Block a user