Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1759,6 +1759,11 @@ func (app *App) executeEVMTxWithGigaExecutor(ctx sdk.Context, msg *evmtypes.MsgE
}, nil
}

// Overwrite BaseFee to zero if ZERO_BASE_FEE is enabled (for benchmarking)
if app.benchmarkManager != nil && app.benchmarkManager.ZeroBaseFee {
blockCtx.BaseFee = utils.Big0
}

// Get chain config
sstore := app.GigaEvmKeeper.GetParams(ctx).SeiSstoreSetGasEip2200
cfg := evmtypes.DefaultChainConfig().EthereumConfigWithSstore(app.GigaEvmKeeper.ChainID(ctx), &sstore)
Expand Down
14 changes: 10 additions & 4 deletions app/benchmark/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ type Manager struct {
Generator *Generator
Logger *Logger
proposalCh <-chan *abci.ResponsePrepareProposal

// ZeroBaseFee overrides blockCtx.BaseFee to zero during tx execution.
ZeroBaseFee bool
}

// NewManager creates a new benchmark manager from configuration.
Expand All @@ -46,8 +49,9 @@ func NewManager(ctx context.Context, txConfig client.TxConfig, chainID string, e
panic("benchmark not allowed on live chains")
}

// Load config from environment variable or use default
// Load config from environment variables or use defaults
configPath := os.Getenv("BENCHMARK_CONFIG")
zeroBaseFee := os.Getenv("ZERO_BASE_FEE") == "true"

