Skip to content

fix(rpc): reject eth_subscribe requests with invalid params - #27339

Open
Bruce039 wants to merge 1 commit into
paradigmxyz:mainfrom
Bruce039:fix/subscribe-validate-params
Open

Bruce039 wants to merge 1 commit into
paradigmxyz:mainfrom
Bruce039:fix/subscribe-validate-params

Conversation

@Bruce039

Copy link
Copy Markdown
Contributor

eth_subscribe accepted the subscription before its params were checked, so a request such as eth_subscribe("logs", true) received a subscription id while the invalid params error was dropped inside the spawned task, leaving the client with a subscription that never delivers anything. The same happened for newPendingTransactions and transactionReceipts with params of the wrong shape.

The params are now validated per subscription kind before the subscription is accepted, and invalid requests are rejected with an invalid params error; the handlers reuse the same helpers.

The subscription was accepted before its params were checked, so a request
such as eth_subscribe("logs", true) received a subscription id and the
invalid params error was dropped inside the spawned task, leaving the client
with a subscription that never delivers anything. Params are now validated
first and invalid requests are rejected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant