Skip to content

Skip oracle publication when trie diff is empty and root hash is unchanged #71

@mgpai22

Description

@mgpai22

Summary

The oracle node uploads and prepares publication artifacts even when the source data has not changed, trie operations are empty, and the Merkle root is identical to the current anchored state.

Observed behavior

On repeated cycles with no source data changes, the node still:

  • fetches oracle data items
  • calculates trie operations (insertions: 0, updates: 0, deletions: 0)
  • computes the same trie root hash as the currently anchored state
  • uploads to cloud
  • builds and submits a recreate transaction

The node treats an unchanged state as a publishable cycle.

Why this matters

  • unnecessary IPFS/cloud uploads
  • unnecessary tx preparation and submission
  • makes no-op cycles indistinguishable from meaningful state updates
  • adds cost and noise without changing oracle state

Expected behavior

If:

  • insertions = 0
  • updates = 0
  • deletions = 0
  • and the computed root hash matches the current on-chain anchored state

then the cycle should be treated as a no-op and skipped entirely.

Proposed behavior

  • after diff calculation, explicitly check whether the diff is empty
  • compare computed root against the currently anchored root
  • if unchanged, skip upload and skip tx submission

Acceptance criteria

  • no cloud upload occurs when diff is empty and root hash is unchanged
  • no recreate tx is built or submitted in that case
  • logs indicate the cycle was skipped because oracle state is unchanged
  • validation and normal publication still work correctly when a real insert/update/delete is present

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