Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

- Added `make_cose_verifier_from_pem_cert()` and `make_cose_verifier_from_der_cert()` that accept certificates in a known format. The existing `make_cose_verifier_cert()` is renamed to `make_cose_verifier_any_cert()` (#7768).

### Changed

- The `since` query parameter on the `GET /node/snapshot` endpoint now uses closed (inclusive) semantics, consistent with the `since` parameter on `GET /node/ledger_chunk`. A request with `?since=N` will now return snapshots with index greater than or equal to `N`, rather than strictly greater than `N` (#7742).

## [7.0.0-dev13]

[7.0.0-dev13]: https://github.com/microsoft/CCF/releases/tag/ccf-7.0.0-dev13
Expand Down
4 changes: 1 addition & 3 deletions src/node/node_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -3134,9 +3134,7 @@ namespace ccf
snapshot_evidence.version);
backup_snapshot_fetch_task =
std::make_shared<BackupSnapshotFetch>(
config.snapshots,
snapshot_evidence.version - 1 /* YIKES */,
this);
config.snapshots, snapshot_evidence.version, this);
ccf::tasks::add_task(backup_snapshot_fetch_task);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/snapshots/filenames.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ namespace snapshots
}

const auto idx = get_snapshot_idx_from_file_name(file_name.string());
if (minimum_idx.has_value() && idx <= minimum_idx.value())
if (minimum_idx.has_value() && idx < minimum_idx.value())
{
LOG_DEBUG_FMT(
"Ignoring snapshot file {} below minimum idx {}",
Expand Down
8 changes: 6 additions & 2 deletions tests/e2e_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,17 @@ def do_request(http_verb, *args, **kwargs):
assert location == f"{loc}{path}"
LOG.warning(r.headers)

# since uses closed/inclusive semantics: since=N returns snapshots
# with index >= N. So since=snapshot_index returns the snapshot
# (inclusive boundary), while since=snapshot_index+1 does not
# (strictly past the available snapshot index).
for since, expected in (
(0, location),
(1, location),
(snapshot_index // 2, location),
(snapshot_index - 1, location),
(snapshot_index, None),
(snapshot_index + 1, None),
(snapshot_index, location), # inclusive: exact index is returned
(snapshot_index + 1, None), # strictly past: nothing returned
):
for method in ("GET", "HEAD"):
r = do_request(
Expand Down
Loading