exactly / mobile

🔜
https://exactly.app
4 stars 0 forks source link

Previewer exactly function is failing sometimes #202

Open nfmelendez opened 5 hours ago

nfmelendez commented 5 hours ago

The previewer is being used in api/activity and hooks/activity and sometimes fails with "Execution reverted for an unknown reason". The problem started 21/11/2024 at 17:00 UTC.

We contacted alchemy the friday 22/11 and they said

Hey @nfmelendez , confirming that we are able to sporadically reproduce the error. We are actively working on this but for the time being would you be able to simply retry the request as a temporary workaround?

So after alchemy fixed it the problem was reduced, also we added a retry that reduced the problem ocurrence but still we are getting it.

nfmelendez commented 5 hours ago

The script should reproduce at a block number but unfourtunately we couldn't

// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import { Previewer } from "@exactly/protocol/periphery/Previewer.sol";

import { BaseScript } from "./Base.s.sol";

contract DebugScript is BaseScript {
  function run() external {
    vm.createSelectFork("optimism", 128_326_874);

    Previewer(protocol("Previewer")).exactly(address(0));
  }
}
nfmelendez commented 2 hours ago

hooks/activity uses exactly(address) function just create a map with key= market asset and value = market address

api/activity uses exactly(address) function to create a map with key= market address and value = the complete market object but actually is uses few fields:

  1. decimals
  2. symbol
  3. usdPrice

In Conclusion the minimum data we need from each market is: