blockcore-indexer icon indicating copy to clipboard operation
blockcore-indexer copied to clipboard

Solve the computation throttling attribute

Open dangershony opened this issue 2 years ago • 0 comments

Right now we use SlowRequestsFilteerAttribute to avoid many calls to tables that do potentially long running computations to avoid multiple updates of the same computation processes. This will correctly return a status code 202 to any caller.

https://github.com/block-core/blockcore-indexer/blob/master/src/Blockcore.Indexer.Core/Operations/SlowRequestsFilteerAttribute.cs

Two issues:

  • this decouples the logic form the computation service
  • it limits the calls to the endpoint to be 1 call per contract address (assuming its called form one endpoint.

We should be able to allow multiple calls to a certain endpoint and only if any computation is needed or in progress throttle additional calls (for example once computation was done from a given block height it wont happen again until a contract address is effected. The current assumption is that such operations will be fast and wont disrupt calls however that removes the ability to make parallel calls to the same contract address.

dangershony avatar Mar 29 '22 14:03 dangershony