fix(evm): clone query cosmos proto buffers#305
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughIn ChangesCosmos Query Proto Clone Fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #305 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 10 10
Lines 3224 3224
=====================================
Misses 3224 3224 🚀 New features to boost your workflow:
|
Description
Closes: N/A
This fixes a data race in the
query_cosmosprecompile by treating whitelist protobuf messages as prototypes only. The precompile now clones request and response messages before JSON/protobuf conversion so concurrent calls do not mutate shared decode buffers.The PR also adds concurrent regression coverage for
query_cosmosusing a shared whitelist and independent precompile instances. The test asserts zero errors and zero mismatched query results.Validation
go test ./x/evm/precompiles/cosmos -run 'Test_QueryCosmos$|Test_QueryCosmosDataRace' -count=1 -vgo test -race ./x/evm/precompiles/cosmos -run 'Test_QueryCosmosDataRace' -count=1 -vgo test ./x/evm/precompiles/cosmos -count=1Author Checklist
I have...
!in the type prefix if API or client breaking changeSummary by CodeRabbit
Bug Fixes
Tests