Skip to content

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
@codecov
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
chungquantin pushed a commit that referenced this pull request Feb 19, 2025
)

* fix: increase DefaultBodyLimit to prevent large payload failures

* test: increase coverage testing with larger than MAX_PAYLOAD_SIZE
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.

3 participants