From 1cc85b8a2b883554e8cd868e6fac6f3f8548670f Mon Sep 17 00:00:00 2001 From: itsdevbear Date: Wed, 17 Jan 2024 02:52:59 -0500 Subject: [PATCH] scam --- cosmos/config/config.go | 15 +++++++++++---- cosmos/config/flags/flags.go | 2 ++ cosmos/config/template.go | 1 + e2e/testapp/app.go | 3 +++ eth/eth.go | 5 +++-- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/cosmos/config/config.go b/cosmos/config/config.go index e13b2ee8c..655aff00f 100644 --- a/cosmos/config/config.go +++ b/cosmos/config/config.go @@ -68,11 +68,18 @@ func ReadConfigFromAppOpts(opts servertypes.AppOptions) (*Config, error) { //nolint:funlen,gocognit,gocyclo,cyclop // TODO break up later. func readConfigFromAppOptsParser(parser AppOptionsParser) (*Config, error) { - var err error - var val int64 - conf := &Config{} + var ( + err error + val int64 + conf = &Config{} + ) - // Polar settings + // 🅱️onad mode. + if conf.OptimisticExecution, err = parser.GetBool(flags.OptimisticExecution); err != nil { + return nil, err + } + + // Polaris Core settings if conf.Polar.RPCGasCap, err = parser.GetUint64(flags.RPCGasCap); err != nil { return nil, err diff --git a/cosmos/config/flags/flags.go b/cosmos/config/flags/flags.go index cc60bd047..90ae84edc 100644 --- a/cosmos/config/flags/flags.go +++ b/cosmos/config/flags/flags.go @@ -21,6 +21,8 @@ package flags const ( + OptimisticExecution = "polaris.optimistic-execution" + // Polar Root. RPCEvmTimeout = "polaris.polar.rpc-evm-timeout" RPCTxFeeCap = "polaris.polar.rpc-tx-fee-cap" diff --git a/cosmos/config/template.go b/cosmos/config/template.go index 1338cf875..9a04dae72 100644 --- a/cosmos/config/template.go +++ b/cosmos/config/template.go @@ -28,6 +28,7 @@ const ( ############################################################################### # General Polaris settings [polaris] +optimistic-execution = {{ .Polaris.OptimisticExecution }} [polaris.polar] # Gas cap for RPC requests diff --git a/e2e/testapp/app.go b/e2e/testapp/app.go index 139ef737e..1687d48c7 100644 --- a/e2e/testapp/app.go +++ b/e2e/testapp/app.go @@ -188,6 +188,9 @@ func NewPolarisApp( panic(err) } + if true { + baseAppOptions = append(baseAppOptions, baseapp.SetOptimisticExecution()) + } // Build the app using the app builder. app.App = appBuilder.Build(db, traceStore, baseAppOptions...) app.Polaris = polarruntime.New(app, diff --git a/eth/eth.go b/eth/eth.go index 72adf50ea..f6ddd1eec 100644 --- a/eth/eth.go +++ b/eth/eth.go @@ -88,8 +88,9 @@ type ( // Config struct holds the configuration for Polaris and Node. Config struct { - Polar polar.Config - Node node.Config + OptimisticExecution bool + Polar polar.Config + Node node.Config } )