Repository navigation
fix: keep DCI account creations in the block aggregate - #1596
Merged
Merged
Conversation
zizou0x
approved these changes
Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Dev ethereum shadow mode logged a
mismatchon 2026-10-09 20:49 UTC (uniswap_v4_hooks,/contract_state, block 26157347). For hook0xa99e3d00ad56b1522eaa34f0f2fead9c6902e772, the cache returned empty code and no slots. The DB returned 8566 bytes of code and ~1188 slots. After block 26156852, every block loggedChange for an unknown account skippedfor the hook.Root cause
In block 26156852, txs 3 to 10 touch the hook. The hooks DCI traces at tx 10, finds the hook for the first time, and attaches its full state to tx 10 as a
Creation. Then it adds anUpdateto every tx in the block that changed the hook's storage (txs 3 to 10).The DB path reads each tx on its own and inserts the contract. The window and the entity cache read the block aggregate.
AccountDelta::mergekeeps the first change type, so the aggregate isUpdate, andEntityCacheskips anUpdatefor an unknown account.Fix
Update. The account extractor labels every resultCreation, and the DCI passed that label on.AccountDelta::mergekeeps aCreationfrom the newer delta. After the first fix, a DCICreationmeans "new to this extractor's DCI", so the promotion is safe.Notes for reviewers
Creation, notUpdate, for a DCI-new account that an earlier tx in the block updated. This matches the DTO merge, which already keepsCreation.Updatefor an account that the DCI finds as new, the tx-level delta becomesCreation. The DB path then runsinsert_contract, which does nothing on conflict.insert_contract. It writes the same code and balance as before, so no new version rows appear.Deletioninselfmerged withCreationinothernow givesCreation. No forward producer emits account deletions.Follow-ups
Change for an unknown account skippedon the hooks extractors. Expect none for newly tracked accounts.🤖 Generated with Claude Code