improve(cross-chain-oracle): [L04] Stamp ancillary data in hasPrice and getPrice#3668
improve(cross-chain-oracle): [L04] Stamp ancillary data in hasPrice and getPrice#3668nicholaspai merged 2 commits intomasterfrom
Conversation
There was a problem hiding this comment.
This is interesting. it definitely makes interacting with the spoke directly easier. importantly, the stamping only includes the chainId so this is forward compatible with upgrades to the spoke, keeping previous requests still functional.
also, this change now makes the has/get price methods consistent with the inputs you would put into requestPrice. previously you would put in one ancillary data, which would then be stamped and would need separate ancillary data when fetching data from the contracts. this would have made implementation integrating with this contract more difficult as they would need to pre-stamp their ancillary data when calling hasPrice and getPrice
Totally agreed. We originally removed the stamping in the previous PR because the stamping logic added |
Motivation
I believe we should stamp ancillary data in these public methods. I originally removed this stamping logic in this PR because the previous
stampAncillaryDataimplementation stamped themsg.senderaddress, which means that only the original requester could callhas/getPrice, but now that we removed it we can add stamping for the caller’s convenience.This improves the caller's experience as they only need to pass the original ancillary data that was passed into
requestPrice.This PR is possible because
stampAncillaryDatanow only stamps theblock.chainIdwhich is not affected by who themsg.senderis.Testing
Check a box to describe how you tested these changes and list the steps for reviewers to test.