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

iotaledger / iota / 25240479648
63%

Build:
DEFAULT BRANCH: develop
Ran 02 May 2026 02:29AM 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% (+0.06%) from 63.13%
25240479648

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

850 existing lines in 38 files now uncovered.

156107 of 247061 relevant lines covered (63.19%)

454495.93 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
258
38.74
7.45% crates/iota-types/src/iota_sdk_types_conversions.rs
170
59.08
-1.14% crates/iota-json-rpc-types/src/iota_transaction.rs
81
2.08
0.0% crates/iota-graphql-rpc/src/types/transaction_block_effects.rs
48
0.0
0.0% crates/iota-core/src/generate_format.rs
45
92.91
-0.01% iota-execution/latest/iota-adapter/src/programmable_transactions/context.rs
34
83.95
-0.05% crates/iota-transactional-test-runner/src/test_adapter.rs
31
93.77
-0.26% crates/iota-core/src/congestion_tracker.rs
24
93.35
0.01% iota-execution/latest/iota-adapter/src/programmable_transactions/execution.rs
16
52.66
-1.15% crates/iota-json-rpc-types/src/iota_object.rs
15
87.57
-1.88% crates/iota-test-transaction-builder/src/lib.rs
12
72.22
-12.5% crates/iota-config/src/transaction_deny_config.rs
11
76.34
1.07% crates/test-cluster/src/lib.rs
10
80.93
2.58% crates/iota-grpc-client/src/api/ledger/checkpoints.rs
8
51.88
0.0% crates/iota-sdk/src/apis/read.rs
7
93.54
-0.48% crates/starfish/core/src/transactions_synchronizer.rs
6
81.39
-0.19% crates/iota-core/src/authority.rs
6
78.32
-2.1% crates/iota-sdk/src/lib.rs
6
80.6
-0.09% crates/iota-types/src/transaction.rs
5
55.77
-9.62% crates/iota-json-rpc-types/src/iota_coin.rs
5
89.34
-4.1% crates/iota-transaction-builder/src/package.rs
5
89.47
0.38% iota-execution/latest/iota-adapter/src/error.rs
4
70.02
-0.32% crates/iota-core/src/authority/authority_store.rs
4
80.68
-0.47% crates/iota-core/src/authority_server.rs
4
63.48
-3.48% crates/iota-grpc-types/src/proto/generated/iota.grpc.v1.state_service.accessors.rs
4
26.76
11.27% crates/iota-grpc-types/src/proto/iota/grpc/v1/transaction_execution_service.rs
4
83.57
-0.62% crates/iota-types/src/base_types.rs
3
82.35
-8.82% crates/iota-genesis-builder/src/stardust/types/output_header.rs
3
78.11
-1.78% crates/iota-grpc-client/src/api/common.rs
3
13.56
-5.08% crates/iota-grpc-client/src/api/mod.rs
3
24.14
-2.59% crates/iota-json-rpc-types/src/iota_checkpoint.rs
3
65.89
-0.63% crates/iota-types/src/storage/shared_in_memory_store.rs
3
95.19
-2.88% crates/starfish/config/src/committee.rs
3
84.21
-3.16% crates/starfish/config/src/crypto.rs
2
0.0
0.0% crates/iota-rest-kv/src/bigtable.rs
1
86.11
0.0% crates/iota-cluster-test/src/test_case/native_transfer_test.rs
1
0.0
0.0% crates/iota-rest-kv/src/routes/kv_store.rs
1
79.56
-0.12% crates/iota-types/src/crypto.rs
1
89.09
0.11% crates/starfish/core/src/commit_syncer/fast.rs
Jobs
ID Job ID Ran Files Coverage
1 nextest+simtest - 25240479648.1 02 May 2026 02:29AM UTC 1213
63.19
GitHub Action Run
Source Files on build 25240479648
  • Tree
  • List 1213
  • Changed 79
  • Source Changed 29
  • Coverage Changed 63
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #25240479648
  • 02f07149 on github
  • Prev Build on develop (#25198063136)
  • Next Build on develop (#25266790007)
  • 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