-
Notifications
You must be signed in to change notification settings - Fork 273
fix: disable memiavl cache when optimistic execution is enabled(backport) #1890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
dfd5145
d118af9
d44e955
c556bbb
95573b6
2c117d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -435,16 +435,19 @@ func New( | |
| }) | ||
|
|
||
| blockSTMEnabled := cast.ToString(appOpts.Get(srvflags.EVMBlockExecutor)) == "block-stm" | ||
| optimisticExecutionEnabled := true | ||
|
|
||
| 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 { | ||
|
||
| 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...) | ||
|
|
||
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.EVMBlockExecutordisable optimistic execution.