feat(adapters): implement Across V3 parse_event#7
Open
Patrick-Ehimen wants to merge 1 commit into
Open
Conversation
Decodes V3FundsDeposited logs from Across SpokePool contracts. Handles the
three indexed params (destinationChainId, depositId, depositor) that land in
topics rather than data — alloy's decode_raw_log merges both in one call.
correlation_id is scoped as "across:{sourceChain}:{depositId}" to prevent
cross-chain collisions since depositId is per-SpokePool, not globally unique.
Maps raw EVM chainId (uint256) to internal ChainId for the destination chain.
5 unit tests: happy path, wrong topic, unknown dest chain, correlation_id
scoping across two source chains, large u128 amount without overflow.
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.
Summary
parse_eventon theAcrossadapter to decodeV3FundsDepositedlogs from Across SpokePool contracts (6 chains — no Avalanche)V3FundsDepositedhas 3 indexed params (destinationChainId,depositId,depositor) split across topics and 10 non-indexed params in data —decode_raw_logmerges both in one callcorrelation_idis scoped asacross:{sourceChain}:{depositId}becausedepositIdis a per-SpokePool monotonic counter, not globally unique across chains — two chains can both emitdepositId=1chainId(uint256) to internalChainIdfor the destination chainindexer/src/adapters/tests/across.rsTest plan
cargo clippy --workspace --all-targets -- -D warnings— cleancargo test -p indexer— 9/9 pass (4 LayerZero V2 + 5 Across)parses_valid_deposit— all fields map correctly end-to-endrejects_wrong_topic— returnsNonewithout touching dataunknown_chain_id_gives_none_dest_chain— unmapped EVM chainId →dest_chain: Nonecorrelation_id_includes_source_chain— samedepositIdon two chains produces differentcorrelation_idhandles_large_amount—u128::MAXamount encodes/decodes without overflow