Skip to content

[Feat]: Expose when a node contenthash last changed #193

Description

@BigTava

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions