Context
Browse ranks published apps and wants a freshness signal: how recently an app content was updated. The natural source is the dotNS content resolver, since a redeploy updates the label contenthash.
Current behavior
contenthash(bytes32 node) returns only the current blob, with no timestamp and no history.
DotnsContentResolver emits ContentHashUpdated(bytes32 indexed node, bytes hash) on every write (contracts/resolvers/IDotnsContentResolver.sol), but the event carries no timestamp either.
- So the only way to answer "when did this node's contenthash last change" is to scan
ContentHashUpdated logs for the node, take the latest, and read that block's timestamp: an event/log scan plus a block-to-timestamp lookup.
Ask
Make the last-updated time cheaply readable from a view. Store an updatedAt (uint64 block timestamp) per node and expose a view such as contentHashUpdatedAt(bytes32 node) returns (uint64). One extra SSTORE per write, O(1) read, no log infrastructure needed. Could also be returned alongside the hash.
Context
Browse ranks published apps and wants a freshness signal: how recently an app content was updated. The natural source is the dotNS content resolver, since a redeploy updates the label contenthash.
Current behavior
contenthash(bytes32 node)returns only the current blob, with no timestamp and no history.DotnsContentResolveremitsContentHashUpdated(bytes32 indexed node, bytes hash)on every write (contracts/resolvers/IDotnsContentResolver.sol), but the event carries no timestamp either.ContentHashUpdatedlogs for the node, take the latest, and read that block's timestamp: an event/log scan plus a block-to-timestamp lookup.Ask
Make the last-updated time cheaply readable from a view. Store an
updatedAt(uint64 block timestamp) per node and expose a view such ascontentHashUpdatedAt(bytes32 node) returns (uint64). One extra SSTORE per write, O(1) read, no log infrastructure needed. Could also be returned alongside the hash.