Skip to content

Smart Contract 端遇到 先被notify後,使用 explorer API 會查不到的時間差問題 #113

@hwwhww

Description

@hwwhww

Related issue: Smart Contract #202

Smart Contract 端會 subscribe txnotify 或 addressnotify,
收到 notification ,會使用explorer API 中的 /explorer/v1/transactions/address/{address} 檢查先前的 transaction,但此時可能還查不到最新的tx
先前 @icence 有想法是,是否可以在 OSS 端,改成設定「explorer有資料後再notification」?

deploy_contract 001

如上圖

  1. 因為有2.1 /notification/v1/tx/subscribe, 因此 OSS 會在 3.1 notify callback 給 oracle
  2. oracle 收到 tx 的 notification 後即再對 OSS 送出 4.1 /explorer/v1/transactions/address/{address},希望可以得到此address所有的交易資訊,用以在oracle端檢查此筆tx 前的相關合約操作都已經執行完成
  3. 但因為 4.1 /explorer/v1/transactions/address/{address} 是 explorer API ,在同步時間沒這麼快速的情況下,則有可能仍未包含最新的transaction 資訊!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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