Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

TransferContext::get_escrow_account(): cache escrow account addresses #6

Closed
Tracked by #883 ...
plafer opened this issue Sep 22, 2023 · 0 comments · Fixed by #90
Closed
Tracked by #883 ...

TransferContext::get_escrow_account(): cache escrow account addresses #6

plafer opened this issue Sep 22, 2023 · 0 comments · Fixed by #90
Assignees
Labels
modules Related to ibc modules

Comments

@plafer
Copy link
Contributor

plafer commented Sep 22, 2023

We currently recompute the escrow account address from (PortId, ChannelId) pair on every call.

We should instead

  • Add a #[state] field in our module escrow_account_cache: sov_state::StateMap<(PortId, ChannelId), C::Address>
  • Lookup up escrow_account_cache; if value present return it. Otherwise, compute the escrow account address, store it in escrow_account_cache, and return it
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modules Related to ibc modules
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants