Skip to content

async updateBase#4174

Draft
advaita-saha wants to merge 5 commits into
masterfrom
smooth-fcu
Draft

async updateBase#4174
advaita-saha wants to merge 5 commits into
masterfrom
smooth-fcu

Conversation

@advaita-saha

Copy link
Copy Markdown
Contributor

updateBase is now async, yielding once after db.persist() and once every 16 ancestors during the cleanup loop — so a full 256-block batch gets

~17 yield points instead of 0.

  • Reordered so c.base / c.baseTxFrame pointer updates happen before the cleanup burst, with oldFrontier = base.parent captured first. If a shutdown cancels us mid-cleanup, ForkedChain invariants stay coherent.
  • Split wall-clock into persistMs + cleanupMs aggregated over the batch and surfaced in the existing "Finalized blocks persisted" log — the cheapest possible instrumentation to tell you at a glance whether future stalls are disk or cleanup.
  • processUpdateBase now awaits the async updateBase.

… every 16 ancestors during the cleanup loop — so a full 256-block batch gets

  ~17 yield points instead of 0.
  - Reordered so c.base / c.baseTxFrame pointer updates happen before the cleanup burst, with oldFrontier = base.parent captured first. If a shutdown
   cancels us mid-cleanup, ForkedChain invariants stay coherent.
  - Split wall-clock into persistMs + cleanupMs aggregated over the batch and surfaced in the existing "Finalized blocks persisted" log — the
  cheapest possible instrumentation to tell you at a glance whether future stalls are disk or cleanup.
  - processUpdateBase now awaits the async updateBase.
@advaita-saha
advaita-saha requested a review from bhartnett April 24, 2026 12:30
@bhartnett

bhartnett commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

@advaita-saha I find all the comments in the PR to be overly verbose. I would suggest removing most of them, just keeping the most necessary.

Comment thread execution_chain/core/chain/forked_chain.nim Outdated
@advaita-saha

advaita-saha commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

I find all the comments in the PR to be overly verbose

Yes the comments are there mostly for me so intentionally verbose, as I am working on multiple branches with different things.
Will remove when the PR is finalized

Comment thread execution_chain/core/chain/forked_chain.nim Outdated
@advaita-saha

Copy link
Copy Markdown
Contributor Author

Deploying branch to my home validator nodes ( hoodi ) for analysing improvement

@advaita-saha

Copy link
Copy Markdown
Contributor Author

Noticed minimal to no improvement in attestation perfomance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants