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

spesmilo / electrum / 5607893476573184
63%

Build:
DEFAULT BRANCH: master
Ran 04 Apr 2025 06:31PM UTC
Jobs 5
Files 81
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

04 Apr 2025 06:24PM UTC coverage: 60.997%. Remained the same
5607893476573184

push

CirrusCI

SomberNight
lnutil: cache validate_features() results

channel_db.load_data() is slow, slowing down startup time (when trampoline is disabled).
util.list_enabled_bits() is one of the main contributors to the slowness, called by validate_features().

One could argue that we could even simply *not* call validate_features for gossip messages as part of load_data,
as they have already been validated before storing them in the db. However re-validating them there is a good
clean-up/sanity check IMO. Note that what is considered "valid" can change over time, so just because validate_features
passed when we originally received and stored a gossip message, it might no longer be valid a year later if the bolts change.

This caching decreases the time needed for load_data on two different machines / gossip dbs as below:
47 sec -> 10 sec
18 sec -> 6 sec

If instead of caching, I just rm the validate_features() calls, the benchmarks are almost identical, within noise.
That is, the cache looks really effective.
(the rest of the slowness is mostly due to lnmsg.decode_msg)

```
>>> lnutil.validate_features.cache_info()
CacheInfo(hits=172674, misses=287, maxsize=1000, currsize=277)
```

-----

We could alternatively directly cache util.list_enabled_bits (instead of validate_features).
That would be a bit slower and might end up using a lot more memory in some cases I think, but maybe conceptually would be cleaner.
Also note that if validate_features() raises an exception, that is not cached.

2 of 2 new or added lines in 1 file covered. (100.0%)

5 existing lines in 3 files now uncovered.

21408 of 35097 relevant lines covered (61.0%)

3.05 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
68.4
-0.09% electrum/lnchannel.py
1
79.28
-0.06% electrum/lnutil.py
3
61.98
-0.22% electrum/util.py
Jobs
ID Job ID Ran Files Coverage
1 5607893476573184.1 04 Apr 2025 06:31PM UTC 81
60.98
2 5607893476573184.2 04 Apr 2025 06:32PM UTC 81
60.95
3 5607893476573184.3 04 Apr 2025 06:35PM UTC 81
60.95
4 5607893476573184.4 04 Apr 2025 06:35PM UTC 81
60.97
5 5607893476573184.5 04 Apr 2025 06:44PM UTC 81
60.95
Source Files on build 5607893476573184
  • Tree
  • List 81
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Build #56078934...
  • f429af7d on github
  • Prev Build on master (#57969929...)
  • Next Build on master (#57379604...)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc