perf: suppress dead Cosmos events in giga executor path#2904
Open
pdrobnjak wants to merge 1 commit intopd/giga-block-cache-v2from
Open
perf: suppress dead Cosmos events in giga executor path#2904pdrobnjak wants to merge 1 commit intopd/giga-block-cache-v2from
pdrobnjak wants to merge 1 commit intopd/giga-block-cache-v2from
Conversation
Cosmos-level events (coin_spent, coin_received, transfer, etc.) emitted during giga executor tx execution are never consumed: the ExecTxResult is built without populating the Events field, and events are not consensus-critical (stripped from deterministicExecTxResult). EVM logs (Solidity events) flow through a completely separate path (tempState.logs -> receipts + MsgEVMTransactionResponse) and are unaffected. When GIGA_SUPPRESS_COSMOS_EVENTS=true: - EventManager.EmitEvent/EmitEvents return immediately (no mutex, no append, no bech32 encoding in event attributes) - Snapshot() creates suppressed EventManagers - Finalize() skips the flushEvents() consolidation loop This eliminates ~55s of mutex contention per 30s profile window: - AccAddress.String() bech32 cache mutex: ~27s - EventManager.EmitEvents RWMutex: ~28s Also updates benchmark/analysis/ with findings from the AccAddress.String sync.Map optimization (PR #2902) and this event suppression discovery. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## pd/giga-block-cache-v2 #2904 +/- ##
===========================================================
- Coverage 57.22% 48.38% -8.85%
===========================================================
Files 2093 671 -1422
Lines 171750 50621 -121129
===========================================================
- Hits 98285 24491 -73794
+ Misses 64687 23984 -40703
+ Partials 8778 2146 -6632
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
arajasek
approved these changes
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GIGA_SUPPRESS_COSMOS_EVENTS=trueenv var flag to skip Cosmos-level event emission (coin_spent, coin_received, etc.) during giga executor tx executionExecTxResult.Eventsis never populated, events are not consensus-critical, anddeterministicExecTxResultstrips themtempState.logs→ receipts) and are unaffectedImplementation
EventManager.suppressedfield —EmitEvent/EmitEventsreturn immediately (no mutex, no append, no bech32 encoding)NewSuppressedEventManager()constructor for the suppressed variantDBImpl.cosmosEventsSuppressed—Snapshot()creates suppressed EventManagersFinalize()skipsflushEvents()loop entirely when suppressedProfile impact (benchmark-compare.sh, 120s)
Mutex contention eliminated: -48.35s (7.6% of total)
EventManager.EmitEvents: -48.21ssync.(*Mutex).Unlock: -48.35sAllocations eliminated: ~1.65 GB
Events.AppendEvents: -1,068 MBEvents.AppendEvent: -729 MBTPS was flat in isolation because the bottleneck shifts to
Snapshot()→CacheMultiStoreallocation. The contention and allocation savings will compound once that path is optimized.Test plan
giga/deps/xevm/statetests passsei-cosmos/typestests passGIGA_SUPPRESS_COSMOS_EVENTS=true🤖 Generated with Claude Code