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

Neptune-Crypto / neptune-core / 15729154281 / 1
75%
master: 75%

Build:
DEFAULT BRANCH: master
Ran 18 Jun 2025 02:37PM UTC
Files 208
Run time 7s
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

18 Jun 2025 09:29AM UTC coverage: 71.891% (+0.06%) from 71.831%
15729154281.1

push

github

web-flow
Gracefully catch errors resulting from invalid blocks (#611)

* refactor!: Wrap fallible guesser fee helper functions in `Result`

Function `Block::total_guesser_reward`, along with other helper
methods related to guesser fees, are undefined for un-validated
blocks, so the result should be wrapped in a `Result` in order to
avoid passing inconsistent values up the call graph. This change
cascades into many function return type modifications and many
`.unwrap`s and `.expect`s downstream.

The inconsistency was exposed by test
`rpc_server::rpc_server_tests::public_announcements_in_block_test`
which is now fixed instead of ignored. Thanks to @skaunov for PR #543
and the effort leading to this exposition.

Also:
 - Change logic for computing block proposal favorability: use
   `prev_block_digest` instead of block height. However, the old
   method (now suffixed with `_legacy`) continues to exist to
   enable unmodified processing of `PeerMessage`
   `BlockProposalNotification`, which comes with a block height and
   not a digest. (We cannot change `PeerMessage`, unfortunately.)
 - Rewrite handler for `PeerMessage` `BlockProposal`. Simplify and
   reduce indentation.


* chore: Gracefully catch errors resulting from invalid blocks

The peer loop should act as a robust firewall against invalid blocks.
Nevertheless, it is worth ensuring that handlers behind that firewall
cannot crash even for invalid blocks. This commit replaces
`.unwrap()`s and `.expect(..)`s with question marks, and wraps the
return type of some handlers in a `Result` where necessary.

Thanks to @skaunov for identifying the issues.

* docs(Block): Adjust a few error messages related to blocks


* docs: Adjust some error messages related to negative tx-fees in block

Adjust messages to avoid implying that blocks stored in state must be
valid, since that's not true for tests.


---------

Co-authored-by: Alan Szepieniec <alan@neptune.cash>
Co-authored-by: sword_smith <thor@neptune.cash>

20266 of 28190 relevant lines covered (71.89%)

501755.62 hits per line

Source Files on job 15729154281.1
  • Tree
  • List 208
  • Changed 20
  • Source Changed 17
  • Coverage Changed 16
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 15729154281
  • 580610b7 on github
  • Prev Job for on master (#15727091478.1)
  • Next Job for on master (#15757261687.1)
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