Skip to content

fix(network): cap the size of replies read from indexers - #805

Open
MoonBoi9001 wants to merge 4 commits into
mainfrom
mb9/limit-size-of-replies-read-from-indexers
Open

MoonBoi9001 wants to merge 4 commits into
mainfrom
mb9/limit-size-of-replies-read-from-indexers

Conversation

@MoonBoi9001

@MoonBoi9001 MoonBoi9001 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Dipper now stops reading a reply from an indexer's server once it passes a size limit and treats it as no answer: 64 KiB for DIPs info, and 64 KiB plus 1 KiB for each deployment asked about for indexing progress. Before, the whole reply was held in memory however long it was, so any registered indexer could run dipper out of memory with a huge or endless reply.

Dipper asks each indexer's own server for its DIPs info and its indexing progress, and used to
read whatever came back in full. A server sending a huge or endless reply could run dipper out
of memory, so a reply over 1 MiB (DIPs info) or 4 MiB (progress) now counts as no answer.
Reading a reply into memory as structured data can take about 16 times its length, so a limit
far above what an honest indexer sends still lets 1 indexer use a lot of memory. DIPs info is
now limited to 64 KiB, and a progress reply to 64 KiB plus 1 KiB for each deployment it covers.
A reply is refused either by the length it declares or by counting what arrives, and the tests
could not tell the 2 apart; 1 would also have filled memory had the counting been broken. Each
now uses a server that stalls, so a missing check shows up as a test that times out.
@MoonBoi9001
MoonBoi9001 marked this pull request as ready for review November 10, 2026 20:52
# Conflicts:
#	bin/dipper-service/src/network/service/liveness_checker.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant