Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,16 +435,19 @@ func New(
})

blockSTMEnabled := cast.ToString(appOpts.Get(srvflags.EVMBlockExecutor)) == "block-stm"
optimisticExecutionEnabled := true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should you set the boolean somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's always true( in L449 SetOptimisticExecution). I use this variable because I want to disable memiavl cache.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternatively, is there a way to disable optimistic execution?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!. i can add a variable like srvflags.EVMBlockExecutor disable optimistic execution.


var cacheSize int
if !blockSTMEnabled {
// only enable memiavl cache if block-stm is not enabled, because it's not concurrency-safe.
if !blockSTMEnabled && !optimisticExecutionEnabled {
// only enable memiavl cache if neither block-stm nor optimistic execution is enabled,
cacheSize = cast.ToInt(appOpts.Get(memiavlstore.FlagCacheSize))
}
baseAppOptions = memiavlstore.SetupMemIAVL(logger, homePath, appOpts, false, false, cacheSize, baseAppOptions)

// enable optimistic execution
baseAppOptions = append(baseAppOptions, baseapp.SetOptimisticExecution())
if optimisticExecutionEnabled {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optimistic execution is crucial in enabling our quick blocktime though, would it be bad if we disable it?

Copy link
Collaborator

@thomas-nguy thomas-nguy Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not recommend it but there is no harm to provide the option

baseAppOptions = append(baseAppOptions, baseapp.SetOptimisticExecution())
}

// NOTE we use custom transaction decoder that supports the sdk.Tx interface instead of sdk.StdTx
bApp := baseapp.NewBaseApp(Name, logger, db, txConfig.TxDecoder(), baseAppOptions...)
Expand Down
Loading