[PR #7349] [MERGED] Port map: rest-018's activity rate limit and file-pack reads are ported #7537

Closed
opened 2026-11-03 07:19:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7349
Author: @MSedgeMC
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: chore/vol-e-rest-018


📝 Commits (3)

  • 13cd51f Port map: the file pack's resource and listing are in datapack.rs
  • 5a0598a Port map: the server-activity monitor's rate limit is activity_due
  • dc691ee Merge main into #7349

📊 Changes

1 file changed (+3 additions, -3 deletions)

View changed files

📝 tools/port_map/rest-018.tsv (+3 -3)

📄 Description

Rows of tools/port_map/rest-018.tsv (147 rows, map-check clean against 26.3). Three rows were filed skip: for code Horizon has: the server-activity rate limit and the two file-pack reads.

Verdicts

row was now where
ServerActivityMonitor.processWithRateLimit skip:service port crates/horizon-server/src/management.rs::activity_due
FilePackResources.getResource skip:data port crates/horizon-client-render/src/datapack.rs::DataPack::read
FilePackResources.listResources skip:data port crates/horizon-client-render/src/datapack.rs::DataPack::list
  • processWithRateLimit is the thirty-second limit around serverActivityOccured: serverActivity set, now - lastNotificationTime >= minimumMillisBetweenNotifications, then the flag cleared. management.rs::activity_due (management.rs:109) holds the same timestamp test against ACTIVITY_EVERY (30 s, management.rs:42) and can be told once per window; the event that asks supplies what the monitor's flag holds. The row said the notification services are not ported at all, but management.rs is built around them.
  • getResource is zipFile.getEntry(addPrefix(path)) and a supplier over the entry. datapack.rs::DataPack::read (datapack.rs:61) answers the same call for both pack sources: Zip::index finds the entry (name, else the <name>/ folder entry, as ZipFile.getEntry does — that is horizon-client-render/src/zip.rs:162) and read gives the bytes, a folder pack reads the file.
  • listResources walks the zip's entries, skips the directory entries and hands out the entries under <type>/<namespace>/<directory>/. datapack.rs::DataPack::list (datapack.rs:26) lists the same files under a prefix — zip entry names with the folder entries filtered, or a sorted folder walk — and the callers build the identifiers from those paths.

Checked and left alone: FilePackResources.getPathFromLocation, addPrefix, getNamespaces and extractNamespace keep skip:data — the prefix building and the namespace scan are folded into the callers that pass a data/<namespace>/<kind>/ prefix, and no namespace listing over a pack exists. ServerGamePacketListenerImpl's rows were read and are answered.

Map-check:

PORT_LEDGER_OUT=/tmp/led-volE python3 tools/port_ledger.py map-check tools/port_map/rest-018.tsv
147 rows, no problems.

Proven: the vanilla side read from the 26.3 classes (ServerActivityMonitor.processWithRateLimit and its minimumMillisBetweenNotifications, FilePackResources.getResource/listResources/addPrefix), and the Horizon side at the cites: activity_due's ACTIVITY_EVERY comparison and timestamp update, DataPack::read's zip-or-folder read, DataPack::list's prefix filter and folder-entry skip, and Zip::index's folder-entry fallback. Every where cell resolves under map-check.

Not proven: that DataPack::list gives the same order for a zip as ZipFile.entries() does — it keeps the central-directory order; a folder pack is sorted by file name instead. Nothing in the callers depends on the order that I found, but I did not compare a listing of a real pack between the two.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/7349 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `chore/vol-e-rest-018` --- ### 📝 Commits (3) - [`13cd51f`](https://github.com/horizon-rust/horizon/commit/13cd51f9e5dacd26c785e11dec946195ea148be0) Port map: the file pack's resource and listing are in datapack.rs - [`5a0598a`](https://github.com/horizon-rust/horizon/commit/5a0598ad39dd61a76da8006af5e8ec44a5ef9ac0) Port map: the server-activity monitor's rate limit is activity_due - [`dc691ee`](https://github.com/horizon-rust/horizon/commit/dc691ee6a939a63deafb1bbd97de085488a24edf) Merge main into #7349 ### 📊 Changes **1 file changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `tools/port_map/rest-018.tsv` (+3 -3) </details> ### 📄 Description Rows of `tools/port_map/rest-018.tsv` (147 rows, map-check clean against 26.3). Three rows were filed `skip:` for code Horizon has: the server-activity rate limit and the two file-pack reads. **Verdicts** | row | was | now | where | | --- | --- | --- | --- | | `ServerActivityMonitor.processWithRateLimit` | skip:service | port | `crates/horizon-server/src/management.rs::activity_due` | | `FilePackResources.getResource` | skip:data | port | `crates/horizon-client-render/src/datapack.rs::DataPack::read` | | `FilePackResources.listResources` | skip:data | port | `crates/horizon-client-render/src/datapack.rs::DataPack::list` | - `processWithRateLimit` is the thirty-second limit around `serverActivityOccured`: `serverActivity` set, `now - lastNotificationTime >= minimumMillisBetweenNotifications`, then the flag cleared. `management.rs::activity_due` (management.rs:109) holds the same timestamp test against `ACTIVITY_EVERY` (30 s, management.rs:42) and can be told once per window; the event that asks supplies what the monitor's flag holds. The row said the notification services are not ported at all, but `management.rs` is built around them. - `getResource` is `zipFile.getEntry(addPrefix(path))` and a supplier over the entry. `datapack.rs::DataPack::read` (datapack.rs:61) answers the same call for both pack sources: `Zip::index` finds the entry (name, else the `<name>/` folder entry, as `ZipFile.getEntry` does — that is `horizon-client-render/src/zip.rs:162`) and `read` gives the bytes, a folder pack reads the file. - `listResources` walks the zip's entries, skips the directory entries and hands out the entries under `<type>/<namespace>/<directory>/`. `datapack.rs::DataPack::list` (datapack.rs:26) lists the same files under a prefix — zip entry names with the folder entries filtered, or a sorted folder walk — and the callers build the identifiers from those paths. Checked and left alone: `FilePackResources.getPathFromLocation`, `addPrefix`, `getNamespaces` and `extractNamespace` keep `skip:data` — the prefix building and the namespace scan are folded into the callers that pass a `data/<namespace>/<kind>/` prefix, and no namespace listing over a pack exists. `ServerGamePacketListenerImpl`'s rows were read and are answered. Map-check: ``` PORT_LEDGER_OUT=/tmp/led-volE python3 tools/port_ledger.py map-check tools/port_map/rest-018.tsv 147 rows, no problems. ``` **Proven:** the vanilla side read from the 26.3 classes (`ServerActivityMonitor.processWithRateLimit` and its `minimumMillisBetweenNotifications`, `FilePackResources.getResource`/`listResources`/`addPrefix`), and the Horizon side at the cites: `activity_due`'s `ACTIVITY_EVERY` comparison and timestamp update, `DataPack::read`'s zip-or-folder read, `DataPack::list`'s prefix filter and folder-entry skip, and `Zip::index`'s folder-entry fallback. Every `where` cell resolves under map-check. **Not proven:** that `DataPack::list` gives the same order for a zip as `ZipFile.entries()` does — it keeps the central-directory order; a folder pack is sorted by file name instead. Nothing in the callers depends on the order that I found, but I did not compare a listing of a real pack between the two. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 07:19:20 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#7537
No description provided.