Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve gas cost of hint recovery when inserting into the end of…
… SortedTroves When trying to create a new Trove that has a lower ICR than the current lowest ICR (i.e. inserting into the tail of the list), `findInsertPosition()` returns `(addressOfLowestICRTrove, address(0))`. If we blindly pass these as hints to `openTrove()` but the transaction ends up pending for so long that the backend needs to look for a new insert position, we start the traversal in the wrong direction (from the wrong end of the list), and end up having to traverse over almost the entire list. Work around this by replacing the zero address with the other hint. Workaround for #600.
- Loading branch information