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

Neptune-Crypto / neptune-core / 15729154281
75%

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

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

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>

171 of 209 new or added lines in 15 files covered. (81.82%)

1 existing line in 1 file now uncovered.

20266 of 28190 relevant lines covered (71.89%)

501755.62 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
92.3
0.07% src/models/state/archival_state.rs
1
87.92
0.01% src/models/state/wallet/wallet_state.rs
3
30.91
-1.78% src/models/state/block_proposal.rs
3
67.24
0.41% src/rpc_server.rs
4
61.18
0.27% src/main_loop.rs
13
81.0
-0.43% src/models/state/mod.rs
13
66.55
-0.08% src/peer_loop.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
81.0
-0.43% src/models/state/mod.rs
Jobs
ID Job ID Ran Files Coverage
1 15729154281.1 18 Jun 2025 02:37PM UTC 208
71.89
GitHub Action Run
Source Files on build 15729154281
  • Tree
  • List 208
  • Changed 20
  • Source Changed 17
  • Coverage Changed 16
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #15729154281
  • 580610b7 on github
  • Prev Build on master (#15727091478)
  • Next Build on master (#15757261687)
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