Skip to content

Add encoded length methods to transactions#77

Open
manuelmauro wants to merge 3 commits intorust-ethereum:masterfrom
moonbeam-foundation:manuel/add-encoded-len
Open

Add encoded length methods to transactions#77
manuelmauro wants to merge 3 commits intorust-ethereum:masterfrom
moonbeam-foundation:manuel/add-encoded-len

Conversation

@manuelmauro
Copy link
Contributor

Summary

Add encoded_len() and payload_len() methods to compute transaction sizes without full encoding. This enables transaction size validation for DoS protection, matching reth/alloy's approach.

Motivation

Transaction pools need to enforce size limits for performance reasons and to prevent DoS attacks. Reth enforces a default maximum of 128 KB per transaction and validates transactions.

Alloy provides similar methods on transaction envelopes for this purpose.

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.

1 participant