Skip to content

Use get_pinned for getting data from rocksdb#629

Merged
3 commits merged into
mainfrom
eh2406/get_pined
Jan 9, 2026
Merged

Use get_pinned for getting data from rocksdb#629
3 commits merged into
mainfrom
eh2406/get_pined

Conversation

@Eh2406

@Eh2406 Eh2406 commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

(This is a resubmit of #625, to see if CI will pass from a branch in this repo.)

A large number of short lived allocations come from copying data out of rocksdb. The get and iterator_opt methods copy the data out of the database into a temporary Vec | Box so that the Rust code can choose to keep the data as long as it wants. In our case, we immediately decode the data into more specific types, and then drop the Vec | Box. So it would be more efficient for us to generate the specific types directly from the underlying buffer held by the database.

The get can be replaced with a get_pinned. This requires changes in a number of places, but they're pretty mechanical.

Unfortunately, there is no standard idiom for a iterator whose items can only be used until the next item is generated. The general problem is known as "lending iterator" and was one of the known limitations when Rust 1.0 was released. Rocksdb sorts this out by providing a raw interface to its iterators. We can write our own loop to read the raw data out of the database and convert it to our specific type. Once we've done that conversion we no longer have a lending problem and can construct a custom iterator type. std::iter::from_fn massively reduces the boilerplate.

These kinds of short lived allocations sometimes anger allocators. This one was particularly suspicious because it occurred at the same time as the construction of the big votes container disgust in the #594. Having now made the these changes and tested the result, no connection. These changes do not make a measurable difference to peak memory usage or throughput. :-( It does massively reduce the number of allocations and thereby the overhead of using memory profiling tools.

Summary by CodeRabbit

  • Refactor
    • Optimized data retrieval mechanisms in storage layer to improve memory efficiency by reducing unnecessary allocations.
    • Simplified API signatures across data access functions for cleaner interfaces.
    • Updated internal database access patterns for better performance.

✏️ Tip: You can customize this high-level summary in your review settings.

Eh2406 added 3 commits January 5, 2026 17:38
Signed-off-by: Jacob Finkelman <YeomanYaacov@gmail.com>
Signed-off-by: Jacob Finkelman <YeomanYaacov@gmail.com>
Signed-off-by: Jacob Finkelman <YeomanYaacov@gmail.com>
@coderabbitai

coderabbitai Bot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

G'day! This PR's a cracking optimization effort, mate. The changes swap owned Vec<u8> allocations for borrowed slices and RocksDB's pinned slices across the ledger store layer. The unsafe_decode helper now takes &[u8] instead of consuming values, database reads use get_pinned instead of get, and the iter function ditches the Direction parameter. Pure memory efficiency gains without altering control flow.

Changes

Cohort / File(s) Summary
Core decode update
crates/amaru-ledger/src/store/columns/mod.rs
Modified unsafe_decode to accept &[u8] instead of owned Vec<u8>, eliminating unnecessary allocations at the decoding boundary.
Account & delegation operations
crates/amaru-stores/src/rocksdb/ledger/columns/accounts.rs
Switched from get() to get_pinned(), introduced DBPinnableSlice<'a> type with lifetime parameter in the public get signature, and updated all decode paths to accept borrowed references.
Credential column access
crates/amaru-stores/src/rocksdb/ledger/columns/cc_members.rs
Replaced get() with get_pinned() and adjusted decoding closure to pass reference to unsafe_decode. Public signature unchanged.
DRep & delegation operations
crates/amaru-stores/src/rocksdb/ledger/columns/dreps.rs, dreps_delegations.rs
Switched to get_pinned() across get, add, set_valid_until, remove; adjusted decode calls to borrow data. dreps_delegations also removed unnecessary to_vec() allocation.
Pool & pot data access
crates/amaru-stores/src/rocksdb/ledger/columns/pools.rs, pots.rs
Updated public get signatures to use DBPinnableSlice<'a> with lifetime parameter; decode paths now accept borrowed slices instead of owned Vecs.
Slot & UTXO retrieval
crates/amaru-stores/src/rocksdb/ledger/columns/slots.rs, utxo.rs
Replaced get() with get_pinned() and updated decoding to borrow data; utxo.rs also added lifetime parameter to public get signature.
Iterator & core store logic
crates/amaru-stores/src/rocksdb/mod.rs
Removed Direction parameter from public iter function (now constructs Forward internally), switched high-frequency reads to get_pinned, and updated all internal call sites.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • pgrange
  • abailly
  • jeluard

Poem

🎯 No more Vec allocations clogging the pipes,
Pinned slices glide through RocksDB delights,
Borrowed references keep memory tight,
Direction's removed—forward's pure flight, 🚀
Like deleting bloat from a video game's sprite!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main objective of the PR—replacing RocksDB's get with get_pinned to avoid allocations—and aligns with the substantial changes across multiple files.
Docstring Coverage ✅ Passed Docstring coverage is 91.67% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8f11305 and 8c57a74.

📒 Files selected for processing (10)
  • crates/amaru-ledger/src/store/columns/mod.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/accounts.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/cc_members.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/dreps.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/dreps_delegations.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/pools.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/pots.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/slots.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/utxo.rs
  • crates/amaru-stores/src/rocksdb/mod.rs
🧰 Additional context used
🧠 Learnings (7)
📚 Learning: 2025-08-20T13:02:25.763Z
Learnt from: jeluard
Repo: pragma-org/amaru PR: 387
File: crates/amaru-stores/src/lib.rs:40-40
Timestamp: 2025-08-20T13:02:25.763Z
Learning: In the amaru-stores crate, amaru_slot_arithmetic types like Epoch and EraHistory are used throughout the main crate code in modules like in_memory/mod.rs, rocksdb/consensus.rs, and rocksdb/ledger/columns/, not just in tests. This means amaru-slot-arithmetic should be a regular dependency, not a dev-dependency.

Applied to files:

  • crates/amaru-stores/src/rocksdb/ledger/columns/dreps.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/pots.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/accounts.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/dreps_delegations.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/slots.rs
  • crates/amaru-stores/src/rocksdb/mod.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/pools.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/utxo.rs
📚 Learning: 2025-05-21T18:58:48.631Z
Learnt from: abailly
Repo: pragma-org/amaru PR: 228
File: crates/amaru-stores/src/rocksdb/consensus.rs:89-128
Timestamp: 2025-05-21T18:58:48.631Z
Learning: The InMemConsensusStore implementation in crates/amaru-stores/src/rocksdb/consensus.rs will be fleshed out incrementally on a by-need basis, driven by test requirements rather than implementing all functionality upfront.

Applied to files:

  • crates/amaru-stores/src/rocksdb/ledger/columns/dreps.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/accounts.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/cc_members.rs
📚 Learning: 2025-12-16T21:32:37.668Z
Learnt from: rkuhn
Repo: pragma-org/amaru PR: 584
File: crates/amaru-network/src/handshake/tests.rs:40-47
Timestamp: 2025-12-16T21:32:37.668Z
Learning: In Rust, shadowing a binding with a new let does not drop the previous binding until the end of the scope. All shadowed bindings in a scope are dropped in reverse-declaration order when the scope ends. Therefore, multiple let _guard = register_*() calls will keep all guards alive until the end of the function (or the surrounding scope). When reviewing code, be mindful that resources tied to shadowed bindings persist longer than the most recent binding; to release early, constrain the lifetime in an inner block or explicitly drop guards when appropriate.

Applied to files:

  • crates/amaru-stores/src/rocksdb/ledger/columns/dreps.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/pots.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/accounts.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/dreps_delegations.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/cc_members.rs
  • crates/amaru-ledger/src/store/columns/mod.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/slots.rs
  • crates/amaru-stores/src/rocksdb/mod.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/pools.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/utxo.rs
📚 Learning: 2025-09-06T09:16:25.025Z
Learnt from: abailly
Repo: pragma-org/amaru PR: 435
File: crates/amaru/src/bin/amaru/cmd/convert_ledger_state.rs:113-116
Timestamp: 2025-09-06T09:16:25.025Z
Learning: In cardano-node serialized ledger state CBOR encoding, indefinite-length structures may be terminated with 0xFF "break" markers. The current code in convert_ledger_state.rs unconditionally strips the last byte (bytes[p..bytes.len() - 1]), which could corrupt data if the trailing byte is not actually a CBOR break marker.

Applied to files:

  • crates/amaru-stores/src/rocksdb/ledger/columns/accounts.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/dreps_delegations.rs
  • crates/amaru-ledger/src/store/columns/mod.rs
📚 Learning: 2025-08-08T14:46:53.013Z
Learnt from: KtorZ
Repo: pragma-org/amaru PR: 370
File: crates/amaru-kernel/src/pool_params.rs:107-116
Timestamp: 2025-08-08T14:46:53.013Z
Learning: In crates/amaru-kernel/src/pool_params.rs, when serializing Relay::SingleHostAddr IPv6 to text, the project intentionally reverses each 4-byte chunk before constructing std::net::Ipv6Addr. This matches cardano-ledger’s IPv6 representation (four little-endian Word32 chunks). Do not “simplify” by passing the raw 16 bytes directly to Ipv6Addr::from; that would break ledger compatibility.

Applied to files:

  • crates/amaru-stores/src/rocksdb/ledger/columns/dreps_delegations.rs
  • crates/amaru-ledger/src/store/columns/mod.rs
  • crates/amaru-stores/src/rocksdb/ledger/columns/pools.rs
📚 Learning: 2025-08-08T14:35:35.562Z
Learnt from: KtorZ
Repo: pragma-org/amaru PR: 370
File: crates/amaru-kernel/src/transaction_pointer.rs:36-44
Timestamp: 2025-08-08T14:35:35.562Z
Learning: In the amaru project, when decoding CBOR arrays, prefer using minicbor_extra::heterogenous_array with the expected length to validate definite-length arrays and correctly handle indefinite-length arrays. Example: crates/amaru-kernel/src/transaction_pointer.rs Decode should use heterogenous_array(d, 2, …) instead of ignoring the length from d.array().

Applied to files:

  • crates/amaru-stores/src/rocksdb/ledger/columns/dreps_delegations.rs
  • crates/amaru-ledger/src/store/columns/mod.rs
📚 Learning: 2025-06-03T06:31:57.736Z
Learnt from: stevana
Repo: pragma-org/amaru PR: 236
File: simulation/amaru-sim/src/simulator/generate.rs:141-145
Timestamp: 2025-06-03T06:31:57.736Z
Learning: In the amaru project, the team prefers to use as_bytes() instead of hex::decode() for converting hash and header strings to bytes in simulation/amaru-sim/src/simulator/generate.rs, even though they appear to be hex-encoded strings.

Applied to files:

  • crates/amaru-ledger/src/store/columns/mod.rs
🧬 Code graph analysis (6)
crates/amaru-stores/src/rocksdb/ledger/columns/pots.rs (6)
crates/amaru-stores/src/rocksdb/mod.rs (2)
  • get (957-969)
  • StoreError (954-954)
crates/amaru-stores/src/rocksdb/ledger/columns/accounts.rs (1)
  • get (224-233)
crates/amaru-stores/src/rocksdb/ledger/columns/dreps.rs (1)
  • get (39-48)
crates/amaru-stores/src/rocksdb/ledger/columns/pools.rs (1)
  • get (30-38)
crates/amaru-stores/src/rocksdb/ledger/columns/slots.rs (1)
  • get (28-36)
crates/amaru-stores/src/rocksdb/ledger/columns/utxo.rs (1)
  • get (27-43)
crates/amaru-stores/src/rocksdb/ledger/columns/accounts.rs (7)
crates/amaru-stores/src/rocksdb/mod.rs (2)
  • StoreError (954-954)
  • get (957-969)
crates/amaru-stores/src/rocksdb/ledger/columns/dreps.rs (1)
  • get (39-48)
crates/amaru-stores/src/rocksdb/ledger/columns/pools.rs (1)
  • get (30-38)
crates/amaru-stores/src/rocksdb/ledger/columns/pots.rs (1)
  • get (25-33)
crates/amaru-stores/src/rocksdb/ledger/columns/slots.rs (1)
  • get (28-36)
crates/amaru-stores/src/rocksdb/ledger/columns/utxo.rs (1)
  • get (27-43)
crates/amaru-stores/src/rocksdb/common.rs (1)
  • as_key (25-27)
crates/amaru-ledger/src/store/columns/mod.rs (7)
crates/amaru-stores/src/rocksdb/ledger/columns/accounts.rs (5)
  • unsafe_decode (56-56)
  • unsafe_decode (140-140)
  • unsafe_decode (206-206)
  • unsafe_decode (232-232)
  • unsafe_decode (247-247)
crates/amaru-stores/src/rocksdb/ledger/columns/cc_members.rs (1)
  • unsafe_decode (35-35)
crates/amaru-stores/src/rocksdb/ledger/columns/dreps.rs (4)
  • unsafe_decode (47-47)
  • unsafe_decode (70-70)
  • unsafe_decode (141-141)
  • unsafe_decode (184-184)
crates/amaru-stores/src/rocksdb/ledger/columns/dreps_delegations.rs (1)
  • unsafe_decode (194-194)
crates/amaru-stores/src/rocksdb/ledger/columns/pools.rs (1)
  • unsafe_decode (37-37)
crates/amaru-stores/src/rocksdb/ledger/columns/pots.rs (1)
  • unsafe_decode (31-31)
crates/amaru-ledger/src/store/columns/slots.rs (1)
  • decode (51-54)
crates/amaru-stores/src/rocksdb/ledger/columns/slots.rs (1)
crates/amaru-stores/src/rocksdb/common.rs (1)
  • as_key (25-27)
crates/amaru-stores/src/rocksdb/mod.rs (3)
crates/amaru-stores/src/rocksdb/ledger/columns/accounts.rs (1)
  • get (224-233)
crates/amaru-stores/src/rocksdb/ledger/columns/pots.rs (1)
  • get (25-33)
crates/amaru-stores/src/rocksdb/ledger/columns/utxo.rs (1)
  • get (27-43)
crates/amaru-stores/src/rocksdb/ledger/columns/pools.rs (6)
crates/amaru-stores/src/rocksdb/mod.rs (2)
  • get (957-969)
  • StoreError (954-954)
crates/amaru-stores/src/rocksdb/ledger/columns/accounts.rs (1)
  • get (224-233)
crates/amaru-stores/src/rocksdb/ledger/columns/dreps.rs (1)
  • get (39-48)
crates/amaru-stores/src/rocksdb/ledger/columns/pots.rs (1)
  • get (25-33)
crates/amaru-stores/src/rocksdb/ledger/columns/slots.rs (1)
  • get (28-36)
crates/amaru-stores/src/rocksdb/common.rs (1)
  • as_key (25-27)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Build x86_64/linux
  • GitHub Check: Build x86_64/windows
  • GitHub Check: Build wasm32
  • GitHub Check: Build aarch64/macos
  • GitHub Check: Test coverage
  • GitHub Check: Benches
  • GitHub Check: clippy
  • GitHub Check: Analyze (rust)
🔇 Additional comments (19)
crates/amaru-stores/src/rocksdb/ledger/columns/dreps_delegations.rs (1)

194-194: Ripper of an optimization, mate!

Cutting out the .to_vec() allocation here is a proper win for memory efficiency. By passing the borrowed slice directly to unsafe_decode, you're avoiding a heap allocation on every iteration—nice and lean, like a well-optimized game engine. The lifetime's all good too since key sticks around in the result tuple.

crates/amaru-stores/src/rocksdb/ledger/columns/slots.rs (1)

28-36: Ripper optimization, mate! This change looks ace.

Swapping get for get_pinned and borrowing the slice (&d) instead of consuming it is textbook zero-copy optimization. Like upgrading from a GameCube to a Switch — same game, way smoother experience under the hood! The pinned slice avoids the intermediate Vec<u8> allocation, and since DBPinnableSlice derefs to &[u8], passing &d to unsafe_decode works perfectly with its signature: unsafe_decode<T>(bytes: &[u8]) -> T.

The error handling stays intact, and the public API signature doesn't change. Beautiful mechanical refactor that lines up with the broader PR migration strategy.

crates/amaru-ledger/src/store/columns/mod.rs (1)

28-37: Solid refactor, mate! Like upgrading from a rusty old ute to a proper EV.

This signature change from Vec<u8> to &[u8] is the linchpin of the whole PR – enabling zero-copy decoding directly from RocksDB's pinned buffers. The cbor::decode and hex::encode both handle slices gracefully, so this is a clean, mechanical update. Nice one!

crates/amaru-stores/src/rocksdb/ledger/columns/cc_members.rs (1)

32-35: Clean transition to pinned reads – like Neo dodging bullets in The Matrix!

The switch from get to get_pinned with the borrowing decode pattern .map(|d| unsafe_decode::<Row>(&d)) is spot on. The pinned slice stays valid through the decode, and we get an owned Row out the other side. No allocations wasted, no lifetimes violated. Crikey, that's efficient!

crates/amaru-stores/src/rocksdb/ledger/columns/dreps.rs (1)

44-47: Consistent pinned-slice pattern across all DRep operations – you legend!

All four call sites (get, add, set_valid_until, remove) now use the same get_pinned + borrowed decode pattern. It's like finding all the collectibles in a Souls game – thorough and methodical. The lifetime handling is sound: the DBPinnableSlice lives just long enough for decoding, and the owned Row survives beyond.

crates/amaru-stores/src/rocksdb/ledger/columns/utxo.rs (1)

26-43: Callback-based retrieval with inline CBOR decode – fair dinkum!

The lifetime-parameterized db_get callback accepting DBPinnableSlice<'a> is consistent with the sister modules (pools.rs, pots.rs, accounts.rs). The inline cbor::decode with panic on failure mirrors the unsafe_decode helper's behaviour, just without the abstraction. Both approaches are valid for this codebase.

crates/amaru-stores/src/rocksdb/ledger/columns/pots.rs (1)

25-33: Pots getter upgraded to pinned-slice path – smooth as a pint of Guinness!

The db_get callback pattern with DBPinnableSlice<'a> is consistent with the other column modules. The .unwrap_or_default() fallback for missing pots data is preserved, which is the right call. No dramas here!

crates/amaru-stores/src/rocksdb/mod.rs (4)

985-1014: Raw iterator with from_fn – clever workaround for Rust's lending iterator limitation!

This is like finding the secret warp zone in Mario Bros. The pattern:

  1. Convert to DBRawIteratorWithThreadMode
  2. Use std::iter::from_fn to yield decoded values
  3. Call it.next() after extracting and decoding it.item()

This correctly handles the lending nature of RocksDB's raw iterator where item() returns borrowed refs that become invalid after next(). The decoded k and v are owned, so they safely outlive the iteration step. Top-tier Rust-fu!


947-968: get and get_or_bail helpers refactored for pinned slices – ripper work!

Both helper functions now accept a db_get callback returning DBPinnableSlice<'a>. The b.as_ref() call on line 966 correctly converts the pinned slice to &[u8] for CBOR decoding. Error handling via StoreError::Undecodable is preserved. Clean and consistent with the column-level changes.


427-470: All ReadStore trait methods now use pinned callbacks – consistency across the board!

Every get-based method in the impl_ReadStore_body! macro now uses the |key| self.db.get_pinned(key) pattern. This ensures the allocation reduction applies uniformly across tip, protocol_parameters, pool, account, utxo, and pots. Like assembling the Infinity Stones – all pieces in place!


971-989: Direction::Forward is baked in – but that's intentional, mate.

The concern about breaking reverse iteration doesn't actually apply here. None of the callers (and there's a fair few of 'em – iterate through accounts, UTXOs, slots, pools, the lot) ever request a specific direction. The function signature doesn't expose direction control anyway – callers just pass their db iterator closure and a prefix, and off we go. No one in the codebase has asked for Direction::Backward, ever. So this is just the API saying "we only do forward iteration," which is a perfectly valid design choice and not a breaking change.

crates/amaru-stores/src/rocksdb/ledger/columns/pools.rs (2)

30-38: get function upgraded to pinned-slice callback – looking sharp!

The signature change to accept impl Fn(&[u8]) -> Result<Option<DBPinnableSlice<'a>>, rocksdb::Error> is consistent with accounts.rs, pots.rs, and utxo.rs. The borrowed decode pattern .map(|d| unsafe_decode::<Row>(&d)) is spot on.


57-63: Row::extend() requires owned Vec, so db.get() is necessary here.

The Row::extend() method signature takes Vec<u8> by value (not by reference), which is why add() and remove() use db.get() instead of get_pinned(). Looking at the implementation, it does split_off() and concat() operations that require ownership of the buffer.

This is different from dreps.rs, which uses get_pinned() because it doesn't call Row::extend()—it decodes the bytes into a Row struct and mutates the fields directly instead.

So this is a deliberate design choice, not an oversight. That said, if performance matters, Row::extend() could potentially be refactored to accept &[u8] and return owned Vec, which would allow using the more efficient get_pinned() here too.

crates/amaru-stores/src/rocksdb/ledger/columns/accounts.rs (6)

33-33: Fair dinkum, mate! Import looks spot on.

The DBPinnableSlice import is necessary to support the pinned-slice pattern across the file. Clean addition alongside Transaction.


53-56: Like levelling up your inventory management in a souls-like – less junk, more efficiency!

The switch to get_pinned here is bang on. You're borrowing directly from RocksDB's buffer for the decode, then moving on with an owned Row. No unnecessary Vec<u8> middleman. This matches the pattern used in dreps.rs and the other column modules nicely.


137-140: Noice work, cobber!

Same mechanical swap as the others – get_pinned with reference-based decoding. The Row gets materialized before any subsequent mutations, so no dramas with the pinned slice's lifetime. Consistent with the broader refactor.


203-206: Same deal, same result – chef's kiss!

Mechanically identical to the other get_pinned swaps. The pattern's consistent throughout the file. You're getting that zero-copy goodness right up until the decode boundary.


224-232: Public API glow-up – looking sharp!

The signature change to accept DBPinnableSlice<'a> via the closure is consistent with pools.rs and pots.rs (per the relevant snippets). The lifetime parameter 'a ensures the pinned slice remains valid through the decode, and since Row is owned, callers get back a clean, self-contained result.

This is a breaking change for any external callers, but since the AI summary and related files show this is a coordinated update across the module, the call sites should already be aligned.


244-247: And the final boss falls! All get_pinned conversions are locked in.

This last swap in set rounds out the refactor. The read-modify-write cycle here is textbook: pin the slice, decode to owned Row, update rewards, write back. No allocation shenanigans, no worries.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jan 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.01370% with 27 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/amaru-stores/src/rocksdb/mod.rs 60.52% 15 Missing ⚠️
...maru-stores/src/rocksdb/ledger/columns/accounts.rs 63.63% 4 Missing ⚠️
...s/amaru-stores/src/rocksdb/ledger/columns/dreps.rs 50.00% 4 Missing ⚠️
...s/amaru-stores/src/rocksdb/ledger/columns/slots.rs 0.00% 2 Missing ⚠️
crates/amaru-ledger/src/store/columns/mod.rs 66.66% 1 Missing ⚠️
...es/src/rocksdb/ledger/columns/dreps_delegations.rs 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
...ru-stores/src/rocksdb/ledger/columns/cc_members.rs 100.00% <100.00%> (ø)
...s/amaru-stores/src/rocksdb/ledger/columns/pools.rs 95.00% <100.00%> (ø)
...es/amaru-stores/src/rocksdb/ledger/columns/pots.rs 100.00% <100.00%> (ø)
...es/amaru-stores/src/rocksdb/ledger/columns/utxo.rs 93.75% <100.00%> (ø)
crates/amaru-ledger/src/store/columns/mod.rs 50.00% <66.66%> (ø)
...es/src/rocksdb/ledger/columns/dreps_delegations.rs 45.79% <0.00%> (ø)
...s/amaru-stores/src/rocksdb/ledger/columns/slots.rs 30.76% <0.00%> (ø)
...maru-stores/src/rocksdb/ledger/columns/accounts.rs 66.66% <63.63%> (ø)
...s/amaru-stores/src/rocksdb/ledger/columns/dreps.rs 53.76% <50.00%> (ø)
crates/amaru-stores/src/rocksdb/mod.rs 73.59% <60.52%> (+0.26%) ⬆️

... and 50 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@KtorZ KtorZ left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for also fixing the iterator logic.

@KtorZ KtorZ closed this pull request by merging all changes into main in 6aae440 Jan 9, 2026
@KtorZ KtorZ deleted the eh2406/get_pined branch January 9, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants