Skip to content

Pipeline giga static block processing#3495

Open
codchen wants to merge 7 commits into
mainfrom
codex/giga-static-pipeline
Open

Pipeline giga static block processing#3495
codchen wants to merge 7 commits into
mainfrom
codex/giga-static-pipeline

Conversation

@codchen

@codchen codchen commented May 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • split giga static transaction preparation from stateful execution
  • add an async per-block static processing pipeline so later block stateless work can overlap earlier block stateful execution
  • wire giga synchronous and OCC execution paths to consume prepared EVM metadata, keeping Cosmos transactions as legacy fallbacks

Tests

  • go test ./app
  • make giga-integration-test
  • make giga-mixed-integration-test
  • make autobahn-integration-test
  • make parquet-integration-test

@cursor

cursor Bot commented May 22, 2026

Copy link
Copy Markdown

PR Summary

High Risk
Changes consensus-critical giga/OCC block execution ordering and when stateless vs stateful EVM checks run; incorrect static results or pipeline races could diverge tx outcomes from the prior path.

Overview
Giga static pipeline front-loads decode plus state-free EVM work (Cosmos envelope checks via EvmStatelessChecks, eth tx conversion, signature recovery) into gigaStaticEVMTx results, with concurrent per-tx preparation and panic recovery mapped to ABCI errors.

Async block jobs start from ProcessProposal (and again in ProcessBlock) keyed by height/hash, cap concurrent jobs (32 total, 4 per height), prune stale entries, and let ProcessBlock wait and reuse prepared typedTxs/staticTxs before stateful execution.

Execution paths now take optional precomputed static results: synchronous giga and OCC giga short-circuit on static failures, call executeEVMTxWithGigaExecutor with prepared metadata instead of re-running stateless checks inline, and OCC maps static results by tx checksum with on-demand fallback.

Tests cover concurrent static prep, multi-height pipeline retention, and same-height job caps; giga executor Signer.Equal is implemented for type-safe comparison.

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

@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJun 26, 2026, 4:50 PM

@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 43.17181% with 129 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.05%. Comparing base (0ff5a52) to head (fd54eac).

Files with missing lines Patch % Lines
app/app.go 43.75% 111 Missing and 15 partials ⚠️
giga/executor/internal/signer.go 0.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3495      +/-   ##
==========================================
- Coverage   59.16%   59.05%   -0.12%     
==========================================
  Files        2262     2187      -75     
  Lines      187009   181590    -5419     
==========================================
- Hits       110643   107237    -3406     
+ Misses      66430    64750    -1680     
+ Partials     9936     9603     -333     
Flag Coverage Δ
sei-chain-pr 46.79% <43.17%> (?)
sei-db 70.41% <ø> (ø)
sei-db-state-db ?

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

Files with missing lines Coverage Δ
giga/executor/internal/signer.go 18.18% <0.00%> (-1.82%) ⬇️
app/app.go 66.37% <43.75%> (-4.91%) ⬇️

... and 488 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.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5d8b337. Configure here.

Comment thread app/app.go
@codchen codchen force-pushed the codex/giga-static-pipeline branch from 5d8b337 to 87a27a2 Compare May 26, 2026 04:23
Comment thread app/app.go
Comment thread app/app.go Outdated

@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.

Cleanly splits state-free EVM tx preparation (envelope checks + sender recovery) from stateful giga execution and pipelines it across blocks via a deduplicated (height,hash) job map; callers, imports, panic recovery, and tests are all in order. No blockers found; a few non-blocking observations.

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

Blockers

  • None at the file/PR level.

Non-blocking

  • Determinism dependency worth a code comment: the static result is started in ProcessProposalHandler (proposal ctx) but deduped-and-consumed in ProcessBlock (which may run under the FinalizeBlock deliver ctx). This is consensus-safe only because prepareGigaStaticTx depends solely on header-derivable values (ctx.BlockHeight/BlockTime/ConsensusParams, chainID, tx bytes) and never touches the KV store. A note on prepareGigaStaticTx / StartGigaStaticBlockProcessing stating 'must remain strictly state-free' would protect against a future change to EvmStatelessChecks or GetVersion (signer-version selection) silently introducing a state dependency and breaking consensus across the two contexts.
  • Second-opinion passes produced no material findings: codex-review.md reports 'No material findings' (and notes it could not run go test ./app due to a Go 1.24 vs required 1.25.6 mismatch); cursor-review.md is empty.
  • Minor: in ProcessTxsSynchronousGiga the staticTx.err != nil ('[BUG]') branch calls recordGigaTxProcessed() while the analogous downstream execErr '[BUG]' branch does not — a trivial metrics inconsistency on an unreachable bug path.
  • Consider asserting len(staticTxs) == len(typedTxs)/len(txs) more defensively at the entry of ProcessTxsSynchronousGiga; today a short non-nil slice that happens to match length but is internally misaligned would index silently, though current callers always pass either nil or a full-length slice.
  • 2 suggestion(s)/nit(s) flagged inline on specific lines.

Comment thread app/app.go
recordGigaTxProcessed()
continue
}
if staticTx != nil && staticTx.err != nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit] Nit: this [BUG] branch calls recordGigaTxProcessed() but the analogous downstream execErr [BUG] branch (the txResults[i] = {Code:1, Log:"[BUG] giga executor error..."} path) does not record the metric. Harmless and on an unreachable path, but worth making the two [BUG] paths consistent.

Comment thread app/app.go
Height: req.Header.Height,
Time: req.Header.Time,
}
app.StartGigaStaticBlockProcessing(ctx, req.Txs, bpreq, typedTxs)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[suggestion] Consider a short comment here noting that the static work started with the proposal context is later deduped-and-consumed by ProcessBlock (potentially under the finalize-block context) via the (height,hash) key, and that this is only consensus-safe because prepareGigaStaticTx depends solely on header-derived values (height/time/consensus-params/chainID/tx bytes) and never reads chain state. It guards future maintainers against introducing a true state dependency in EvmStatelessChecks/GetVersion that would diverge between the two contexts.

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