@@ -134,7 +134,6 @@ import (
134134 evmkeeper "github.com/sei-protocol/sei-chain/x/evm/keeper"
135135 "github.com/sei-protocol/sei-chain/x/evm/querier"
136136 "github.com/sei-protocol/sei-chain/x/evm/replay"
137- evmstate "github.com/sei-protocol/sei-chain/x/evm/state"
138137 evmtypes "github.com/sei-protocol/sei-chain/x/evm/types"
139138 "github.com/sei-protocol/sei-chain/x/mint"
140139 mintclient "github.com/sei-protocol/sei-chain/x/mint/client/cli"
@@ -164,6 +163,9 @@ import (
164163 // unnamed import of statik for openapi/swagger UI support
165164 _ "github.com/sei-protocol/sei-chain/docs/swagger"
166165 ssconfig "github.com/sei-protocol/sei-chain/sei-db/config"
166+
167+ gigaevmkeeper "github.com/sei-protocol/sei-chain/giga/deps/xevm/keeper"
168+ gigaevmstate "github.com/sei-protocol/sei-chain/giga/deps/xevm/state"
167169)
168170
169171// this line is used by starport scaffolding # stargate/wasm/app/enabledProposals
@@ -342,6 +344,7 @@ type App struct {
342344 WasmKeeper wasm.Keeper
343345 OracleKeeper oraclekeeper.Keeper
344346 EvmKeeper evmkeeper.Keeper
347+ GigaEvmKeeper gigaevmkeeper.Keeper
345348
346349 // make scoped keepers public for test purposes
347350 ScopedIBCKeeper capabilitykeeper.ScopedKeeper
@@ -402,6 +405,12 @@ type App struct {
402405
403406 benchmarkProposalCh <- chan * abci.ResponsePrepareProposal
404407 benchmarkLogger * benchmarkLogger
408+
409+ // GigaExecutorEnabled controls whether to use the Giga executor (evmone-based)
410+ // instead of geth's interpreter for EVM execution. Experimental feature.
411+ GigaExecutorEnabled bool
412+ // GigaOCCEnabled controls whether to use OCC with the Giga executor
413+ GigaOCCEnabled bool
405414}
406415
407416type AppOption func (* App )
@@ -672,19 +681,23 @@ func New(
672681 app .EvmKeeper .EthClient = ethclient .NewClient (rpcclient )
673682 }
674683
684+ app .GigaEvmKeeper = * gigaevmkeeper .NewKeeper (keys [evmtypes .StoreKey ],
685+ tkeys [evmtypes .TransientStoreKey ], app .GetSubspace (evmtypes .ModuleName ), app .receiptStore , app .BankKeeper ,
686+ & app .AccountKeeper , & app .StakingKeeper , app .TransferKeeper ,
687+ wasmkeeper .NewDefaultPermissionKeeper (app .WasmKeeper ), & app .WasmKeeper , & app .UpgradeKeeper )
675688 // Read Giga Executor config
676689 gigaExecutorConfig , err := gigaconfig .ReadConfig (appOpts )
677690 if err != nil {
678691 panic (fmt .Sprintf ("error reading giga executor config due to %s" , err ))
679692 }
680- app .EvmKeeper . GigaExecutorEnabled = gigaExecutorConfig .Enabled
681- app .EvmKeeper . GigaOCCEnabled = gigaExecutorConfig .OCCEnabled
693+ app .GigaExecutorEnabled = gigaExecutorConfig .Enabled
694+ app .GigaOCCEnabled = gigaExecutorConfig .OCCEnabled
682695 if gigaExecutorConfig .Enabled {
683696 evmoneVM , err := gigalib .InitEvmoneVM ()
684697 if err != nil {
685698 panic (fmt .Sprintf ("failed to load evmone: %s" , err ))
686699 }
687- app .EvmKeeper .EvmoneVM = evmoneVM
700+ app .GigaEvmKeeper .EvmoneVM = evmoneVM
688701 if gigaExecutorConfig .OCCEnabled {
689702 logger .Info ("benchmark: Giga Executor with OCC is ENABLED - using new EVM execution path with parallel execution" )
690703 } else {
@@ -1469,8 +1482,8 @@ func (app *App) ProcessBlock(ctx sdk.Context, txs [][]byte, req BlockProcessRequ
14691482 }()
14701483
14711484 // Route to Giga Executor when enabled - bypasses Cosmos SDK transaction processing
1472- if app .EvmKeeper . GigaExecutorEnabled {
1473- if app .EvmKeeper . GigaOCCEnabled {
1485+ if app .GigaExecutorEnabled {
1486+ if app .GigaOCCEnabled {
14741487 return app .ProcessBlockWithGigaExecutorOCC (ctx , txs , req , lastCommit , simulate )
14751488 }
14761489 return app .ProcessBlockWithGigaExecutor (ctx , txs , req , lastCommit , simulate )
@@ -1636,7 +1649,7 @@ func (app *App) executeEVMTxWithGigaExecutor(ctx sdk.Context, txIndex int, msg *
16361649 return nil , fmt .Errorf ("failed to convert to eth transaction" )
16371650 }
16381651
1639- chainID := app .EvmKeeper .ChainID (ctx )
1652+ chainID := app .GigaEvmKeeper .ChainID (ctx )
16401653
16411654 // Recover sender using the same logic as preprocess.go (version-based signer selection)
16421655 sender , seiAddr , pubkey , recoverErr := evmante .RecoverSenderFromEthTx (ctx , ethTx , chainID )
@@ -1648,8 +1661,8 @@ func (app *App) executeEVMTxWithGigaExecutor(ctx sdk.Context, txIndex int, msg *
16481661 }
16491662
16501663 // Associate the address if not already associated (same as EVMPreprocessDecorator)
1651- if _ , isAssociated := app .EvmKeeper .GetEVMAddress (ctx , seiAddr ); ! isAssociated {
1652- associateHelper := helpers .NewAssociationHelper (& app .EvmKeeper , app .BankKeeper , & app .AccountKeeper )
1664+ if _ , isAssociated := app .GigaEvmKeeper .GetEVMAddress (ctx , seiAddr ); ! isAssociated {
1665+ associateHelper := helpers .NewAssociationHelper (& app .GigaEvmKeeper , app .BankKeeper , & app .AccountKeeper )
16531666 if err := associateHelper .AssociateAddresses (ctx , seiAddr , sender , pubkey ); err != nil {
16541667 return & abci.ExecTxResult {
16551668 Code : 1 ,
@@ -1663,14 +1676,14 @@ func (app *App) executeEVMTxWithGigaExecutor(ctx sdk.Context, txIndex int, msg *
16631676 ctx = ctx .WithTxIndex (txIndex )
16641677
16651678 // Create state DB for this transaction
1666- stateDB := evmstate .NewDBImpl (ctx , & app .EvmKeeper , false )
1679+ stateDB := gigaevmstate .NewDBImpl (ctx , & app .GigaEvmKeeper , false )
16671680 defer stateDB .Cleanup ()
16681681
16691682 // Get gas pool
1670- gp := app .EvmKeeper .GetGasPool ()
1683+ gp := app .GigaEvmKeeper .GetGasPool ()
16711684
16721685 // Get block context
1673- blockCtx , blockCtxErr := app .EvmKeeper .GetVMBlockContext (ctx , gp )
1686+ blockCtx , blockCtxErr := app .GigaEvmKeeper .GetVMBlockContext (ctx , gp )
16741687 if blockCtxErr != nil {
16751688 return & abci.ExecTxResult {
16761689 Code : 1 ,
@@ -1679,14 +1692,14 @@ func (app *App) executeEVMTxWithGigaExecutor(ctx sdk.Context, txIndex int, msg *
16791692 }
16801693
16811694 // Get chain config
1682- sstore := app .EvmKeeper .GetParams (ctx ).SeiSstoreSetGasEip2200
1683- cfg := evmtypes .DefaultChainConfig ().EthereumConfigWithSstore (app .EvmKeeper .ChainID (ctx ), & sstore )
1695+ sstore := app .GigaEvmKeeper .GetParams (ctx ).SeiSstoreSetGasEip2200
1696+ cfg := evmtypes .DefaultChainConfig ().EthereumConfigWithSstore (app .GigaEvmKeeper .ChainID (ctx ), & sstore )
16841697
16851698 // Create Giga executor VM (wraps evmone)
1686- gigaExecutor := gigaexecutor .NewEvmoneExecutor (app .EvmKeeper .EvmoneVM , * blockCtx , stateDB , cfg , vm.Config {}, app .EvmKeeper .CustomPrecompiles (ctx ))
1699+ gigaExecutor := gigaexecutor .NewEvmoneExecutor (app .GigaEvmKeeper .EvmoneVM , * blockCtx , stateDB , cfg , vm.Config {}, app .GigaEvmKeeper .CustomPrecompiles (ctx ))
16871700
16881701 // Execute the transaction through giga VM
1689- execResult , execErr := gigaExecutor .ExecuteTransaction (ethTx , sender , app .EvmKeeper .GetBaseFee (ctx ), & gp )
1702+ execResult , execErr := gigaExecutor .ExecuteTransaction (ethTx , sender , app .GigaEvmKeeper .GetBaseFee (ctx ), & gp )
16901703 if execErr != nil {
16911704 return & abci.ExecTxResult {
16921705 Code : 1 ,
@@ -1722,7 +1735,7 @@ func (app *App) executeEVMTxWithGigaExecutor(ctx sdk.Context, txIndex int, msg *
17221735 Data : ethTx .Data (),
17231736 From : sender ,
17241737 }
1725- receipt , rerr := app .EvmKeeper .WriteReceipt (ctx , stateDB , evmMsg , uint32 (ethTx .Type ()), ethTx .Hash (), execResult .UsedGas , vmError )
1738+ receipt , rerr := app .GigaEvmKeeper .WriteReceipt (ctx , stateDB , evmMsg , uint32 (ethTx .Type ()), ethTx .Hash (), execResult .UsedGas , vmError )
17261739 if rerr != nil {
17271740 return & abci.ExecTxResult {
17281741 Code : 1 ,
0 commit comments