Skip to content

chore: use random bytes for echo#3477

Open
achingbrain wants to merge 2 commits intomainfrom
chore/use-random-bytes-for-echo
Open

chore: use random bytes for echo#3477
achingbrain wants to merge 2 commits intomainfrom
chore/use-random-bytes-for-echo

Conversation

@achingbrain
Copy link
Copy Markdown
Member

Ensures that where bufs are split for sending, they are reassembled in the correct order.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

@achingbrain achingbrain requested a review from a team as a code owner April 24, 2026 11:22
@achingbrain achingbrain force-pushed the chore/use-random-bytes-for-echo branch 2 times, most recently from c6fb6f4 to 96e9950 Compare April 24, 2026 11:26
Ensures that where bufs are split for sending, they are reassembled
in the correct order.
@achingbrain achingbrain force-pushed the chore/use-random-bytes-for-echo branch from 96e9950 to e559d84 Compare April 24, 2026 11:27
@tabcat
Copy link
Copy Markdown
Member

tabcat commented Apr 24, 2026

was thinking of adding this before #3467

are you seeing issues? i was assuming libp2p ordered streams would catch it. looks like its passing :)

@achingbrain
Copy link
Copy Markdown
Member Author

More like a backfill. It would have caught https://bugzilla.mozilla.org/show_bug.cgi?id=1983831 unfortunately that was observed in the wild.

@achingbrain
Copy link
Copy Markdown
Member Author

Also I wasn't sure if this was covered elsewhere in the test suite - feel free to close if you don't think it's worth merging.

@tabcat
Copy link
Copy Markdown
Member

tabcat commented Apr 24, 2026

It would have caught https://bugzilla.mozilla.org/show_bug.cgi?id=1983831

lets keep it.

might as well do the same for many small writes as well.

Comment thread packages/interface-compliance-tests/src/transport/index.ts Outdated
const echoProtocol = dialer.services.echo.protocol

for (let i = 0; i < 2_000; i++) {
const input = new Uint8Array(1024).fill(5)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might as well make this random too.

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.

2 participants