Skip to content

refactor: better auto default for data frame budget - #946

Merged
seanmonstar merged 1 commit into
masterfrom
sean/orvlpvnqoqqq
Aug 24, 2026
Merged

seanmonstar merged 1 commit into
masterfrom
sean/orvlpvnqoqqq

Conversation

@seanmonstar

Copy link
Copy Markdown
Member

Instead of choosing a specific small default constant, the small data frame overhead budget will now be calculated based on the configured connection window size. Setting the budget directly will skip the default auto value.

Closes #944

@Sruhvx-jpg

Sruhvx-jpg commented Aug 23, 2026 •

Copy link
Copy Markdown

Small nit on resolve:
we can avoid bouncing through u64 with (window as usize / 2).max(DEFAULT_DATA_FRAME_BUDGET).

Also as a naive proposal, window >> 1 could be used instead of / 2.

Sruhvx-jpg added a commit to Sruhvx-jpg/h2 that referenced this pull request Aug 23, 2026
Problem

HTTP/2 flow control limits DATA payload bytes, but not the framing overhead
from excessive numbers of small frames. A peer could fragment data into many
tiny frames, causing disproportionate memory usage from queued events while
remaining within flow-control windows.

Solution

Backport the framing overhead budget and empty frame handling from master
(hyperium#935, hyperium#940, hyperium#942, hyperium#945, hyperium#946) to the 0.3.x maintenance branch.

Validation

Ran the full test suite and added regression integration tests in stream_states.rs.
Instead of choosing a specific small default constant, the small data frame
overhead budget will now be calculated based on the configured connection
window size. Setting the budget directly will skip the default auto value.
@seanmonstar
seanmonstar merged commit c7e89e9 into master Aug 24, 2026
6 checks passed
@seanmonstar
seanmonstar deleted the sean/orvlpvnqoqqq branch August 24, 2026 12:15
miker83z pushed a commit to miker83z/iota that referenced this pull request Oct 8, 2026
# Description of change

- Updates `h2` from 0.4.17 to 0.4.19 in `Cargo.lock`. Lockfile only; no
other dependency moves.
- h2 0.4.16 added a fixed per-connection budget of 25,600 units against
buffered DATA frames smaller than 256 bytes and closes the connection
with `GOAWAY(ENHANCE_YOUR_CALM)` when it runs out. tonic reports that as
`RESOURCE_EXHAUSTED` on every request in flight on the connection. Our
lockfile picked up 0.4.17 with iotaledger#12704.
- The budget also runs in the client role. A signed `handle_transaction`
response is a 159-byte DATA frame, so 264 responses buffered but not yet
read on one fullnode-to-validator connection close that connection.
`shared_object_deletion_multiple_times` submits 300 transactions
concurrently and sits at that edge: with an instrumented h2 the budget
dropped to between 3,000 and 13,000 of 25,600 on every seed tried, and
the two nightly failures are seeds where it reached zero.
- h2 0.4.19 sizes the budget from the connection window instead
(hyperium/h2#939, hyperium/h2#946), which is 2.5 MiB on hyper clients. A
seed that exhausts the budget on 0.4.17 stays at 2.59 MiB of 2.62 MiB on
0.4.19.

## Links to any relevant issues

fixes iotaledger#12849

## How the change has been tested

- [x] Basic tests (linting, compilation, formatting, unit/integration
tests)
- [x] Patch-specific tests (correctness, functionality coverage)
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] I have checked that new and existing unit tests pass locally with
my changes

### Release Notes

- [ ] Protocol:
- [x] Nodes (Validators and Full nodes): update `h2` to 0.4.19 so a
fullnode's connections to validators are no longer closed with
`RESOURCE_EXHAUSTED` under bursts of small gRPC responses.
- [ ] Indexer:
- [ ] JSON-RPC:
- [ ] GraphQL:
- [ ] CLI:
- [ ] Rust SDK:
- [ ] REST API:
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.

h2 fix for the recent security vulnerability breaks downstream consumers

2 participants