Skip to content

fix: refresh mempool caches every block - #36

Open
mmsqe wants to merge 6 commits into
mantra/v0.6.xfrom
stalepin
Open

fix: refresh mempool caches every block#36
mmsqe wants to merge 6 commits into
mantra/v0.6.xfrom
stalepin

Conversation

@mmsqe

@mmsqe mmsqe commented Jul 30, 2026

Copy link
Copy Markdown

Description

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

mmsqe added 2 commits July 30, 2026 16:11
call NotifyNewBlock unconditionally from EndBlock,
made idempotent per head so two drivers cannot emit duplicate chain head events

dedup chain head events per committed height
@github-actions github-actions Bot added the tests label Jul 31, 2026
mmsqe added 2 commits August 3, 2026 13:01
Both drivers call NotifyNewBlock every block, but EndBlock of N runs
before N commits, so it refreshes to the same committed height the event
bus goroutine already pinned after the previous commit -- one wasted
CreateQueryContext per block.

Add NotifyNewBlockAt for the two drivers that know the committed height:
it returns early before building a context when that height was already
notified. NotifyNewBlock keeps its zero-arg always-refresh contract for
callers that cannot name the height, and the post-refresh height check
stays authoritative.
* check the height hint before notifyMu (atomic), so a losing driver does not wait out the winner's feed delivery just to skip
* return the announced header (nil when nothing was sent), so recheck reuses it instead of rebuilding via CurrentBlock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant