Skip to content

Add [giga] app.toml section and honor it on the Autobahn node - #4323

Merged
masih merged 5 commits into
mainfrom
masih/1790259307-giga-app-toml-section
Sep 24, 2026
Merged

masih merged 5 commits into
mainfrom
masih/1790259307-giga-app-toml-section

Conversation

@masih

@masih masih commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

A Giga (Autobahn) node ignores app.toml for everything storage- and execution-related. openAutobahnStorageManager builds its layout from seidbconfig.AutobahnStorageConfig, which hardcodes validator mode (state store off), the GC and checkpoint intervals, and never looks at the node's mode; evmonlyapp likewise hardcodes the 1 gwei admission floor, GOMAXPROCS OCC/parse workers and a result pool of one. Operators editing app.toml see no effect, and autobahn.json is the wrong place for these knobs since it is a committee/consensus file.

This adds a [giga] section to the same app.toml seid already generates (alongside the existing [giga_executor]), split into [giga.storage] (mode, rollback/lookback window, prune interval, checkpoint intervals) and [giga.execution] (min gas price, OCC/parse workers, block result pool size). The new giga/config package registers it in the section registry and exposes ReadConfig(appOpts). server/start.go reads it and hands it to node.New through a new node.WithGigaConfig option, mirroring WithFreezeHeight, so sei-tendermint stays viper-free. buildGigaStorageConfig overlays the values on AutobahnStorageConfig, and NewEVMOnlyApplication now takes an ExecutionConfig that sizes the executor and sets the CheckTx admission floor. The executor's own gas price floor stays the chain-wide 1 gwei constant, since it is block-validity policy every node must agree on; min_gas_price only filters local admission and is clamped to at least that floor, so a node can neither admit what a block would refuse nor reject a block its peers accept. Storage mode defaults to following the Tendermint mode (full opens the state store via WithFullNodeMode, anything else stays validator), and can be pinned explicitly.

Every default is identical to the previous hardcoded behaviour, so nodes without the section are unchanged; TestBuildGigaStorageConfigDefaultsMatchAutobahnStorageConfig pins that. Block DB retention still comes from autobahn.json; migrating it into [giga.storage] is left for a follow-up. Validated with the new giga/config, sei-tendermint/node and evmonlyapp tests plus the registry and configtest suites.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedSep 24, 2026, 5:58 PM

@codecov

codecov Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.53097% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.39%. Comparing base (c1f6409) to head (d9d9fa2).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
giga/config/config.go 81.53% 12 Missing ⚠️
sei-cosmos/server/start.go 0.00% 5 Missing ⚠️
sei-tendermint/node/public.go 66.66% 3 Missing ⚠️
sei-tendermint/internal/evmonlyapp/app.go 92.30% 1 Missing ⚠️
sei-tendermint/node/setup.go 94.11% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4323      +/-   ##
==========================================
- Coverage   67.49%   66.39%   -1.11%     
==========================================
  Files        2181     2062     -119     
  Lines      167844   155830   -12014     
==========================================
- Hits       113294   103463    -9831     
+ Misses      54540    52357    -2183     
  Partials       10       10              
Flag Coverage Δ
sei-chain-pr 63.24% <80.53%> (?)
sei-db 74.50% <ø> (ø)
sei-db-state-db ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cmd/seid/cmd/app_config.go 100.00% <100.00%> (ø)
cmd/seid/cmd/root.go 70.99% <100.00%> (+0.11%) ⬆️
giga/config/register.go 100.00% <100.00%> (ø)
sei-tendermint/internal/evmonlyapp/app.go 85.15% <92.30%> (-0.05%) ⬇️
sei-tendermint/node/setup.go 67.06% <94.11%> (+1.06%) ⬆️
sei-tendermint/node/public.go 81.41% <66.66%> (-0.07%) ⬇️
sei-cosmos/server/start.go 38.11% <0.00%> (-0.74%) ⬇️
giga/config/config.go 81.53% <81.53%> (ø)

... and 169 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@masih
masih marked this pull request as ready for review September 24, 2026 15:54
@cursor

cursor Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes Autobahn node startup, storage layout (full vs validator), and tx admission policy; defaults match old hardcoded behavior but misconfiguration could affect pruning, checkpoints, or local mempool filtering.

Overview
Introduces a [giga] section in app.toml so Autobahn/Giga operators can tune storage (mode, rollback/lookback, prune and checkpoint intervals) and execution (local min gas price, OCC/parse workers, block result pool) without editing autobahn.json.

A new giga/config package defines defaults (aligned with existing sei-db Autobahn hardcodes), ReadConfig, validation, TOML template, and config-registry registration. seid embeds the section in generated app.toml; on start, when an Autobahn config file is set, server/start.go reads [giga] and passes it via node.WithGigaConfig.

