eden-network / tx-explain

MIT License
2 stars 2 forks source link

No summary from AI model if there is too many logs #14

Open zanknaf opened 6 months ago

zanknaf commented 6 months ago

Tx explain hits token limit with transactions that have 70+ logs (estimate based on testing).

Possible solutions: Compressing call trace data, Using only asset changes object

Example transaction: https://etherscan.io/tx/0x3212df955f1ff00f04cab390ad2cd8c21982a6d4cbc8db8805c2aa892975cfb5

Response from claude: Error streaming explanation: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'prompt is too long: 214668 tokens > 199999 maximum'}}

zanknaf commented 6 months ago

It is 0,05% of transactions that will not work because of token limit

Calculation done: Anything over 4M gas used (I have tried transactions with 3,8M gas and they still work, 4M is most likely the magic limit)

Over the past 8 days only 5016 transactions reached this limit, out of those 30% are scam USDC/USDT transfer with 1000 logs each, some are smart contract deployments and some are complex swaps/mev transactions