hashgraph / hedera-mirror-node

Hedera Mirror Node archives data from consensus nodes and serves it via an API
Apache License 2.0
147 stars 112 forks source link

Add block number to contract log #4748

Open xin-hedera opened 2 years ago

xin-hedera commented 2 years ago

Problem

Due to citus limit on lateral subquery with limit clause support, all contract logs related REST API fail on the underlying SQL statement which joins on a lateral subquery with limit to find the corresponding block number and block hash.

We can instead add a block number column to contract log and then change the query to inner join record_file on block number.

Solution

Alternatives

No response

xin-hedera commented 2 years ago

was able to rewrite the contract logs SQL query to be citus compatible after some research in PR #4749. However, will leave this ticket open just in case it may still be needed for potential performance improvement. Will close once we verify performance with existing query looks good.