fix(pxe): warn when block header unavailable for proven/finalized events#22050
Conversation
d9f299c to
8640ae3
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
| if f.has_named_attribute("noinitcheck") { | ||
| true | ||
| } else { | ||
| // #[only_self] functions automatically skip the initialization check as the check is assumed to be done by the | ||
| // calling external function or explicitly skipped. See only_self function docs for more details. | ||
| is_fn_only_self(f) | ||
| } |
There was a problem hiding this comment.
I did this code yesterday and then I recalled I could simplify it and it kept on bothering me
|
|
||
| this.log.debug(`Syncing PXE with the node`); | ||
| // Capture the promise locally so we always await the exact promise we created, even if this.isSyncing is modified | ||
| // between assignment and await (e.g. due to future refactors introducing a yield point). |
There was a problem hiding this comment.
This was not clear to me and AI helped me here to explain it so I added there a comment.
nchamo
left a comment
There was a problem hiding this comment.
Warnings are always appreciated 👐
| // #[only_self] functions automatically skip the initialization check as the check is assumed to be done by the | ||
| // calling external function or explicitly skipped. See only_self function docs for more details. | ||
| f.has_named_attribute("noinitcheck") | is_fn_only_self(f) |
There was a problem hiding this comment.
I'm curious about why this is necessary. only_self adds the noinitcheck attribute automatically. I assumed this meant that it would pass the f.has_named_attribute("noinitcheck") check
There was a problem hiding this comment.
This is because we don't want to force people to slap #[noinitcheck] on #[only_self] - we essentially want that to be implicit.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8640ae3 to
7472aa9
Compare
|
Sorry, forgot to squash this before merging |
|
❌ Failed to cherry-pick to |
…nts (#22050) Improved logging based on audit finding 114 in #21500 + random improvements that I noticed could be done ## Summary - Adds warning logs in PXE block synchronizer when `getBlockHeader` returns null for `chain-proven` and `chain-finalized` events, instead of silently skipping the anchor update. - Aligns with the `chain-pruned` handler which already throws on missing headers. Closes #21500 .
…nts (backport #22050) (#22547) ## Summary Backport of #22050 to v4-next. Cherry-pick applied cleanly. The noir-projects change from the original PR was already present on v4-next, so only the PXE block_synchronizer changes were needed. ### Changes - Adds warning logs in PXE block synchronizer when `getBlockHeader` returns null for `chain-proven` and `chain-finalized` events, instead of silently skipping the anchor update - Adds a comment clarifying the local promise capture pattern in `sync()` ClaudeBox log: https://claudebox.work/s/017ec0a44d097055?run=1

Improved logging based on audit finding 114 in #21500 + random improvements that I noticed could be done
Summary
getBlockHeaderreturns null forchain-provenandchain-finalizedevents, instead of silently skipping the anchor update.chain-prunedhandler which already throws on missing headers.Closes #21500 .