You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Store an indexed array of smart pools in the pool registry at pool creation.
Motivation
RPC providers' endpoints do not provide historical logs on some L2s, claiming it would affect node performance. Therefore, in order to display pools on the interface, we provide an endpoint pools.rigoblock.com that returns the pools. Storing the in the registry state will allow retrieving all pools with one single RPC call.
Specification
store pools in an indexed mapping
mapping(uint256 => Pool) poolsByIndex
uint256 poolsLength
store new pool at position index in poolsByIndex mapping
upgrade registry used by protocol and staking proxy (requires onchain governance vote.
Rationale
The new pools are scraped regularly, but by storing the pools in the registry we could skip logs query and url list update entirely, at an additional 20k gas cost at pool creation, which is acceptable as pool cost creation is less than cost of making 2 onchain swaps.
Storing an indexed mapping and the pools' number allows for avoiding storing a big array, which is going to be expensive to update. Since pools are persistent, we will not find ourselves in a situation where the pool at index is empty, but even if it were it would not cause harm to a call.
Notes
It is still undecided whether this is something worth a registry upgrade.
The text was updated successfully, but these errors were encountered:
Summary
Store an indexed array of smart pools in the pool registry at pool creation.
Motivation
RPC providers' endpoints do not provide historical logs on some L2s, claiming it would affect node performance. Therefore, in order to display pools on the interface, we provide an endpoint pools.rigoblock.com that returns the pools. Storing the in the registry state will allow retrieving all pools with one single RPC call.
Specification
Rationale
The new pools are scraped regularly, but by storing the pools in the registry we could skip logs query and url list update entirely, at an additional 20k gas cost at pool creation, which is acceptable as pool cost creation is less than cost of making 2 onchain swaps.
Storing an indexed mapping and the pools' number allows for avoiding storing a big array, which is going to be expensive to update. Since pools are persistent, we will not find ourselves in a situation where the pool at index is empty, but even if it were it would not cause harm to a call.
Notes
It is still undecided whether this is something worth a registry upgrade.
The text was updated successfully, but these errors were encountered: