apollo_mempool: add timestamp logic to flow#12701
apollo_mempool: add timestamp logic to flow#12701ayeletstarkware wants to merge 1 commit intoayelet/mempool/fifo/impl-fifo-queuefrom
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
646ff64 to
71ffc55
Compare
c74ef8c to
6d7d544
Compare
6d7d544 to
416a976
Compare
71ffc55 to
00633f3
Compare
| self.post_method_router(add_tx), | ||
| ) | ||
| // Echonet timestamp update endpoint | ||
| .route("/gateway/update_timestamps", post(update_timestamps)) |
There was a problem hiding this comment.
Missing body size limit on update_timestamps endpoint
Medium Severity
The /gateway/update_timestamps route uses post(update_timestamps) directly, unlike all other POST routes which use self.post_method_router(...). The post_method_router applies a DefaultBodyLimit::max(max_request_body_size) layer. The new endpoint bypasses this body size limit, allowing arbitrarily large request bodies that could lead to memory exhaustion.
416a976 to
f87f2bb
Compare
2002362 to
b6c7b85
Compare
3d543fb to
ead7396
Compare
b31eca5 to
bbbd00d
Compare
96db6da to
ef24d43
Compare
bbbd00d to
0705cb6
Compare
ef24d43 to
9f27529
Compare
0705cb6 to
4ba2f2d
Compare
| }) | ||
| .await | ||
| .expect("Should be able to get update_timestamps result"); | ||
| result?; |
There was a problem hiding this comment.
Timestamp endpoint can panic on join
Medium Severity
update_timestamps wraps the call in tokio::spawn(...).await.expect(...). If the spawned task panics or the runtime is shutting down, the .expect panics the HTTP server handler, potentially taking down request handling instead of returning an error.



Note
Medium Risk
Changes transaction selection semantics in Echonet mode by gating FIFO pops on timestamp thresholds, which can affect batching/order and stall processing if timestamps are missing or inconsistent; other modes are largely unaffected.
Overview
Adds an
update_timestampsflow from the HTTP server (POST /gateway/update_timestamps) throughGatewayRequest::UpdateTimestampsinto the mempool, allowing external timestamp mappings (tx_hash -> UnixTimestamp) to be applied.Refactors the Echonet FIFO queue to be hash-based and timestamp-aware:
get_timestamp()now derives a batching threshold from the first queued tx’s timestamp (and reuses the last value when empty), andget_txs()only pops transactions matching that threshold; tests/utilities are updated accordingly and Grafana dashboards gain client/server latency panels for the new request variant.Written by Cursor Bugbot for commit 4ba2f2d. This will update automatically on new commits. Configure here.