sei-tendermint applies storage through buildGigaStorageConfig (overlay on AutobahnStorageConfig, full vs validator mode from node mode or an explicit pin) and wires ExecutionConfig into evmonlyapp. min_gas_price only affects CheckTx admission (clamped to the existing 1 gwei block-validity floor); block execution still uses the shared floor so peers stay compatible. Absent or default settings preserve prior behavior.

Reviewed by Cursor Bugbot for commit d9d9fa2. Bugbot is set up for automated code reviews on this repo. Configure here.

seidroid[bot]
seidroid Bot previously requested changes Sep 24, 2026

@seidroid seidroid Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new [giga] section and how it reaches the Autobahn node are clean and well tested. The blocker is that giga.execution.min_gas_price is a per-node setting, but the EVM-only executor treats it as a block-validity rule. Nodes configured with different values will disagree on whether the same block is valid and halt.

Findings: 1 blocking | 1 non-blocking | 1 posted inline

Blockers

  • None at the file/PR level.
  • 1 blocking issue(s) flagged inline on specific lines.

Non-blocking

  • [suggestion] startInProcess calls gigaconfig.ReadConfig(ctx.Viper) for every node, not only Autobahn/Giga nodes. A malformed [giga] value, such as an unknown mode or block_result_pool_size = 0, will now stop a regular Cosmos node from starting even though it never uses the section. Consider reading and validating it only when AutobahnConfigFile is set, or say in the template that the values are validated on every node.

Comment thread sei-tendermint/internal/evmonlyapp/app.go Outdated
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Both review findings addressed in b8d0c0d: the executor's gas price floor stays the chain-wide constant with min_gas_price admission-only (see inline thread), and startInProcess now reads and validates [giga] only when autobahn-config-file is set, so a non-Autobahn node ignores the section.

@masih

masih commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator Author

@seidroid review

@seidroid seidroid Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The earlier blocker is fixed. The executor again uses the chain-wide 1 gwei block-validity floor, and min_gas_price now only sets the local admission floor, which is clamped to at least that value. TestEVMOnlyApplicationMinGasPriceIsAdmissionOnly checks that a node with a raised floor still reaches the same app hash as its peers, and [giga] is now read only on Autobahn nodes. The new section, its registry entry and its hand-off to the Autobahn node are well tested, and every default matches the previous hardcoded behaviour.

Findings: 0 blocking | 0 non-blocking | 0 posted inline

Blockers

  • None at the file/PR level.

Non-blocking

  • None at the file/PR level.

@seidroid
seidroid Bot dismissed their stale review September 24, 2026 16:32

Superseded: latest AI review found no blocking issues.

storageConfig.PruningConfig.LookbackWindow = storage.LookbackWindow
storageConfig.PruningConfig.PruneInterval = storage.PruneInterval
storageConfig.CheckpointConfig.TimeInterval = storage.CheckpointTimeInterval
storageConfig.CheckpointConfig.BlockInterval = storage.CheckpointBlockInterval

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe put this above storageConfig.WithFullNodeMode(), just in case in the future we want to set things separately for full node.

@yzang2019 should we have one storageConfig.WithFullNodeMode() and another storageConfig.WithValidatorMode() maybe?

@devin-ai-integration devin-ai-integration Bot Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reordered in 15e824d: the window/interval fields are set first, mode selection is last. I kept only the WithFullNodeMode() branch rather than adding an explicit WithValidatorMode(): AutobahnStorageConfig already applies validator mode and then re-enables receipts, so calling it again here would switch receipts off on validators (which TestPrepareApplicationAutobahnUsesEVMOnly pins via manager.ReceiptDB()). If we want a symmetric pair, that probably belongs in sei-db/config (e.g. an Autobahn-aware validator mode that keeps receipts on).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wen-coding i specifically tried to keep this PR smaller for now and make it as an unblocker. Was planning to move or delegate moving of storage configs in a separate PR.

