Skip to content

Skip signature event building during Cosmos CheckTx/ReCheckTx#3230

Open
amir-deris wants to merge 2 commits intomainfrom
amir/plt-261-cosmos-skip-signature-event-building-during-CheckTx-ReCheckTx
Open

Skip signature event building during Cosmos CheckTx/ReCheckTx#3230
amir-deris wants to merge 2 commits intomainfrom
amir/plt-261-cosmos-skip-signature-event-building-during-CheckTx-ReCheckTx

Conversation

@amir-deris
Copy link
Copy Markdown
Contributor

@amir-deris amir-deris commented Apr 10, 2026

Summary

  • During CheckTx and ReCheckTx, CheckSignatures was unconditionally building signature events (account sequence formatting, SignatureDataToBz, base64 encoding) even though CosmosCheckTxAnte discards them with _.
  • Added a skipSigEvents guard so this work is skipped when ctx.IsCheckTx() || ctx.IsReCheckTx() — reducing allocations and CPU on the highest-frequency ante path.
  • CosmosDeliverTxAnte is unaffected: its context always has both flags false, so events are still built and emitted normally.

Result

In branch amir/PLT-218-analyze-app-performance, running 4 node cluster and doing sei-chain/loadtest for Cosmos Bank and Staking transaction types, and taking pprof CPU profiles at specific heights, we observe about 15% less CPU usage in CosmosCheckTxAnte.

@amir-deris amir-deris self-assigned this Apr 10, 2026
@amir-deris amir-deris changed the title Amir/plt 261 cosmos skip signature event building during check tx re check tx Skip signature event building during Cosmos CheckTx/ReCheckTx Apr 10, 2026
@github-actions
Copy link
Copy Markdown

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 10, 2026, 10:02 PM

@github-actions
Copy link
Copy Markdown

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 10, 2026, 10:02 PM

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.01%. Comparing base (786863f) to head (2a3795e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
app/ante/cosmos_checktx.go 75.00% 1 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3230   +/-   ##
=======================================
  Coverage   59.01%   59.01%           
=======================================
  Files        2065     2065           
  Lines      169369   169371    +2     
=======================================
+ Hits        99956    99960    +4     
+ Misses      60649    60648    -1     
+ Partials     8764     8763    -1     
Flag Coverage Δ
sei-chain-pr 48.14% <75.00%> (?)
sei-db 70.41% <ø> (ø)

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

Files with missing lines Coverage Δ
app/ante/cosmos_checktx.go 36.48% <75.00%> (+0.88%) ⬆️
🚀 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.

@amir-deris amir-deris requested review from bdchatham and masih April 10, 2026 22:11
@amir-deris amir-deris enabled auto-merge April 10, 2026 22:35
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.

2 participants