When backend components are handling orders, right now they are using only the orderID (transferTxId) and provider(using ocean.py) scans the blockchain in the past (from the contracts deployment block). This is very inefficient (on ETH) and a blocker soon (https://blog.ethereum.org/2021/03/03/geth-v1-10-0/ - chapter "Transaction unindexing" )
Description:
When backend components are handling orders, right now they are using only the orderID (transferTxId) and provider(using ocean.py) scans the blockchain in the past (from the contracts deployment block). This is very inefficient (on ETH) and a blocker soon (https://blog.ethereum.org/2021/03/03/geth-v1-10-0/ - chapter "Transaction unindexing" )
(https://github.com/oceanprotocol/provider/blob/ae2abcd818fceadeb0e098180aa269b260faf37b/ocean_provider/util.py#L217 and https://github.com/oceanprotocol/ocean.py/blob/94131c50d1b478e22f6567f2afbe01ca38c07e6e/ocean_lib/models/data_token.py#L212)
Changes requested:
Every orderID(transferTxId) should be optionally send along with blockNo. When doing verify_order_tx:
Repos affected: ocean.py -> provider and ocean.js
Provider:
Frontend can use the graph to get previous valid orders, which will include both txId and blockNo