@@ -190,19 +190,20 @@ type App struct {
190190 BasicManager module.BasicManager
191191 ModuleManager * module.Manager
192192 configurator module.Configurator
193- // timeoutCommit is used to override the default timeoutCommit . This is
193+ // blockTime is used to override the default TimeoutHeightDelay . This is
194194 // useful for testing purposes and should not be used on public networks
195195 // (Arabica, Mocha, or Mainnet Beta).
196- timeoutCommit time.Duration
196+ delayedPrecommitTimeout time.Duration
197197}
198198
199199// New returns a reference to an uninitialized app. Callers must subsequently
200- // call app.Info or app.InitChain to initialize the baseapp.
200+ // call app.Info or app.InitChain to initialize the baseapp. Setting
201+ // delayedPrecommitTimeout to 0 will result in using the default value.
201202func New (
202203 logger log.Logger ,
203204 db dbm.DB ,
204205 traceStore io.Writer ,
205- timeoutCommit time.Duration ,
206+ delayedPrecommitTimeout time.Duration ,
206207 appOpts servertypes.AppOptions ,
207208 baseAppOptions ... func (* baseapp.BaseApp ),
208209) * App {
@@ -219,12 +220,16 @@ func New(
219220
220221 govModuleAddr := authtypes .NewModuleAddress (govtypes .ModuleName ).String ()
221222
223+ if delayedPrecommitTimeout == 0 {
224+ delayedPrecommitTimeout = appconsts .DelayedPrecommitTimeout
225+ }
226+
222227 app := & App {
223- BaseApp : baseApp ,
224- keys : keys ,
225- tkeys : tkeys ,
226- memKeys : memKeys ,
227- timeoutCommit : timeoutCommit ,
228+ BaseApp : baseApp ,
229+ keys : keys ,
230+ tkeys : tkeys ,
231+ memKeys : memKeys ,
232+ delayedPrecommitTimeout : delayedPrecommitTimeout ,
228233 }
229234
230235 // needed for migration from x/params -> module's ownership of own params
@@ -509,8 +514,7 @@ func (app *App) Info(req *abci.RequestInfo) (*abci.ResponseInfo, error) {
509514 return nil , err
510515 }
511516
512- res .TimeoutInfo .TimeoutCommit = app .TimeoutCommit ()
513- res .TimeoutInfo .TimeoutPropose = app .TimeoutPropose ()
517+ res .TimeoutInfo = app .TimeoutInfo ()
514518
515519 return res , nil
516520}
@@ -563,8 +567,7 @@ func (app *App) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) {
563567 }
564568 }
565569
566- res .TimeoutInfo .TimeoutCommit = app .TimeoutCommit ()
567- res .TimeoutInfo .TimeoutPropose = app .TimeoutPropose ()
570+ res .TimeoutInfo = app .TimeoutInfo ()
568571
569572 return res , nil
570573}
@@ -586,9 +589,7 @@ func (app *App) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.
586589 return nil , err
587590 }
588591
589- res .TimeoutInfo .TimeoutCommit = app .TimeoutCommit ()
590- res .TimeoutInfo .TimeoutPropose = app .TimeoutPropose ()
591-
592+ res .TimeoutInfo = app .TimeoutInfo ()
592593 return res , nil
593594}
594595
@@ -811,19 +812,15 @@ func (app *App) NewProposalContext(header tmproto.Header) sdk.Context {
811812 return ctx
812813}
813814
814- // TimeoutCommit returns the timeout commit duration to be used on the next block.
815- // It returns the user specified value as overridden by the --timeout-commit flag, otherwise
816- // the default timeout commit value for the current app version.
817- func (app * App ) TimeoutCommit () time.Duration {
818- if app .timeoutCommit != 0 {
819- return app .timeoutCommit
815+ func (app * App ) TimeoutInfo () abci.TimeoutInfo {
816+ return abci.TimeoutInfo {
817+ TimeoutPropose : appconsts .TimeoutPropose ,
818+ TimeoutProposeDelta : appconsts .TimeoutProposeDelta ,
819+ TimeoutCommit : appconsts .TimeoutCommit ,
820+ TimeoutPrevote : appconsts .TimeoutPrevote ,
821+ TimeoutPrevoteDelta : appconsts .TimeoutPrevoteDelta ,
822+ TimeoutPrecommit : appconsts .TimeoutPrecommit ,
823+ TimeoutPrecommitDelta : appconsts .TimeoutPrecommitDelta ,
824+ DelayedPrecommitTimeout : app .delayedPrecommitTimeout ,
820825 }
821-
822- return appconsts .TimeoutCommit
823- }
824-
825- // TimeoutPropose returns the timeout propose duration to be used on the next block.
826- // It returns the default timeout propose value for the current app version.
827- func (app * App ) TimeoutPropose () time.Duration {
828- return appconsts .TimeoutPropose
829826}
0 commit comments