Repository navigation
fix(bfa): scan FundsIn logs from the asset genesis in bounded ranges - #108
Merged
Merged
Conversation
bridge-smart-contracts #174 indexes rgbOpId in FundsIn. The parser now takes the OpId from topic2 (big-endian uint256) and the amount from the only data word; the old layout no longer decodes. The test bridge contract indexes it too.
BFA receive validation asked eth_getLogs for every FundsIn from block 0. The public Arbitrum One RPC now refuses ranges over 10M blocks, so every BFA receive stayed WaitingCounterparty. The scan now starts at the first block mined a day before the asset genesis (found by a binary search on block timestamps) and runs to the head in ranges of at most 10M blocks, halving a range the node refuses. Fewer events can only make validation stricter, so the later start loosens nothing.
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
BFA receive validation fetched every Bridge
FundsInlog witheth_getLogs(fromBlock 0x0, toBlock latest). The public Arbitrum One RPC now refuses ranges over 10M blocks (-32602 query spans N blocks ... only 10000000 are allowed). So every BFA receive fails, and the transfer staysWaitingCounterpartywith the error only inRefreshedTransfer.failure.Fix
EthClient::funds_in_logs_since(contract, genesis_ts)replaces the full scan:eth_blockNumber).eth_getBlockByNumber, about 29 calls on Arbitrum One).Starting at the genesis drops nothing a mint can use: a mint OpId commits to the contract id, so no FundsIn naming it can be older than the genesis. The one-day slack covers issuer clock skew. Fewer events can only make the
ceacheck stricter, never looser.The
get_logs/client_versionJSON-RPC plumbing is merged into onecallhelper.client_versionsends the same request as before.This is a quick patch until we migrate to upstream rgb-lib.
Tests
0xc7faf6fa…): both FundsIn logs of 2026-10-06 were found in about 5 s, where the old query is refused.cargo clippyin all four CI feature sets.