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

iotaledger / iota / 25266790007
63%

Build:
DEFAULT BRANCH: develop
Ran 03 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.186%. Remained the same
25266790007

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%)

90 existing lines in 15 files now uncovered.

156108 of 247061 relevant lines covered (63.19%)

446089.72 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
6
79.9
-0.49% crates/iota-core/src/storage.rs
6
82.73
-5.45% crates/iota-surfer/src/surf_strategy.rs
6
87.84
-2.7% crates/starfish/core/src/leader_timeout.rs
5
90.4
-0.42% crates/iota-core/src/epoch/randomness.rs
4
0.0
0.0% crates/iota-rest-kv/src/errors.rs
2
88.89
-0.27% crates/iota-network/src/discovery/mod.rs
2
88.99
-0.11% crates/starfish/core/src/commit_syncer/fast.rs
1
91.61
0.05% crates/iota-core/src/authority/authority_per_epoch_store.rs
1
83.19
-0.1% crates/iota-json-rpc/src/read_api.rs
1
95.65
-4.35% crates/iota-keys/src/random_names.rs
1
79.44
-0.12% crates/iota-types/src/crypto.rs
1
96.42
-0.03% crates/starfish/core/src/dag_state.rs
1
92.12
0.2% crates/starfish/core/src/header_synchronizer.rs
Jobs
ID Job ID Ran Files Coverage
1 nextest+simtest - 25266790007.1 03 May 2026 02:30AM UTC 1213
63.19
GitHub Action Run
Source Files on build 25266790007
  • Tree
  • List 1213
  • Changed 16
  • Source Changed 0
  • Coverage Changed 16
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #25266790007
  • 02f07149 on github
  • Prev Build on develop (#25240479648)
  • Next Build on develop (#25296832342)
  • 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