Skip to content

fix: revert ChangeType::Creation attributes without DB lookup#1072

Open
louise-poole wants to merge 1 commit into
mainfrom
lp/revert-bug
Open

fix: revert ChangeType::Creation attributes without DB lookup#1072
louise-poole wants to merge 1 commit into
mainfrom
lp/revert-bug

Conversation

@louise-poole

Copy link
Copy Markdown
Collaborator

Chain reorgs on Base crashed with "Could not find Component" when a partial block was reverted that contained an attribute first set with ChangeType::Creation (e.g. a new Uniswap V4 tick slot). These attributes have no prior state anywhere — not in the reorg buffer (reverted range) and not in the DB (non-finalized component) — so looking up their previous value is both impossible and unnecessary.

Track ChangeType::Creation attributes in a new created_attributes field on ProtocolComponentStateDelta, populated during protobuf deserialisation. In handle_revert, filter these out of the buffer/DB lookup entirely and emit ChangeType::Deletion directly instead.

Chain reorgs on Base crashed with "Could not find Component" when a
partial block was reverted that contained an attribute first set with
ChangeType::Creation (e.g. a new Uniswap V4 tick slot). These
attributes have no prior state anywhere — not in the reorg buffer
(reverted range) and not in the DB (non-finalized component) — so
looking up their previous value is both impossible and unnecessary.

Track ChangeType::Creation attributes in a new `created_attributes`
field on ProtocolComponentStateDelta, populated during protobuf
deserialisation. In handle_revert, filter these out of the buffer/DB
lookup entirely and emit ChangeType::Deletion directly instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant