• Joshua Gutow's avatar
    op-node: Simplify Receipts Fetching API (#3639) · c3afadb1
    Joshua Gutow authored
    * op-node: Simplify Receipts Fetching API
    
    The previous API would return a receipts fetcher that the caller
    was responsible for iterating through and then calling `Result` on.
    This moves this inside the `Fetch` function. This simplifies usage
    of the API and does not result in performance regression because
    the receipts hash check requires all receipts to be fetched before
    
    * Cache receipts fetcher rather than receipts
    
    This modifies the refactor to be equivalent to the previous code.
    Caching the receipts fetcher is actually critical for performance
    because the fetcher caches intermediate results. The fetcher typically
    makes lots of calls to fetch all the receipts so if all work is thrown
    out on a single failure it will be very hard for the node to make progress.
    
    * Rename Fetch -> FetchReceipts
    c3afadb1
mock_eth_client.go 5.13 KB