-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # gradle.properties # sequencer/src/main/java/net/consensys/linea/sequencer/txpoolvalidation/LineaTransactionPoolValidatorFactory.java # sequencer/src/main/java/net/consensys/linea/sequencer/txpoolvalidation/validators/SimulationValidator.java # sequencer/src/test/java/net/consensys/linea/sequencer/txpoolvalidation/validators/SimulationValidatorTest.java
- Loading branch information
Showing
35 changed files
with
797 additions
and
226 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
releaseVersion=0.1.4-test34 | ||
besuVersion=24.9-delivery32 | ||
releaseVersion=0.1.4-test35 | ||
besuVersion=24.10-delivery34 | ||
besuArtifactGroup=io.consensys.linea-besu | ||
distributionIdentifier=besu-sequencer-plugins | ||
distributionBaseUrl=https://artifacts.consensys.net/public/linea-besu/raw/names/linea-besu.tar.gz/versions/ | ||
distributionBaseUrl=https://artifacts.consensys.net/public/linea-besu/raw/names/linea-besu.tar.gz/versions/ |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
23 changes: 23 additions & 0 deletions
23
sequencer/src/main/java/net/consensys/linea/config/LineaNodeType.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright Consensys Software Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package net.consensys.linea.config; | ||
|
||
/** Linea node type that is used when reporting rejected transactions. */ | ||
public enum LineaNodeType { | ||
SEQUENCER, | ||
RPC, | ||
P2P | ||
} |
100 changes: 100 additions & 0 deletions
100
sequencer/src/main/java/net/consensys/linea/config/LineaRejectedTxReportingCliOptions.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/* | ||
* Copyright Consensys Software Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package net.consensys.linea.config; | ||
|
||
import java.net.URL; | ||
|
||
import com.google.common.base.MoreObjects; | ||
import net.consensys.linea.LineaCliOptions; | ||
import picocli.CommandLine.Option; | ||
|
||
/** The Linea Rejected Transaction Reporting CLI options. */ | ||
public class LineaRejectedTxReportingCliOptions implements LineaCliOptions { | ||
/** | ||
* The configuration key used in AbstractLineaPrivateOptionsPlugin to identify the cli options. | ||
*/ | ||
public static final String CONFIG_KEY = "rejected-tx-reporting-config"; | ||
|
||
/** The rejected transaction endpoint. */ | ||
public static final String REJECTED_TX_ENDPOINT = "--plugin-linea-rejected-tx-endpoint"; | ||
|
||
/** The Linea node type. */ | ||
public static final String LINEA_NODE_TYPE = "--plugin-linea-node-type"; | ||
|
||
@Option( | ||
names = {REJECTED_TX_ENDPOINT}, | ||
hidden = true, | ||
paramLabel = "<URL>", | ||
description = | ||
"Endpoint URI for reporting rejected transactions. Specify a valid URI to enable reporting.") | ||
URL rejectedTxEndpoint = null; | ||
|
||
@Option( | ||
names = {LINEA_NODE_TYPE}, | ||
hidden = true, | ||
paramLabel = "<NODE_TYPE>", | ||
description = | ||
"Linea Node type to use when reporting rejected transactions. (Valid values: ${COMPLETION-CANDIDATES})") | ||
LineaNodeType lineaNodeType = null; | ||
|
||
/** Default constructor. */ | ||
private LineaRejectedTxReportingCliOptions() {} | ||
|
||
/** | ||
* Create Linea Rejected Transaction Reporting CLI options. | ||
* | ||
* @return the Linea Rejected Transaction Reporting CLI options | ||
*/ | ||
public static LineaRejectedTxReportingCliOptions create() { | ||
return new LineaRejectedTxReportingCliOptions(); | ||
} | ||
|
||
/** | ||
* Instantiates a new Linea rejected tx reporting cli options from Configuration object | ||
* | ||
* @param config An instance of LineaRejectedTxReportingConfiguration | ||
*/ | ||
public static LineaRejectedTxReportingCliOptions fromConfig( | ||
final LineaRejectedTxReportingConfiguration config) { | ||
final LineaRejectedTxReportingCliOptions options = create(); | ||
options.rejectedTxEndpoint = config.rejectedTxEndpoint(); | ||
options.lineaNodeType = config.lineaNodeType(); | ||
return options; | ||
} | ||
|
||
@Override | ||
public LineaRejectedTxReportingConfiguration toDomainObject() { | ||
// perform validation here, if endpoint is specified then node type is required. | ||
// We can ignore node type if endpoint is not specified. | ||
if (rejectedTxEndpoint != null && lineaNodeType == null) { | ||
throw new IllegalArgumentException( | ||
"Error: Missing required argument(s): " + LINEA_NODE_TYPE + "=<NODE_TYPE>"); | ||
} | ||
|
||
return LineaRejectedTxReportingConfiguration.builder() | ||
.rejectedTxEndpoint(rejectedTxEndpoint) | ||
.lineaNodeType(lineaNodeType) | ||
.build(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
|
||
return MoreObjects.toStringHelper(this) | ||
.add(REJECTED_TX_ENDPOINT, rejectedTxEndpoint) | ||
.add(LINEA_NODE_TYPE, lineaNodeType) | ||
.toString(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...encer/src/main/java/net/consensys/linea/config/LineaRejectedTxReportingConfiguration.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright Consensys Software Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package net.consensys.linea.config; | ||
|
||
import java.net.URL; | ||
|
||
import lombok.Builder; | ||
import net.consensys.linea.LineaOptionsConfiguration; | ||
|
||
/** Linea Rejected Transactions Reporting Configuration */ | ||
@Builder(toBuilder = true) | ||
public record LineaRejectedTxReportingConfiguration( | ||
URL rejectedTxEndpoint, LineaNodeType lineaNodeType) implements LineaOptionsConfiguration {} |
This file contains 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
Oops, something went wrong.