etherfi: gate claim list by on-chain finalized+valid state - #304
Merged
Conversation
Subgraph can report already-claimed requests as claimable, so claimEtherFiWithdrawals reverted with "ERC721: invalid token ID".
clement-ux
approved these changes
Jul 16, 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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
autoClaimEtherFiWithdrawwas failing every run on mainnet withexecution reverted: ERC721: invalid token ID. Example failed runRoot cause:
claimableEtherFiRequests()builds the claim list purely from the ops-squid subgraph (claimable_isNull: false, claimed_isNull: true) with no on-chain check. Request80636was already claimed on-chain (NFT burnt, request struct deleted), but the subgraph still reported it as claimable, soclaimEtherFiWithdrawals([80636])reverted insideownerOf(). EtherFi'sisFinalized()is a pureid <= lastFinalizedRequestIdcomparison that staystrueafter a claim, so a stale request keeps coming back and wedges the action.Fix
Gate the subgraph candidates against the EtherFi
WithdrawRequestNFTbefore claiming — keep only requests that areisFinalized && getRequest().isValid(mirrors the existing Lido path, which already filters onisFinalized && !isClaimed).isValidis false once a request is claimed/invalidated, dropping stale ids like80636. Skipped ids are logged.