Avoid multiple calls to `process_proposal`
Describe your changes
This PR tries to improve the extra calls to process proposal requested by Namada (nothing changes for the requests coming from Comet). More specifically:
- The more complete
process_proposalis now called instead ofprocess_txs - The
InMemorystruct has been expanded with an extra field that caches the requests toprocess_proposalfor a given block so that future calls can be avoided. This cache is cleared when handling aFinalizeBlockrequest
Indicate on which release or other PRs this topic is based on
v0.40.0
Checklist before merging to draft
- [x] I have added a changelog
- [x] Git history is in acceptable state
Codecov Report
Attention: Patch coverage is 10.78838% with 215 lines in your changes missing coverage. Please review.
Project coverage is 53.41%. Comparing base (
8479d38) to head (5523e05). Report is 4 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #3473 +/- ##
==========================================
- Coverage 53.48% 53.41% -0.08%
==========================================
Files 320 320
Lines 110000 110160 +160
==========================================
+ Hits 58832 58840 +8
- Misses 51168 51320 +152
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@sug0 I've pushed a few more commits to change some things on top of your recommendations:
- We know have a custom type for the cached elements to avoid caching the txs results when the block is rejected (since we don't need them)
- The cache is not more a
HashMapbut aCLruCacheto avoid consuming too much memory in cases where the network struggles to make progress and starts producing many block proposals
Let me know if they are ok or it's better to revert the last commits