@@ -31,6 +32,7 @@ type CustomAppConfig struct {
WASM WASMConfig `mapstructure:"wasm"`
EVM evmrpcconfig.Config `mapstructure:"evm"`
GigaExecutor gigaconfig.Config `mapstructure:"giga_executor"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot, is GigaExecutor config for EVM-Mixed? It's quite confusing to have GigaExecutor and Giga back to back but separate.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes: [giga_executor] (enabled/occ_enabled) is read by app.go and drives the Giga executor inside the Cosmos app (the EVM-mixed path). [giga] is only read when autobahn-config-file is set and is handed to the Autobahn/EVM-only node, which never constructs the Cosmos app. I kept them separate here so the pinned [giga_executor] keys and configtest rows don't churn; if you'd rather have one section, the low-churn option is to fold enabled/occ_enabled under [giga.executor] as a follow-up, or I can do it in this PR if you prefer.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the mixed, a.k.a "Hybrid Executor".

Not worth the hassle of renaming IMHO, eventhough I agree that it is confusing.
Historical naming issue.

Comment thread giga/config/config.go
return fmt.Errorf("%s: %q is not one of %q, %q or empty", FlagStorageMode, c.Storage.Mode,
StorageModeValidator, StorageModeFull)
}
if c.Storage.LookbackWindow < -1 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will seriously keep all history?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just mirrors the existing contract of StorageGarbageCollectorConfig.LookbackWindow in sei-db/config/gc_config.go (-1 = infinite retention, already accepted by its Validate); the default stays 0, so nothing keeps full history unless an operator opts in. I only surfaced the knob rather than tightening it; happy to reject -1 here if we'd rather archive nodes use a different mechanism.

Comment thread giga/config/config.go

# block_result_pool_size is the number of block results kept pooled between executions.
block_result_pool_size = {{ .Giga.Execution.BlockResultPoolSize }}
`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we would move the Autobahn configs here? will that be done in a followup PR?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, follow-up. This PR is intentionally scoped to the storage/execution knobs that were hardcoded, so operators have one place (app.toml) that is actually honored. autobahn.json (committee, block/tx limits, timeouts, block_db) and the autobahn-config-file path in config.toml are untouched here; migrating block_db and then the rest into [giga.*] is the next step once we settle what should be configurable at all before mainnet.

@wen-coding

Copy link
Copy Markdown
Contributor

LGTM, but please make sure someone from storage team has a chance to review

Comment thread giga/config/config.go
}

// DefaultConfig is what a Giga node runs when the section is absent.
var DefaultConfig = Config{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to set another default again here? I'd propose we reuse whatever is already defined for all the default values. The concern of having two separate places for default is that we need to then always make sure they are consistent.

We can derive the config value from DefaultCheckpointConfig() and DefaultStorageGarbageCollectorConfig(0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in d9d9fa2: the [giga.storage] defaults are now built from seidbconfig.DefaultStorageGarbageCollectorConfig() and seidbconfig.DefaultCheckpointConfig(), so sei-db stays the single definition. The execution defaults still live here since the executor floor is an unexported constant in evmonlyapp.

Comment thread giga/config/config.go Outdated
// DefaultConfig is what a Giga node runs when the section is absent.
var DefaultConfig = Config{
Storage: StorageConfig{
Mode: StorageModeAuto,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does auto mode mean? How do we automatically detect which mode to run?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Auto" (empty string) means: don't pin a Giga storage layout, follow the node's mode from config.toml. resolveGigaStorageMode in sei-tendermint/node/setup.go maps mode = "full" to the full layout (state store + receipts on) and anything else (validator, seed) to the validator layout (state store off). So by default a node that is already configured as a full node in config.toml gets query-serving storage without a second setting; mode = "validator"/"full" here only exists to override that, e.g. a validator that also wants the state store. Open to renaming the empty value to an explicit "auto" if that reads better.

@masih
masih requested a review from yzang2019 September 24, 2026 19:37
@masih
masih added this pull request to the merge queue Sep 24, 2026
Merged via the queue into main with commit 3895679 Sep 24, 2026
72 checks passed
@masih
masih deleted the masih/1790259307-giga-app-toml-section branch September 24, 2026 21:25
yzang2019 added a commit that referenced this pull request Sep 25, 2026
* main: (21 commits)
  Backport evmonly parse, app-hash and changeset perf fixes from giga-1 (#4345)
  Remove the oracle module behind a v6.8 upgrade (#4319)
  fix(seidb): report only the current migration boundary on the snapshot gauge (#4327)
  fix(flatkv): keep 10 old checkpoints instead of mirroring memIAVL's count (#4322)
  Backport Autobahn execute-loop and produced-tx metrics from giga-1 (#4330)
  Add giga.storage.receipts to toggle the Autobahn receipt store (#4333)
  optimize gather phase (#4326)
  Regenerate the Unreleased changelog as a plain PR list (#4336)
  Bump sei-protocol/go-ethereum to v1.15.7-sei-21 (#4332)
  Fail dynamic-gas precompile out-of-gas as an EVM out-of-gas call (#4318)
  Add dashboard and topology option for Autobahn e2e (#4167)
  Add Giga fetch/serve and BlockDB prune metrics (#4329)
  Add eth_getLogs to the EVM-only Giga RPC (#4308)
  Generate v6.8 precompiles (#4320)
  Add [giga] app.toml section and honor it on the Autobahn node (#4323)
  feat(evmonly): add eth_estimateGas via existing libraries (#4325)
  Use Pebble batch directly in SS (#4300)
  Fix pruning issue in SS causing huge disk spike (#4321)
  Make Autobahn always run the EVM-only executor, disable/remove some integration tests (#4316)
  reduce seal lock contention (#4314)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants