Skip to content

Commit 5d4d049

Browse files
authored
Merge pull request #903 from neutron-org/feat/add-optimistic-exec-flag
feat: add optimistic block production flag and config variable #NTRN-516
2 parents 4083abb + 046db08 commit 5d4d049

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

cmd/neutrond/root.go

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,7 @@ func (ac appCreator) newApp(
291291
chainID = appGenesis.ChainID
292292
}
293293

294-
return app.New(logger, db, traceStore, true, skipUpgradeHeights,
295-
homeDir,
296-
cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)),
297-
ac.encCfg,
298-
appOpts,
299-
wasmOpts,
294+
baseAppOptions := []func(*baseapp.BaseApp){
300295
baseapp.SetPruning(pruningOpts),
301296
baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))),
302297
baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))),
@@ -307,6 +302,22 @@ func (ac appCreator) newApp(
307302
baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))),
308303
baseapp.SetSnapshot(snapshotStore, snapshottypes.SnapshotOptions{Interval: cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval)), KeepRecent: cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent))}),
309304
baseapp.SetChainID(chainID),
305+
}
306+
307+
if isEnabled := cast.ToBool(appOpts.Get(server.FlagOptimisticExecutionEnabled)); isEnabled {
308+
logger.Info("Optimistic execution enabled")
309+
baseAppOptions = append(baseAppOptions, baseapp.SetOptimisticExecution())
310+
} else {
311+
logger.Info("Optimistic execution disabled")
312+
}
313+
314+
return app.New(logger, db, traceStore, true, skipUpgradeHeights,
315+
homeDir,
316+
cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)),
317+
ac.encCfg,
318+
appOpts,
319+
wasmOpts,
320+
baseAppOptions...,
310321
)
311322
}
312323

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ replace (
228228
github.com/CosmWasm/wasmd => github.com/neutron-org/wasmd v0.54.0-rc0
229229
github.com/btcsuite/btcd/btcec/v2 => github.com/btcsuite/btcd/btcec/v2 v2.3.2
230230
github.com/cosmos/admin-module/v2 => github.com/neutron-org/admin-module/v2 v2.0.3
231-
github.com/cosmos/cosmos-sdk => github.com/neutron-org/cosmos-sdk v0.50.13-neutron
231+
github.com/cosmos/cosmos-sdk => github.com/neutron-org/cosmos-sdk v0.50.13-neutron.0.20250512094026-b5afd837c4de
232232
// explicitely replace iavl to v1.2.0 cause sometimes go mod tidy uses not right version
233233
github.com/cosmos/iavl => github.com/cosmos/iavl v1.2.0
234234
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,8 +838,8 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi
838838
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
839839
github.com/neutron-org/admin-module/v2 v2.0.3 h1:zTME5kRRMB4uE/DbCEU84mGn3EKDNXZEw5+XMO8+Q7A=
840840
github.com/neutron-org/admin-module/v2 v2.0.3/go.mod h1:RfOyabXsdJ5btcOKyKPZDYiZhtuKFubbJMOb8EJZtvA=
841-
github.com/neutron-org/cosmos-sdk v0.50.13-neutron h1:WpOT+IoQEHP9V7KVwi2ZaOwBap5OzRedEva5IhXWZ5o=
842-
github.com/neutron-org/cosmos-sdk v0.50.13-neutron/go.mod h1:hrWEFMU1eoXqLJeE6VVESpJDQH67FS1nnMrQIjO2daw=
841+
github.com/neutron-org/cosmos-sdk v0.50.13-neutron.0.20250512094026-b5afd837c4de h1:WDOQ4cvcF99BY2O1c6UYvnY2Y+Bd31kJf5abFQCuMGA=
842+
github.com/neutron-org/cosmos-sdk v0.50.13-neutron.0.20250512094026-b5afd837c4de/go.mod h1:hrWEFMU1eoXqLJeE6VVESpJDQH67FS1nnMrQIjO2daw=
843843
github.com/neutron-org/feemarket v0.0.0-20250127141246-4ffcf3d43464 h1:5mbzd7sqp8pPYWzIhIYKFovMRBL0ru24N2E6dIWjL0o=
844844
github.com/neutron-org/feemarket v0.0.0-20250127141246-4ffcf3d43464/go.mod h1:DUa6djUsTeMOrbrcIZqWSVxU9IZNCXp96ruaojyBNpc=
845845
github.com/neutron-org/wasmd v0.54.0-rc0 h1:9nINrQoH15n0bygSNg+R/QUzC1dI31geaJcB9S2Aloo=

0 commit comments

Comments
 (0)