Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect topic generation for event signatures with tuples #50

Open
Evan-Kim2028 opened this issue Oct 6, 2024 · 1 comment
Open

Comments

@Evan-Kim2028
Copy link

Problem

Hypersync logs cannot deal with tuples - can't generate the right topic and can't decode the log correctly either.

web 3 topic generation with the tuple:


topic0 = web3.Web3.keccak(
    # text="FilledV3Relay(address inputToken,address outputToken,uint256 inputAmount,"
    #         "uint256 outputAmount,uint256 repaymentChainId,uint256 indexed originChainId,"
    #         "uint32 indexed depositId,uint32 fillDeadline,uint32 exclusivityDeadline,"
    #         "address exclusiveRelayer,address indexed relayer,address depositor,"
    #         "address recipient,bytes message,V3RelayExecutionEventInfo relayExecutionInfo)"
    text="FilledV3Relay(address,address,uint256,uint256,uint256,uint256,uint32,uint32,uint32,address,address,address,address,bytes,(address,bytes,uint256,uint8))"
)

Returns topic0 = 0x571749edf1d5c9599318cdbc4e28a6475d65e87fd3b2ddbe1e9a8d5e7a0f0ff7 which is correct.

Hypersync topic generator

hypersync.signature_to_topic0(self.signature) with this signature:

 "FilledV3Relay(address inputToken, address outputToken, uint256 inputAmount, "
            "uint256 outputAmount, uint256 repaymentChainId, uint256 indexed originChainId, "
            "uint32 indexed depositId, uint32 fillDeadline, uint32 exclusivityDeadline, "
            "address exclusiveRelayer, address indexed relayer, address depositor, "
            "address recipient, bytes message, tuple relayExecutionInfo)"
            ```

Generates a different topic than web3.

Here is the tuple structure in the contract: - https://github.com/across-protocol/contracts/blob/f67b64caff2e68464178ebeadb7d03ce633b50e3/contracts/interfaces/V3SpokePoolInterface.sol#L92
         
@JasoonS JasoonS transferred this issue from enviodev/hypersync-client-python Nov 29, 2024
@JasoonS
Copy link
Contributor

JasoonS commented Nov 29, 2024

Thanks for reporting this @Evan-Kim2028 . Sorry we missed it for so long 😅

I've transferred it here to the Rust client since this is the origin of where the issue needs to be fixed.

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

No branches or pull requests

2 participants