contractsV2 icon indicating copy to clipboard operation
contractsV2 copied to clipboard

Error calling getActiveLoansAdvanced() function

Open raulmonge opened this issue 3 years ago • 4 comments

Hello,

I recently notice that calling getActiveLoansAdvanced(from, to, true, true) it revert with the following reason

if I call this function untill reach 21 it doesnt fail, but when it pass 21 start with this error.

getActiveLoansAdvanced(0, 21, true, true) -> Works getActiveLoansAdvanced(0, 300, true, true) -> Fails

Error: cannot estimate gas; transaction may fail or may require manual gas limit (error={"code":-32000,"response":"{\"jsonrpc\":\"2.0\",\"id\":20,\"error\":{\"code\":-32000,\"message\":\"execution reverted\"}}\n"}, method="call", transaction={"from":"my address","to":"0xD8Ee69652E4e4838f2531732a46d1f7F584F0b7f","data":"0xc43b962f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012c00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001","accessList":null}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.4.3) at Logger.makeError (C:\Users\anon\bzx\node_modules\@ethersproject\logger\lib\index.js:187:21) at Logger.throwError (C:\Users\anon\bzx\node_modules\@ethersproject\logger\lib\index.js:196:20) at checkError (C:\Users\anon\bzx\node_modules\@ethersproject\providers\lib\json-rpc-provider.js:118:16) at WebSocketProvider.<anonymous> (C:\Users\anon\bzx\node_modules\@ethersproject\providers\lib\json-rpc-provider.js:633:47) at step (C:\Users\anon\bzx\node_modules\@ethersproject\providers\lib\json-rpc-provider.js:48:23) at Object.throw (C:\Users\anon\bzx\node_modules\@ethersproject\providers\lib\json-rpc-provider.js:29:53) at rejected (C:\Users\anon\bzx\node_modules\@ethersproject\providers\lib\json-rpc-provider.js:21:65) at processTicksAndRejections (internal/process/task_queues.js:97:5) { reason: 'cannot estimate gas; transaction may fail or may require manual gas limit', code: 'UNPREDICTABLE_GAS_LIMIT', error: Error: execution reverted at WebSocketProvider._this._websocket.onmessage (C:\Users\anon\bzx\node_modules\@ethersproject\providers\lib\websocket-provider.js:123:33) at WebSocket.onMessage (C:\Users\anon\bzx\node_modules\ws\lib\event-target.js:132:16) at WebSocket.emit (events.js:314:20) at Receiver.receiverOnMessage (C:\Users\anon\bzx\node_modules\ws\lib\websocket.js:834:20) at Receiver.emit (events.js:314:20) at Receiver.dataMessage (C:\Users\anon\bzx\node_modules\ws\lib\receiver.js:437:14) at Receiver.getData (C:\Users\anon\bzx\node_modules\ws\lib\receiver.js:367:17) at Receiver.startLoop (C:\Users\anon\bzx\node_modules\ws\lib\receiver.js:143:22) at Receiver._write (C:\Users\anon\bzx\node_modules\ws\lib\receiver.js:78:10) at doWrite (_stream_writable.js:403:12) { code: -32000, response: '{"jsonrpc":"2.0","id":20,"error":{"code":-32000,"message":"execution reverted"}}\n' }, method: 'call', transaction: { from: 'my address', to: '0xD8Ee69652E4e4838f2531732a46d1f7F584F0b7f', data: '0xc43b962f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012c00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001', accessList: null } }

Thank you for your time

raulmonge avatar Feb 03 '22 18:02 raulmonge

Hi @raulmonge thanks for reporting this. the issue is making a loop from 0 to 300 exceed block gas limit or free infura block gas limit. you can either run your node with unlimited gas or query 0-20, 20- 20, 40-20 and so on. also join our discord #dev channel I will be able to support you there

RomanHiden avatar Feb 10 '22 12:02 RomanHiden

btw. previosly this was working but cloud providers making this more and more strict to save on resources

RomanHiden avatar Feb 10 '22 12:02 RomanHiden

actually there is an issue with BZRX loan as collateral. when there is no collateral left. we plan to fix this

RomanHiden avatar Feb 10 '22 12:02 RomanHiden