You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a Gateway client developer, I want to know, as accurately as possible given the available data, the time at which a given piece of content was posted to the chain. This allows the application to choose which timestamp.
Acceptance Criteria
Add a blockTimestamp field to the content watcher webhook
Prior Discussion
Elaboration
We have some TODOs in the code; one of them is to come up with a reasonable timestamp to attach to content display. For now, we've been encoding the time that the content (Parquet file) was retrieved from IPFS by the SAT backend; obviously this is not acceptable by any means, as it would be different for different backends. It's also not reasonable to expect a client to convert a block number to a time, because:
Block times now with async backing are not consistent enough
Don't want to force the client to interact directly with the chain, or have to provide an endpoint to do block number → timestamp conversion. Also if the goal is to insulate web2 developers from needing to grok web3 concepts, forcing them to deal with block numbers is the opposite of that.
My initial thought is that content-watcher should get the timestamp inherent from the block when it retrieves content, and include that in the webhook payload when it sends out the content notifications. Reasons?
content-publisher is not the right place, because it would require a DSNP spec change, or at minimum a Frequency extension to the spec
Forcing the client to do it subverts the purpose of Gateway (see above)
Discussion?
@aramikm pointed out below that the actual content does contain a published datetime. However, this raises a further issue: currently, content-watcher only broadcasts the on-chain content announcement, not the content itself. It's left to the client to retrieve the Parquet batch file and validate/decode it.
In discussion with @wilwade , it was suggested that perhaps it would be better (and more in line with the goal of the Gateway services) to have content-watcher fetch, decode and validate the batched Parquet content and broadcast the individual message content, instead of just an announcement of the content.
The text was updated successfully, but these errors were encountered:
Description
As a Gateway client developer, I want to know, as accurately as possible given the available data, the time at which a given piece of content was posted to the chain. This allows the application to choose which timestamp.
Acceptance Criteria
blockTimestamp
field to the content watcher webhookPrior Discussion
Elaboration
We have some TODOs in the code; one of them is to come up with a reasonable timestamp to attach to content display. For now, we've been encoding the time that the content (Parquet file) was retrieved from IPFS by the SAT backend; obviously this is not acceptable by any means, as it would be different for different backends. It's also not reasonable to expect a client to convert a block number to a time, because:
My initial thought is that
content-watcher
should get the timestamp inherent from the block when it retrieves content, and include that in the webhook payload when it sends out the content notifications. Reasons?content-publisher
is not the right place, because it would require a DSNP spec change, or at minimum a Frequency extension to the specDiscussion?
@aramikm pointed out below that the actual content does contain a
published
datetime. However, this raises a further issue: currently,content-watcher
only broadcasts the on-chain content announcement, not the content itself. It's left to the client to retrieve the Parquet batch file and validate/decode it.In discussion with @wilwade , it was suggested that perhaps it would be better (and more in line with the goal of the Gateway services) to have
content-watcher
fetch, decode and validate the batched Parquet content and broadcast the individual message content, instead of just an announcement of the content.The text was updated successfully, but these errors were encountered: