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

spesmilo / electrum / 5737960454225920
63%

Build:
DEFAULT BRANCH: master
Ran 05 Apr 2025 02:36AM 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
5737960454225920

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%)

1 existing line in 1 file 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
Jobs
ID Job ID Ran Files Coverage
1 5737960454225920.1 05 Apr 2025 02:36AM UTC 81
60.96
2 5737960454225920.2 05 Apr 2025 02:36AM UTC 81
60.95
3 5737960454225920.3 05 Apr 2025 02:36AM UTC 81
60.97
4 5737960454225920.4 05 Apr 2025 02:37AM UTC 81
60.96
5 5737960454225920.5 05 Apr 2025 02:49AM UTC 81
60.95
Source Files on build 5737960454225920
  • Tree
  • List 81
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Build #57379604...
  • f429af7d on github
  • Prev Build on master (#57969929...)
  • Next Build on master (#60726142...)
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