cfg, err := LoadConfig(configPath, evmChainID, chainID)
if err != nil {
Expand All @@ -67,12 +71,14 @@ func NewManager(ctx context.Context, txConfig client.TxConfig, chainID string, e
logger.Info("Benchmark manager initialized",
"configPath", configPath,
"scenarios", len(cfg.Scenarios),
"zeroBaseFee", zeroBaseFee,
)

return &Manager{
Generator: gen,
Logger: benchLogger,
proposalCh: proposalCh,
Generator: gen,
Logger: benchLogger,
proposalCh: proposalCh,
ZeroBaseFee: zeroBaseFee,
}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ require (
github.com/rs/zerolog v1.33.0
github.com/sasha-s/go-deadlock v0.3.1
github.com/sei-protocol/goutils v0.0.2
github.com/sei-protocol/sei-load v0.0.0-20251007135253-78fbdc141082
github.com/sei-protocol/sei-load v0.0.0-20260212060740-96a581d66024
github.com/sirkon/goproxy v1.4.8
github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa
github.com/spf13/cast v1.9.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1995,8 +1995,8 @@ github.com/sei-protocol/go-ethereum v1.15.7-sei-16 h1:MUvhmn5acNwS/9smQ19gdl6Qh3
github.com/sei-protocol/go-ethereum v1.15.7-sei-16/go.mod h1:+S9k+jFzlyVTNcYGvqFhzN/SFhI6vA+aOY4T5tLSPL0=
github.com/sei-protocol/goutils v0.0.2 h1:Bfa7Sv+4CVLNM20QcpvGb81B8C5HkQC/kW1CQpIbXDA=
github.com/sei-protocol/goutils v0.0.2/go.mod h1:iYE2DuJfEnM+APPehr2gOUXfuLuPsVxorcDO+Tzq9q8=
github.com/sei-protocol/sei-load v0.0.0-20251007135253-78fbdc141082 h1:f2sY8OcN60UL1/6POx+HDMZ4w04FTZtSScnrFSnGZHg=
github.com/sei-protocol/sei-load v0.0.0-20251007135253-78fbdc141082/go.mod h1:V0fNURAjS6A8+sA1VllegjNeSobay3oRUW5VFZd04bA=
github.com/sei-protocol/sei-load v0.0.0-20260212060740-96a581d66024 h1:afvkkPGgVuD1DeRYRLBVfNkQXDVgtyRnH9CCbvjfZbw=
github.com/sei-protocol/sei-load v0.0.0-20260212060740-96a581d66024/go.mod h1:9h0ffBcpwqzNgZYy2Wjk09MK19zrKxNzxDkUFWx53QQ=
github.com/sei-protocol/sei-tm-db v0.0.5 h1:3WONKdSXEqdZZeLuWYfK5hP37TJpfaUa13vAyAlvaQY=
github.com/sei-protocol/sei-tm-db v0.0.5/go.mod h1:Cpa6rGyczgthq7/0pI31jys2Fw0Nfrc+/jKdP1prVqY=
github.com/sei-protocol/tm-db v0.0.4 h1:7Y4EU62Xzzg6wKAHEotm7SXQR0aPLcGhKHkh3qd0tnk=
Expand Down
39 changes: 39 additions & 0 deletions go.work.sum

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions scripts/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ GIGA_EXECUTOR=${GIGA_EXECUTOR:-false}
GIGA_OCC=${GIGA_OCC:-false}
BENCHMARK_TXS_PER_BATCH=${BENCHMARK_TXS_PER_BATCH:-1000}
DISABLE_INDEXER=${DISABLE_INDEXER:-true}
# Zero base fee - if true, overwrite blockCtx.BaseFee to zero for benchmarking
ZERO_BASE_FEE=${ZERO_BASE_FEE:-false}
# Debug mode - if true, prints all log output without filtering
DEBUG=${DEBUG:-false}
# Benchmark scenario config (path to JSON file, see scripts/scenarios/)
Expand Down Expand Up @@ -38,6 +40,7 @@ echo " GIGA_OCC: $GIGA_OCC"
echo " DB_BACKEND: $DB_BACKEND"
echo " BENCHMARK_TXS_PER_BATCH: $BENCHMARK_TXS_PER_BATCH"
echo " DISABLE_INDEXER: $DISABLE_INDEXER"
echo " ZERO_BASE_FEE: $ZERO_BASE_FEE"
echo " DEBUG: $DEBUG"
echo " BENCHMARK_CONFIG: ${BENCHMARK_CONFIG:-(default: EVMTransfer)}"
echo ""
Expand Down Expand Up @@ -222,8 +225,8 @@ echo "============================================================"
echo ""
if [ "$DEBUG" = true ]; then
# Debug mode: print all output
BENCHMARK_CONFIG=$BENCHMARK_CONFIG BENCHMARK_TXS_PER_BATCH=$BENCHMARK_TXS_PER_BATCH ~/go/bin/seid start --chain-id sei-chain
BENCHMARK_CONFIG=$BENCHMARK_CONFIG BENCHMARK_TXS_PER_BATCH=$BENCHMARK_TXS_PER_BATCH ZERO_BASE_FEE=$ZERO_BASE_FEE ~/go/bin/seid start --chain-id sei-chain
else
# Normal mode: filter to benchmark-related output only
BENCHMARK_CONFIG=$BENCHMARK_CONFIG BENCHMARK_TXS_PER_BATCH=$BENCHMARK_TXS_PER_BATCH ~/go/bin/seid start --chain-id sei-chain 2>&1 | grep -E "(benchmark|Benchmark|deployed|transitioning)"
BENCHMARK_CONFIG=$BENCHMARK_CONFIG BENCHMARK_TXS_PER_BATCH=$BENCHMARK_TXS_PER_BATCH ZERO_BASE_FEE=$ZERO_BASE_FEE ~/go/bin/seid start --chain-id sei-chain 2>&1 | grep -E "(benchmark|Benchmark|deployed|transitioning)"
fi
13 changes: 13 additions & 0 deletions scripts/scenarios/evm_fast.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"accounts": {
"count": 5000,
"newAccountRate": 0.0
},
"scenarios": [
{
"name": "EVMTransferFast",
"weight": 1
}
]
}

2 changes: 1 addition & 1 deletion sei-cosmos/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ require (
github.com/sagikazarmark/locafero v0.9.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/sei-protocol/goutils v0.0.2 // indirect
github.com/sei-protocol/sei-load v0.0.0-20251007135253-78fbdc141082 // indirect
github.com/sei-protocol/sei-load v0.0.0-20260212060740-96a581d66024 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.14.0 // indirect
Expand Down
Loading
Loading