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

[Bug]: Set the request body payload size limit #1186

Closed
1 task
djordon opened this issue Jan 7, 2025 · 0 comments · Fixed by #1195
Closed
1 task

[Bug]: Set the request body payload size limit #1186

djordon opened this issue Jan 7, 2025 · 0 comments · Fixed by #1195
Assignees
Labels
bug Something isn't working

Comments

@djordon
Copy link
Collaborator

djordon commented Jan 7, 2025

Bug - Set the request body payload size limit

1. Description

The signer HTTP server, the one used as an event observer, will reject webhook events where the body exceeds the default limit of 2 megabytes. We need to set the limit to something that is greater than what we could expect from the stacks node.

1.1 Context & Purpose

The stacks-core event observer functionality stalls the node whenever it doesn't get a 200 response from an event observer. With the currently configured sbtc-signer event observer, we will reject events with more than 2 MBs of payload data, returning status code 413, PAYLOAD_TOO_LARGE. This limit should be set to some larger value.

2. Technical Details:

Stacks blocks have a limit of 2 MB, which is enforced at the p2p level (peers reject blocks that are greater than 2 MBs), but event observer events can be larger than that since they contain the subscribed sbtc events. Luckily the size of the sbtc events themselves are bounded by the size of the transactions that create them, so a limit of 8 MB will be fine since it is twice as high as required.

2.1 Acceptance Criteria:

  • Raise the payload limit of the sbtc-signer HTTP server.

3. Related Issues and Pull Requests (optional):

The limits in stacks core are P2P codec limits. The one for blocks can be found https://github.com/stacks-network/stacks-core/blob/8ad5e95b85a7b4cbb918e63048f5eea70229e8ce/stackslib/src/net/codec.rs#L482-L498 and https://github.com/stacks-network/stacks-core/blob/c80fa544d176d85a1741b958bc3e11f6c891bf97/stackslib/src/chainstate/stacks/mod.rs#L84-L86

@djordon djordon added the bug Something isn't working label Jan 7, 2025
@djordon djordon added this to the sBTC: Key rotation milestone Jan 7, 2025
@djordon djordon added this to sBTC Jan 7, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in sBTC Jan 7, 2025
@djordon djordon moved this from Needs Triage to Todo in sBTC Jan 7, 2025
@matteojug matteojug self-assigned this Jan 9, 2025
@matteojug matteojug moved this from Todo to In Progress in sBTC Jan 9, 2025
@matteojug matteojug moved this from In Progress to In Review in sBTC Jan 9, 2025
@github-project-automation github-project-automation bot moved this from In Review to Done in sBTC Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants