hyperlane-monorepo icon indicating copy to clipboard operation
hyperlane-monorepo copied to clipboard

Scraper: H512 tx hashes for Solana support

Open tkporter opened this issue 1 year ago • 0 comments

Problem

Because of Solana's 64 byte tx hash lengths (instead of the typical 32 bytes in Ethereum), we moved much of the agent code to using H512 for tx hashes. However we didn't change the scraper - it still works only with 32 byte tx hashes.

We'll still use bytea which isn't fixed length for storing tx hashes. However we'll need to change some logic to support H512 tx hashes to avoid stuff like this: https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/02d5549608e97401edc5028ba59de0809c5a459e/rust/agents/scraper/src/chain_scraper/mod.rs#L84

Solution

Our options are:

  1. always write H512s, and have application logic know to grab the latter 32 bytes for Ethereum chains, etc
  2. write tx hashes with a length dependent upon the protocol being used

1 is probably easier in the way that things are set up in the agent codebase

tkporter avatar Feb 29 '24 14:02 tkporter