Skip to content

--import download size is unbounded and v1 entries are read whole into memory #383

Open

Description

@SDL-A1

From the external review of #374.

--import has no bound on download size, as in RSKj. It can fill the disk
before the SHA check fails, so the integrity check comes too late to protect the
host.

Separately, the v1 import format reads a whole entry into memory. On a 7.6 GB
box shared with the node, that is its own hazard — a 2 GB cache has OOM-killed
work here before.

Why it matters on this host specifically

/ has ~21 GB free and sdb is the build volume. An unbounded download that fills
either takes out more than the import.

Matching RSKj's behaviour is a defensible default for consensus, but this is not
consensus — it is operational safety, and we are free to be stricter.

What would settle it

Take the expected size from the index, refuse to start if the filesystem cannot
hold it with headroom, and abort the download once it exceeds the declared size.
Stream v1 entries rather than buffering whole.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions