-
Notifications
You must be signed in to change notification settings - Fork 58
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
add block limit #2
Conversation
Signed-off-by: Stefan <stefan.pingel@consensys.net>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a commit to implement my comments
names = {BLOCK_MAX_CALLDATA_SIZE}, | ||
paramLabel = "<INTEGER>", | ||
description = | ||
"If specified, overrides the max size in bytes allowed in the transaction calldata field, specified by the current hard fork") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adapt the description to block max calldata size
@@ -534,4 +557,13 @@ private boolean blockOccupancyAboveThreshold() { | |||
occupancyRatio); | |||
return occupancyRatio >= minBlockOccupancyRatio; | |||
} | |||
|
|||
private Optional<TransactionSelectionResult> maxCalldataEnforcer(final Transaction transaction) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems this could simplified to just return a boolean
@@ -12,6 +12,7 @@ | |||
import java.util.Set; | |||
|
|||
public class LineaProtocolSpecs { | |||
public static final int DEFAULT_BLOCK_MAX_CALLDATA_SIZE = 1000000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be private
@@ -304,6 +321,12 @@ private TransactionSelectionResult evaluateTransaction( | |||
throw new CancellationException("Cancelled during transaction selection."); | |||
} | |||
|
|||
final Optional<TransactionSelectionResult> maybeResult = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems this could simplified to be a Predicate
@@ -52,6 +53,7 @@ static ProtocolSpecBuilder lineaDefinition( | |||
TransactionType.EIP1559), | |||
quorumCompatibilityMode, | |||
txCalldataMaxSize)) | |||
.lineaParameters(lineaParameters) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should not pass lineaParameters
here, but we can abstract and pass only calldata limits, also because lineaParameters
only contain the configuration overrides, and not the value specified in the hard fork definition
public LineaParameters getLineaParameters() { | ||
return lineaParameters; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as described before, we can replace this with blockMaxCalldataSize
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
PR description
Adding first try to enforce block call data limit