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

iotaledger / iota / 25296832342
63%

Build:
DEFAULT BRANCH: develop
Ran 04 May 2026 02:30AM UTC
Jobs 1
Files 1213
Run time 2min
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

01 May 2026 11:47AM UTC coverage: 63.173% (-0.01%) from 63.186%
25296832342

push

github

web-flow
feat(iota-rest-kv): add object before version support (#11311)

# Description of change

Adds an optional `?before_version=<bool>` query parameter to the object
retrieval routes of `iota-rest-kv`. When `true`, the server returns the
highest stored object version **strictly less than** the version encoded
in the request key, instead of the exact-version match.

This unblocks callers that know the `ObjectID` but not the exact version
(e.g. resolving a past object state) from using the REST KV store.
Previously only exact-version lookups were possible.

### Implementation details

- **Query parameter over dedicated route.** The existing routes are
generic over `item_type` (`/{item_type}` and `/{item_type}/{key}`).
Adding a dedicated route for this one retrieval mode would introduce an
object-only special case in an otherwise uniform route table. Expressing
the mode as an optional query parameter keeps the routes generic and
makes the feature backward-compatible by default. This also aligns with
common REST guidance: the resource is the same (`/ob/{key}` or `/ob`),
only the retrieval mode changes, which is the canonical use case for a
query parameter rather than a new path.
- **Validation in a custom extractor.** A `BeforeVersionQuery` extractor
reads the flag and, when `true`, enforces that the item type is `ob`.
Everything else is rejected with `400 Bad Request` before the handler
runs. This keeps route handlers focused on business logic.
- **Supported routes.** Both `GET /{item_type}/{key}` and `POST
/{item_type}` accept the parameter. When absent it defaults to `false`,
so existing callers are unaffected.
- **Batch semantics.** The response is a BCS-serialized
`Vec<Option<Bytes>>` that preserves the order of the input `keys`.
`Some(bytes)` is the highest version strictly below the requested one;
`None` means not found.
- **Edge case.** `before_version=true` with a key at version 0 returns
`None`.
- **BigTable scan.** Implemented as a single reverse `r... (continued)

0 of 102 new or added lines in 3 files covered. (0.0%)

112 existing lines in 18 files now uncovered.

156077 of 247061 relevant lines covered (63.17%)

459440.44 hits per line

Uncovered Changes

Lines Coverage ∆ File
95
0.0
0.0% crates/iota-rest-kv/src/bigtable.rs
4
0.0
0.0% crates/iota-rest-kv/src/routes/kv_store.rs
3
0.0
0.0% crates/iota-rest-kv/src/errors.rs

Coverage Regressions

Lines Coverage ∆ File
42
0.0
0.0% crates/iota-rest-kv/src/bigtable.rs
11
0.0
0.0% crates/iota-rest-kv/src/routes/kv_store.rs
11
94.03
-0.48% crates/starfish/core/src/authority_service.rs
9
91.68
-0.44% crates/starfish/core/src/header_synchronizer.rs
6
74.53
-0.87% crates/iota-network/src/randomness/mod.rs
5
85.59
-2.25% crates/starfish/core/src/leader_timeout.rs
4
91.13
-0.28% crates/iota-core/src/execution_cache/writeback_cache.rs
4
78.92
-0.98% crates/iota-core/src/storage.rs
4
0.0
0.0% crates/iota-rest-kv/src/errors.rs
3
89.0
-1.03% crates/iota-core/src/connection_monitor.rs
3
94.72
-0.33% crates/starfish/core/src/block_header.rs
2
91.56
-0.05% crates/iota-core/src/authority/authority_per_epoch_store.rs
2
81.33
-0.06% crates/iota-core/src/authority.rs
2
90.82
0.42% crates/iota-core/src/epoch/randomness.rs
1
77.47
-0.07% crates/iota-core/src/checkpoints/mod.rs
1
98.62
-0.28% crates/iota-core/src/signature_verifier.rs
1
80.0
-0.31% crates/starfish/core/src/core_thread.rs
1
76.24
-0.1% crates/test-cluster/src/lib.rs
Jobs
ID Job ID Ran Files Coverage
1 nextest+simtest - 25296832342.1 04 May 2026 02:30AM UTC 1213
63.17
GitHub Action Run
Source Files on build 25296832342
  • Tree
  • List 1213
  • Changed 23
  • Source Changed 0
  • Coverage Changed 23
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #25296832342
  • 02f07149 on github
  • Prev Build on develop (#25266790007)
  • Next Build on develop (#25353133712)
  • Delete
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