• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

safe-global / safe-decoder-service / 45824558460
93%

Build:
DEFAULT BRANCH: main
Ran 26 Nov 2026 12:59PM UTC
Jobs 1
Files 69
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

26 Nov 2026 12:57PM UTC coverage: 92.925% (+0.009%) from 92.916%
45824558460

push

github

web-flow
Expire the per-contract ABI cache of the data decoder (#413)

* Expire the per-contract ABI cache of the data decoder

The per-contract ABI lookups were cached in memory with no expiry. When
a contract was decoded before its ABI was downloaded, the "no ABI" result
stayed cached, and the decoder kept reporting ONLY_FUNCTION_MATCH until
the web process restarted. A changed ABI had the same problem.

Contracts are written by the taskiq worker and the CLI, other processes,
and by the admin of any web pod, so the cache of each web process cannot
be invalidated from there. Entries now expire after 10 minutes.

The two caches (get_contract_abi and
get_contract_abi_selectors_with_functions) are replaced by one cached
get_contract_abi_match, used by decoding and by get_decoding_accuracy.
With two caches expiring at different times, a response could decode with
the contract ABI and still report ONLY_FUNCTION_MATCH for the whole TTL,
and stacked caches could serve an old ABI for twice the TTL.

Closes PLA-2474

* Make the contract ABI cache lifetime a setting

Add DECODER_CONTRACT_ABI_CACHE_SECONDS (default 600) next to the other
decoder settings, instead of a class constant.

* Clear the contract ABI cache when new ABIs are loaded

load_new_abis runs in the web process, at most every
DECODER_ABI_RELOAD_SECONDS. When it reads new ABI rows it now clears the
per-contract ABI cache, so a contract decoded before its ABI was
downloaded gets FULL_MATCH within that interval instead of waiting for
the cache TTL. It clears on any new row, not only when new selectors are
added, since a new ABI can reuse known selectors.

A contract linked to an ABI that was already stored adds no row, so it
still waits for the TTL.

* Build contract ABI selectors outside the database scope

get_decoding_accuracy wrapped the cached get_contract_abi_match in a
session scope, so on a cache miss it held a pool connection while the
selectors of the contract ABI were built in a thread. get_cont... (continued)

20 of 20 new or added lines in 2 files covered. (100.0%)

1471 of 1583 relevant lines covered (92.92%)

0.93 hits per line

Jobs
ID Job ID Ran Files Coverage
1 45824558460.1 26 Nov 2026 12:59PM UTC 69
92.92
GitHub Action Run
Source Files on build 45824558460
  • Tree
  • List 69
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 61a11811 on github
  • Prev Build on main (#45820208663)
  • Next Build on main (#45978074640)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc