Skip to content

Reuse existing CID or skip upload when oracle payload bytes are identical #72

@mgpai22

Description

@mgpai22

Summary

Even when the generated oracle payload is identical or semantically unchanged, the node performs a fresh cloud/IPFS upload instead of reusing an existing reference or skipping the upload entirely.

Observed behavior

During repeated cycles with no trie changes, the node uploads payloads of the same size repeatedly. In some cases the same CID is returned by IPFS (content-addressed dedup); in other cases multiple slightly different payloads are produced across no-op cycles. Either way the node does not detect the redundancy before uploading.

Why this matters

  • redundant network/storage operations
  • wasted time in the hot path on each cycle
  • unnecessary dependency on IPFS/cloud availability for identical content
  • harder to distinguish newly published state from reused state in logs

Expected behavior

If the payload bytes are identical to the last successfully published payload, the node should:

  • reuse the previous CID/reference, or
  • skip the upload completely

Proposed behavior

  • compute a deterministic content hash of the payload before uploading
  • compare with the last successful payload hash
  • if identical, reuse prior CID or bypass upload path
  • only upload when payload content actually differs

Acceptance criteria

  • identical payload bytes do not trigger a fresh upload
  • previous CID/reference is reused when payload content matches
  • logs distinguish uploaded new payload vs reused previous payload
  • behavior remains correct across restarts if prior payload metadata is persisted
  • no false reuse when payload bytes genuinely differ

Implementation note

Store the prior payload hash alongside the CID in oracle file metadata so deduplication survives process restarts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions