wharfkit / session

Create account-based sessions, perform transactions, and allow users to login using Antelope-based blockchains.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Advanced ABI Caches

aaroncox opened this issue · comments

Implement intelligent long term ABI caching, both natively and through Robo V2.

  • Native we can use get_raw_abi instead of get_abi, and then create a permanent cache of that ABI stored by its hash. In future requests, when we see a cache entry, the client can make a quick call to get_code_hash to compare the local hash with the remote hash, determining whether the cache should be replaced. IndexedDB or CacheStorage could be used to hold these records in the client long term.
  • Robo v2 availability would allow us to redirect requests for ABIs (e.g. get_abi/[contract_name]) to caches that have Cache-Control: immutable in the headers, allowing the browser to just perform the caching for us.

Internal discussion: https://greymass.slack.com/archives/C045MUS6F0F/p1676444342156639