Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: increase DefaultBodyLimit to prevent large payload failures #409

Merged
merged 2 commits into from
Feb 13, 2025

Conversation

AlexD10S
Copy link
Collaborator

When attempting to register a parachain using the wallet to sign the transaction, an error appeared in the frontend:

Error: Unable to submit. Is the server closed?

This was caused by the request body limit being too low, resulting in a 413 (Payload Too Large) error.

This PR increases DefaultBodyLimit to handle larger payloads and adds a test to verify large transaction support. The 15MB limit is a bit arbitrary but ensures stability, providing enough room for 5MB transactions while accounting for potential encoding overhead.

Resource: https://stackoverflow.com/questions/75205271/rust-axum-multipart-length-limit-exceeded.

@AlexD10S AlexD10S requested a review from peterwht February 11, 2025 18:33
Copy link

codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 96.55172% with 1 line in your changes missing coverage. Please review.

Project coverage is 75.16%. Comparing base (2e03233) to head (7d79720).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
crates/pop-cli/src/wallet_integration.rs 96.55% 0 Missing and 1 partial ⚠️
@@            Coverage Diff             @@
##             main     #409      +/-   ##
==========================================
+ Coverage   75.11%   75.16%   +0.05%     
==========================================
  Files          63       63              
  Lines       13842    13870      +28     
  Branches    13842    13870      +28     
==========================================
+ Hits        10398    10426      +28     
+ Misses       2118     2117       -1     
- Partials     1326     1327       +1     
Files with missing lines Coverage Δ
crates/pop-cli/src/wallet_integration.rs 96.15% <96.55%> (+0.01%) ⬆️

... and 1 file with indirect coverage changes

Copy link
Contributor

@peterwht peterwht left a comment

Choose a reason for hiding this comment

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

Looks good! Nice fix.

If you have the time, might be easy enough to add a failing test that is 15.1 MB to trigger the error. Not a blocker though

@AlexD10S
Copy link
Collaborator Author

AlexD10S commented Feb 11, 2025

Looks good! Nice fix.

If you have the time, might be easy enough to add a failing test that is 15.1 MB to trigger the error. Not a blocker though

Thanks, it make sense to have that test. Added in the commit 7d79720

@AlexD10S AlexD10S requested a review from peterwht February 11, 2025 20:48
@AlexD10S AlexD10S merged commit 00680f8 into main Feb 13, 2025
20 checks passed
@AlexD10S AlexD10S deleted the fix/size-limit-in-post branch February 13, 2025 08:32
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