Estimate the memory size of EIP-7702 transactions#7984
Merged
fab-10 merged 2 commits intobesu-eth:mainfrom Dec 11, 2024
Merged
Conversation
ahamlat
approved these changes
Dec 9, 2024
Contributor
ahamlat
left a comment
There was a problem hiding this comment.
Small comments, but nothing really blocking.
| } | ||
|
|
||
| @SuppressWarnings("unused") | ||
| private static void dumpHeap(final String filePath, final boolean live) throws IOException { |
Contributor
There was a problem hiding this comment.
I see that the method is not used, why do we need to have it ? with no comment, it looks like a dead code for me.
Contributor
Author
There was a problem hiding this comment.
documented how to use this utility
Contributor
There was a problem hiding this comment.
Thanks for the detailed documentation, to access JMX mbeans, you need to have a java process running that exposes those Mbeans. I still don't see how can this work in a unit test. Could you give an example how can this work ?
Contributor
Author
There was a problem hiding this comment.
Just put it wherever you need, no other setup needed
@Test
public void baseFrontierAndAccessListTransactionMemorySize() {
final Transaction txFrontier =
createTransaction(TransactionType.FRONTIER, 1, Wei.of(500), 0, KEYS1);
try {
dumpHeap("/tmp/heap.hprof", true);
} catch (IOException e) {
throw new RuntimeException(e);
}
assertThat(baseTransactionMemorySize(txFrontier, FRONTIER_ACCESS_LIST_CONSTANT_FIELD_PATHS))
.isEqualTo(FRONTIER_AND_ACCESS_LIST_SHALLOW_SIZE);
}
Contributor
There was a problem hiding this comment.
...rg/hyperledger/besu/ethereum/eth/transactions/PendingTransactionEstimatedMemorySizeTest.java
Show resolved
Hide resolved
...eum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransaction.java
Outdated
Show resolved
Hide resolved
...rg/hyperledger/besu/ethereum/eth/transactions/PendingTransactionEstimatedMemorySizeTest.java
Outdated
Show resolved
Hide resolved
...rg/hyperledger/besu/ethereum/eth/transactions/PendingTransactionEstimatedMemorySizeTest.java
Show resolved
Hide resolved
d1b2314 to
f164dc9
Compare
ahamlat
approved these changes
Dec 11, 2024
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
f164dc9 to
26ac71d
Compare
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
26ac71d to
7c3955b
Compare
daniellehrner
pushed a commit
to daniellehrner/besu
that referenced
this pull request
Dec 18, 2024
* Estimate the memory size of EIP-7702 transactions Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net> * Apply suggestions from code review Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net> --------- Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net> Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
pullurib
pushed a commit
to pullurib/besu
that referenced
this pull request
Feb 6, 2025
* Estimate the memory size of EIP-7702 transactions Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net> * Apply suggestions from code review Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net> --------- Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net> Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>
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.

PR description
Estimate the memory size of EIP-7702 transactions and implement the detached copy of code delegation objects to avoid keeping references to big bytes arrays while the tx sits in the txpool
Fixed Issue(s)
fixes #7976
Thanks for sending a pull request! Have you done the following?
doc-change-requiredlabel to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew build./gradlew acceptanceTest./gradlew integrationTest./gradlew ethereum:referenceTests:referenceTests