I'm trying to decode Arbitrum's L1 batch data fetched from Etherscan. I'm using ethers.js
to convert the hexadecimal data to a Uint8Array
and then attempting to decompress it with a Brotli library in Node.js. However, I'm encountering an error during the decompression process.
Code Snippet:
const ethers = require('ethers');
const brotli = require('brotli');
let data = '0x...'; // Hexadecimal string from Etherscan (the `data` in `bytes` under Input Data)
let bytesData = ethers.getBytes(data);
let decompressedData = brotli.decompress(bytesData);
Error:
Error: [ReadHuffmanCodeLengths] space = -1024
I'm looking for guidance on:
- Correctly converting the data for Brotli decompression.
- Handling specifics of Arbitrum's batch data format.
- Resolving the decompression error in Node.js.
Any advice or insights would be greatly appreciated!