BuildOnViction/tomochain-v1

Cache tradingfee by epoch

thanhson1085 opened this issue · 2 comments

Currently, when process txmatch, we read trading fee from the state (smart contact)
Issue: low performance, relayer owner can change trading frequently

To optimized it, we should cache trading fee by epoch.
So the flow will be:

  • get current epoch number
  • query trading fee by epoch number, if nil, read from state, store to cache by epoch number key

please help to cache valid relayer list by epoch as well

The fee is validated in Relayer Smart Contract. We do not need to cache it