Skip to content

[email protected] does not support chunks bigger than 2Mb anymore #1343

Closed
@alxroyer

Description

@alxroyer

Severity:

Low

Description:

When receiving chunks of data bigger than 2Mb from a stream, Error: message size too large! errors are raised,
while with [email protected], we could exchange chunks of 10Mb at least.

Not really an operational problem I guess. Quick workarounds easy to set up.
But depending on the root cause, I can't say on my own whether that problem could hide a bigger one.

Steps to reproduce the error:

Using the scripts attached with #1342, launch the sender (3145728 = 3 * 1024 * 1024):

node libp2p-node.0.37.x.mjs --send=path-to-a-big-file --size=3145728

then launch the receiver:

node libp2p-node.0.37.x.mjs --connect=/address/of/sender/node

Error displayed by the receiver:

file:///.../node_modules/@libp2p/mplex/dist/src/restrict-size.js:14
            throw Object.assign(new Error('message size too large!'), { code: 'ERR_MSG_TOO_BIG' });
                                ^

Error: message size too large!
    at checkSize (file:///.../node_modules/@libp2p/mplex/dist/src/restrict-size.js:14:33)
    at Array.forEach (<anonymous>)
    at restrictSize (file:///.../node_modules/@libp2p/mplex/dist/src/restrict-size.js:21:25)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async file:///.../node_modules/@libp2p/mplex/dist/src/mplex.js:134:38
    at async MplexStreamMuxer.sink (file:///.../node_modules/@libp2p/mplex/dist/src/mplex.js:133:17) {
  code: 'ERR_MSG_TOO_BIG'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    need/triageNeeds initial labeling and prioritization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions