Skip to content

Add support for proxy contract decoding#287

Open
moisses89 wants to merge 20 commits into
mainfrom
support_proxy_decoding
Open

Add support for proxy contract decoding#287
moisses89 wants to merge 20 commits into
mainfrom
support_proxy_decoding

Conversation

@moisses89

@moisses89 moisses89 commented May 26, 2026

Copy link
Copy Markdown
Member

Description

Closes PLA-1524 #242
When a contract has an implementation address, it indicates that the contract is a proxy. In such cases, the implementation contract should be used for contract decoding instead of the proxy address.

Comment thread app/datasources/cache/redis.py Outdated
# Set expiration just if is not configured
if await redis.ttl(hash_key) == -1:
await redis.expire(hash_key, expire)
await redis.expire(hash_key, expire, nx=True)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using NX redis option so at this way we don't need the ttl query and we avoid a minor issue with a possible race condition.
https://redis.io/docs/latest/commands/expire/

@moisses89 moisses89 marked this pull request as ready for review June 1, 2026 08:35
@moisses89 moisses89 requested a review from a team as a code owner June 1, 2026 08:35
Comment thread app/tests/workers/test_tasks.py Outdated
Comment thread app/services/data_decoder.py Outdated
@datadog-official

This comment has been minimized.

@moisses89 moisses89 requested a review from Uxio0 June 30, 2026 15:38
if address is not None:
async with transactional_session_context():
if chain_id is not None and await self.get_contract_abi(
if chain_id is not None and await self._has_contract_abi(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this method proxy-aware? I mean, it only checks _has_contract_abi against the proxy’s address, not that of the implementation. A proxy without its own ABI but with an implementation ABI is decoded correctly, but is reported as PARTIAL_MATCH/ONLY_FUNCTION_MATCH instead of FULL_MATCH. The decoding was proxy-aware, but the accuracy was not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants