fix(rpc): compute envelope max size arithmetically to avoid OOM#26
Open
Subhasish-Behera wants to merge 1 commit intograndinetech:epbs-devnet-2from
Open
fix(rpc): compute envelope max size arithmetically to avoid OOM#26Subhasish-Behera wants to merge 1 commit intograndinetech:epbs-devnet-2from
Subhasish-Behera wants to merge 1 commit intograndinetech:epbs-devnet-2from
Conversation
- The previous implementation used `SignedExecutionPayloadEnvelope::full()`
to determine the max SSZ size for RPC limits. This initiated all
variable-length fields at maximum capacity, including MAX_TRANSACTIONS_PER_PAYLOAD
transactions each at MAX_BYTES_PER_TRANSACTION, causing multi-GB allocations
that triggered OOM during libp2p initialization.
- not preffering ghost value style calculations like SIGNED_BEACON_BLOCK_BELLATRIX_MAX
for futrure reference about the calculations
- Replace with `full_gloas_signed_execution_payload_envelope_size<P>()` which
serializes the envelope with default (empty) transactions and adds the
transaction contribution arithmetically:
N * (BYTES_PER_LENGTH_OFFSET + max_bytes_per_transaction)
- This produces the same max size value without allocating the actual transaction
bytes.
- account for `block_access_list` in max envelope size
Collaborator
|
pushed your fix to upstream! unfortunately, I can't reproduce the issue, but the fix semantically look correct |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous implementation used
SignedExecutionPayloadEnvelope::full()to determine the max SSZ size for RPC limits. This initiated all variable-length fields at maximum capacity, including MAX_TRANSACTIONS_PER_PAYLOAD transactions each at MAX_BYTES_PER_TRANSACTION, causing multi-GB allocations that triggered OOM during libp2p initialization.not preffering ghost value style calculations like SIGNED_BEACON_BLOCK_BELLATRIX_MAX for futrure reference about the calculations
Replace with
full_gloas_signed_execution_payload_envelope_size<P>()which serializes the envelope with default (empty) transactions and adds the transaction contribution arithmetically: N * (BYTES_PER_LENGTH_OFFSET + max_bytes_per_transaction)This produces the same max size value without allocating the actual transaction bytes.
account for
block_access_listin max envelope size