lambdaclass / lambdaclass/ethlambda

Store swallows DB errors with `.expect()`, propagate Result through storage layer

Open
#306 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
Dominant language
Rust
Stars
82
Forks
28
Avg merge
1d 20h
Merged PRs (30d)
20

Description

crates/storage/src/store.rs calls StorageBackend methods (begin_read, begin_write, put_batch, commit, etc.) but swallows all returned Results via .expect() at 50+ call sites. Any DB error (disk full, corruption, etc.) panics the node instead of being handled gracefully.

The fix is to make Store's public methods return Result<T, Error> and propagate with ?, then update callers in crates/blockchain/src/store.rs accordingly.

Related: #82

Fixing this is also a prerequisite for #266. Without it, the "too many open files" error panics the node rather than being returned as a recoverable error.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in crates/storage/src/store.rs by reviewing the Store public methods and the StorageBackend calls that currently use .expect(), then trace their callers in crates/blockchain/src/store.rs. Done means DB errors are returned through the storage and blockchain store layers as Result values rather than causing panics.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
blockchain, distributed-systems
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.