-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[WIP] Skip endblocker flag #25091
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
base: main
Are you sure you want to change the base?
[WIP] Skip endblocker flag #25091
Changes from 2 commits
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 | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -144,6 +144,16 @@ func DisableBlockGasMeter() func(*BaseApp) { | |||||||||||||||||||||||
| return func(app *BaseApp) { app.SetDisableBlockGasMeter(true) } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // SkipEndBlocker skips EndBlocker processing for non-blocking query mode. | ||||||||||||||||||||||||
| func SkipEndBlocker() func(*BaseApp) { | ||||||||||||||||||||||||
| return func(app *BaseApp) { app.SetSkipEndBlocker(true) } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // SetQueryOnlyMode enables comprehensive query-only mode for fast query nodes. | ||||||||||||||||||||||||
| func SetQueryOnlyMode() func(*BaseApp) { | ||||||||||||||||||||||||
| return func(app *BaseApp) { app.SetQueryOnlyMode(true) } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| func (app *BaseApp) SetName(name string) { | ||||||||||||||||||||||||
| if app.sealed { | ||||||||||||||||||||||||
| panic("SetName() on sealed BaseApp") | ||||||||||||||||||||||||
|
|
@@ -409,6 +419,23 @@ func (app *BaseApp) SetDisableBlockGasMeter(disableBlockGasMeter bool) { | |||||||||||||||||||||||
| app.disableBlockGasMeter = disableBlockGasMeter | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // SetSkipEndBlocker sets the skipEndBlocker flag for the BaseApp. | ||||||||||||||||||||||||
| func (app *BaseApp) SetSkipEndBlocker(skipEndBlocker bool) { | ||||||||||||||||||||||||
| app.skipEndBlocker = skipEndBlocker | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
Comment on lines
+427
to
+430
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add sealed check for consistency and safety. The method should include a sealed check like other setter methods in this file to prevent modification after BaseApp initialization. Apply this diff to add the sealed check: // SetSkipEndBlocker sets the skipEndBlocker flag for the BaseApp.
func (app *BaseApp) SetSkipEndBlocker(skipEndBlocker bool) {
+ if app.sealed {
+ panic("SetSkipEndBlocker() on sealed BaseApp")
+ }
app.skipEndBlocker = skipEndBlocker
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // SetQueryOnlyMode sets the queryOnlyMode flag for the BaseApp. | ||||||||||||||||||||||||
| func (app *BaseApp) SetQueryOnlyMode(queryOnlyMode bool) { | ||||||||||||||||||||||||
| if app.sealed { | ||||||||||||||||||||||||
| panic("SetQueryOnlyMode() on sealed BaseApp") | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| app.queryOnlyMode = queryOnlyMode | ||||||||||||||||||||||||
| if queryOnlyMode { | ||||||||||||||||||||||||
| // Query-only mode implies skipping EndBlocker as well | ||||||||||||||||||||||||
| app.skipEndBlocker = true | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // SetMsgServiceRouter sets the MsgServiceRouter of a BaseApp. | ||||||||||||||||||||||||
| func (app *BaseApp) SetMsgServiceRouter(msgServiceRouter *MsgServiceRouter) { | ||||||||||||||||||||||||
| app.msgServiceRouter = msgServiceRouter | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
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.
Change potentially affects state.
Call sequence: