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

iotaledger / iota / 35043580069
70%

Build:
DEFAULT BRANCH: develop
Ran 16 Sep 2026 02:13AM UTC
Jobs 1
Files 1100
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

15 Sep 2026 12:58PM UTC coverage: 69.98% (+0.006%) from 69.974%
35043580069

push

github

web-flow
feat(indexer): prune `optimistic_transactions` by optimistic sequence number (#12852)

# Description of change

This PR adds the following changes as the first stage of #12747:

- Adds a `first_optimistic_sequence_number` column to epochs (`NOT
NULL`), holding the first `optimistic_sequence_number` value belonging
to each epoch. Every optimistic sequence number assigned before the
epoch started is below the stored value, so it translates an epoch
retention boundary into a delete range for `optimistic_transactions`.
-New epoch rows are filled by a column default: the latest value
generated by the sequence behind
`tx_global_order.optimistic_sequence_number` + 1, or 0 if the sequence
was never used."
- Existing epochs are backfilled by the migration. Each epoch gets, in
order of preference:
- the lowest `optimistic_sequence_number` among rows indexed at or after
the epoch started
    (matched via their `global_sequence_number` stamps),
- the next value the sequence will assign, when no such row exists
(epochs newer than the
    last optimistic transaction),
  - 0, when no optimistic transaction was ever indexed.
- The migration also resets the `optimistic_transactions` watermark
bounds (`lowest_unpruned_key`, `min_available_tx`) to
`MIN(optimistic_sequence_number)`.
- Switches the `optimistic_transactions` pruning strategy to delete by
`optimistic_sequence_number` (its primary key), bounded by the new
column, instead of by `global_sequence_number`. Since the key is unique,
a range of width N holds at most N rows, so the previous DELETE ...
LIMIT loop is replaced by a plain ranged delete per chunk.

## Links to any relevant issues

fixes #12851 

## How the change has been tested

Ran indexer tests
```
cargo test -p iota-indexer --profile simulator --features shared_test_runtime
```
Manual testing:

- Localnet and indexer from develop without pruning. Once synced, I ran
5 optimistic txs and another 5 in a later epoch, stopped the indexer and
restarted it ... (continued)

0 of 55 new or added lines in 4 files covered. (0.0%)

2165 existing lines in 45 files now uncovered.

181196 of 258926 relevant lines covered (69.98%)

434629.74 hits per line

Uncovered Changes

Lines Coverage ∆ File
38
0.0
0.0% crates/iota-indexer/src/store/pg_indexer_store.rs
9
0.0
0.0% crates/iota-indexer/src/optimistic_indexing.rs
7
0.0
0.0% crates/iota-indexer/src/pruning/pruner.rs
1
0.0
0.0% crates/iota-indexer/src/models/transactions.rs

Coverage Regressions

Lines Coverage ∆ File
651
5.22
0.01% crates/iota-indexer/src/read.rs
422
0.0
0.0% crates/iota-indexer/src/store/pg_indexer_store.rs
331
12.07
0.17% crates/iota-graphql-rpc/src/types/object.rs
165
0.0
0.0% crates/iota-indexer/src/store/pg_indexer_analytical_store.rs
112
91.51
0.01% crates/iota-protocol-config/src/lib.rs
104
0.0
0.0% crates/iota-indexer/src/pruning/pruner.rs
50
0.0
0.0% crates/iota-indexer/src/test_utils.rs
33
33.96
33.96% crates/iota-indexer/src/store/mod.rs
30
0.0
0.0% crates/iota-indexer/src/store/pg_partition_manager.rs
25
0.0
0.0% crates/iota-indexer/src/indexer.rs
20
0.0
0.0% crates/iota-graphql-rpc/src/backward_view/dynamic_fields.rs
20
0.0
0.0% crates/iota-indexer/src/processors/network_metrics_processor.rs
18
0.0
0.0% crates/iota-indexer/src/processors/address_metrics_processor.rs
18
81.26
-0.56% crates/test-cluster/src/lib.rs
15
0.0
0.0% crates/iota-indexer/src/processors/move_call_metrics_processor.rs
15
87.56
-0.33% crates/iota-test-transaction-builder/src/lib.rs
12
0.0
-54.55% crates/iota-cluster-test/src/config.rs
10
66.89
-0.84% crates/iota-core/src/authority/authority_store.rs
10
0.0
0.0% crates/iota-graphql-rpc/src/backward_view/historical.rs
10
62.99
-0.69% crates/iota-json-rpc-types/src/iota_transaction.rs
8
0.0
0.0% crates/iota-indexer/src/ingestion/primary/persist.rs
8
74.03
-0.58% crates/iota-network/src/randomness/mod.rs
7
0.0
0.0% crates/iota-indexer/src/backfill/ingestion/jobs/object_changes_unwrapped.rs
7
95.69
-0.33% crates/starfish/core/src/transactions_synchronizer.rs
6
87.0
-6.0% crates/iota-node-transaction-builder/src/lib.rs
6
52.04
-2.04% crates/iota-sdk/src/apis/read.rs
5
0.0
0.0% crates/iota-graphql-rpc/src/backward_view/mod.rs
5
56.69
-0.14% crates/iota-json-rpc-types/src/iota_object.rs
5
90.11
-1.9% crates/starfish/core/src/leader_timeout.rs
4
92.23
-1.29% crates/iota-core/src/authority/test_authority_builder.rs
4
84.55
-0.53% crates/iota-move-build/src/lib.rs
4
81.82
-18.18% iota-execution/src/verifier.rs
3
71.43
-14.29% crates/iota-config/src/certificate_deny_config.rs
3
85.95
-1.24% crates/iota-core/src/authority_server/mod.rs
3
81.41
-0.17% crates/iota-core/src/checkpoints/mod.rs
3
91.39
-0.13% crates/iota-core/src/execution_cache/writeback_cache.rs
3
80.42
0.7% crates/iota-sdk/src/wallet_context.rs
2
91.76
-0.07% crates/iota-core/src/authority/authority_per_epoch_store.rs
2
94.38
-0.06% crates/starfish/core/src/header_synchronizer.rs
1
86.11
-2.78% crates/iota-cluster-test/src/test_case/native_transfer_test.rs
1
92.64
-0.12% crates/iota-core/src/consensus_adapter.rs
1
84.73
-0.49% crates/iota-core/src/global_state_hasher.rs
1
89.92
0.26% crates/iota-grpc-server/src/types.rs
1
72.2
-0.49% crates/iota-types/src/error.rs
1
96.84
-0.03% crates/starfish/core/src/dag_state.rs
Jobs
ID Job ID Ran Files Coverage
1 nextest+simtest - 35043580069.1 16 Sep 2026 02:13AM UTC 1100
69.98
GitHub Action Run
Source Files on build 35043580069
  • Tree
  • List 1100
  • Changed 75
  • Source Changed 25
  • Coverage Changed 73
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #35043580069
  • 1dd2c472 on github
  • Prev Build on develop (#34916874737)
  • Next Build on develop (#35170083885)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc