logos-innovation-lab / Kurate

https://kurate.vercel.app/
1 stars 5 forks source link

Show correct time when post was created #123

Closed vojtechsimetka closed 1 year ago

vojtechsimetka commented 1 year ago

The issue is, that in order to get a timestamp when a post was created, we would have to make an API call for each one of the posts. This is known pain https://ethereum-magicians.org/t/proposal-for-adding-blocktimestamp-to-logs-object-returned-by-eth-getlogs-and-related-requests/11183 . Ultimately the solution is to have some cache mechanism but even then it is somewhat wasteful.

However, I think we can have creative ways how to alleviate the problem since we have the blocknumber when the post was sent:

  1. Show how many blocks ago the post was sent
  2. Approximate time when the post was sent based on how many blogs ago it was and mean block time
filoozom commented 1 year ago

Just add the timestamp to the emitted event? That's the option I chose for Boardwalk because it scales way better even though it's not super clean and costs a bit more gas.

vojtechsimetka commented 1 year ago

This is no longer an issue.