Skip to content

Commit

Permalink
Merge branch 'main' into release-v0.1.4-testX
Browse files Browse the repository at this point in the history
# Conflicts:
#	acceptance-tests/build.gradle
#	gradle.properties
#	gradle/dependency-management.gradle
#	sequencer/build.gradle
  • Loading branch information
fab-10 committed Dec 10, 2024
2 parents 86625c5 + 852d34c commit 8620350
Show file tree
Hide file tree
Showing 11 changed files with 126 additions and 166 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ Linea abstracts away the complexity of this technical architecture to allow deve

## How to contribute

Contributions of any kind are welcome!
Contributions are welcome!

### Guidelines for Non-Code and other Trivial Contributions
Please keep in mind that we do not accept non-code contributions like fixing comments, typos or some other trivial fixes. Although we appreciate the extra help, managing lots of these small contributions is unfeasible, and puts extra pressure in our continuous delivery systems (running all tests, etc). Feel free to open an issue pointing any of those errors, and we will batch them into a single change.

1. [Create an issue](https://github.com/Consensys/linea-sequencer/issues).
> If the proposed update is non-trivial, also tag us for discussion.
> If the proposed update requires input, also tag us for discussion.
2. Submit the update as a pull request from your [fork of this repo](https://github.com/Consensys/linea-sequencer/fork), and tag us for review.
> Include the issue number in the pull request description and (optionally) in the branch name.
Expand Down
18 changes: 1 addition & 17 deletions acceptance-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,28 +52,12 @@ tasks.register('acceptanceTests', Test) {

dependencies {
testImplementation project(":native:compress")
testImplementation project(":sequencer")

testImplementation "${besuArtifactGroup}:besu-datatypes"
testImplementation "${besuArtifactGroup}:evm"
testImplementation "${besuArtifactGroup}:plugin-api"
testImplementation project(":sequencer")

testImplementation "${besuArtifactGroup}.internal:algorithms"
testImplementation "${besuArtifactGroup}.internal:api"
testImplementation "${besuArtifactGroup}.internal:core"
testImplementation "${besuArtifactGroup}.internal:dsl"
testImplementation "${besuArtifactGroup}.internal:eth"
testImplementation "${besuArtifactGroup}.internal:metrics-core"

testImplementation 'io.tmio:tuweni-bytes'
testImplementation 'io.tmio:tuweni-units'

testImplementation 'org.web3j:abi'
testImplementation 'org.web3j:besu'
testImplementation 'org.web3j:core'

testImplementation 'org.awaitility:awaitility'
testImplementation 'com.splunk.logging:splunk-library-javalogging'
}

test.enabled = false
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ public void estimateGasFailsForExceedingModuleLineCountTest() throws Exception {
final var respLinea = reqLinea.execute(minerNode.nodeRequests());
assertThat(respLinea.getCode()).isEqualTo(-32000);
assertThat(respLinea.getMessage())
.isEqualTo("Transaction line count for module WCP=132 is above the limit 120");
.isEqualTo("Transaction line count for module SHF=32 is above the limit 20");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

import linea.plugin.acc.test.LineaPluginTestBase;
import linea.plugin.acc.test.TestCommandLineOptionsBuilder;
Expand Down Expand Up @@ -122,6 +124,36 @@ public void passingGasPriceFieldWorks() {
assertThat(respLinea.getResult()).isNotNull();
}

@Test
public void passingStateOverridesWorks() {

final Account sender = accounts.getSecondaryBenefactor();

final var actualBalance = minerNode.execute(ethTransactions.getBalance(sender));

assertThat(actualBalance).isGreaterThan(BigInteger.ONE);

final CallParams callParams =
new CallParams(
sender.getAddress(),
sender.getAddress(),
"1",
Bytes.EMPTY.toHexString(),
"0",
"0x1234");

final var zeroBalance = Map.of("balance", Wei.ZERO.toHexString());

final var stateOverrides = Map.of(accounts.getSecondaryBenefactor().getAddress(), zeroBalance);

final var reqLinea = new LineaEstimateGasRequest(callParams, stateOverrides);
final var respLinea = reqLinea.execute(minerNode.nodeRequests());
assertThat(respLinea.hasError()).isTrue();
assertThat(respLinea.getError().getMessage())
.isEqualTo(
"transaction up-front cost 0x208cbab601 exceeds transaction sender account balance 0x0");
}

@Test
public void lineaEstimateGasIsProfitable() {

Expand Down Expand Up @@ -258,17 +290,24 @@ protected void assertMinGasPriceLowerBound(final Wei baseFee, final Wei estimate
static class LineaEstimateGasRequest
implements Transaction<LineaEstimateGasRequest.LineaEstimateGasResponse> {
private final CallParams callParams;
private final Map<String, Map<String, String>> stateOverrides;

public LineaEstimateGasRequest(final CallParams callParams) {
this(callParams, null);
}

public LineaEstimateGasRequest(
final CallParams callParams, final Map<String, Map<String, String>> stateOverrides) {
this.callParams = callParams;
this.stateOverrides = stateOverrides;
}

@Override
public LineaEstimateGasResponse execute(final NodeRequests nodeRequests) {
try {
return new Request<>(
"linea_estimateGas",
List.of(callParams),
Arrays.asList(callParams, stateOverrides),
nodeRequests.getWeb3jService(),
LineaEstimateGasResponse.class)
.send();
Expand Down Expand Up @@ -337,4 +376,6 @@ static class RawEstimateGasResponse extends org.web3j.protocol.core.Response<Str

record CallParams(
String from, String to, String value, String data, String gas, String gasPrice) {}

record StateOverride(String account, String balance) {}
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
releaseVersion=0.1.4-test37
besuVersion=24.11-delivery39
releaseVersion=0.1.4-test38
besuVersion=24.12-delivery40
besuArtifactGroup=io.consensys.linea-besu
distributionIdentifier=besu-sequencer-plugins
distributionBaseUrl=https://artifacts.consensys.net/public/linea-besu/raw/names/linea-besu.tar.gz/versions/
14 changes: 14 additions & 0 deletions gradle/allowed-licenses.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
"moduleLicense": "Eclipse Distribution License - v 1.0",
"moduleLicenseUrl": "http://www.eclipse.org/legal/epl-v10.html"
},
{
"moduleLicense": "Eclipse Public License - v 1.0",
"moduleLicenseUrl": "http://www.eclipse.org/legal/epl-v10.html"
},
{
"moduleLicense": "Eclipse Public License - v 2.0",
"moduleLicenseUrl": "https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt"
Expand Down Expand Up @@ -64,6 +68,16 @@
{
"moduleName": "org.jetbrains.kotlin:kotlin-stdlib-common",
"moduleVersion": "1.9.22"
},
{
"moduleLicense": "CDDL-1.0",
"moduleVersion": "3.0.2",
"moduleName": "org.jupnp:org.jupnp"
},
{
"moduleLicense": "CDDL-1.0",
"moduleVersion": "3.0.2",
"moduleName": "org.jupnp:org.jupnp.support"
}
]
}
15 changes: 7 additions & 8 deletions gradle/common-dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,23 @@
dependencies {
api 'org.slf4j:slf4j-api'

implementation 'org.apache.logging.log4j:log4j-api'
implementation 'org.apache.logging.log4j:log4j-core'
implementation 'org.apache.logging.log4j:log4j-slf4j2-impl'

implementation 'commons-io:commons-io'
implementation 'com.slack.api:slack-api-client'

testImplementation 'org.apache.commons:commons-lang3'
testImplementation 'com.google.guava:guava'
testImplementation 'org.assertj:assertj-core'

testImplementation 'org.junit.jupiter:junit-jupiter-api'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testImplementation 'org.junit.jupiter:junit-jupiter-params'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'

testImplementation 'org.mockito:mockito-core'
testImplementation 'org.mockito:mockito-junit-jupiter'

testImplementation "org.wiremock:wiremock"
testImplementation 'org.wiremock:wiremock'

testRuntimeOnly 'org.apache.logging.log4j:log4j-api'
testRuntimeOnly 'org.apache.logging.log4j:log4j-core'
testRuntimeOnly 'org.apache.logging.log4j:log4j-slf4j2-impl'

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
102 changes: 7 additions & 95 deletions gradle/dependency-management.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,105 +57,17 @@ dependencyManagement {
generatedPomCustomization {
enabled = false
}
imports {
mavenBom "${besuArtifactGroup}:bom:${besuVersion}"
}

dependencies {
// Besu dependencies
dependencySet(group: "${besuArtifactGroup}", version: "${besuVersion}") {
entry "besu-datatypes"
entry "evm"
entry "plugin-api"
}

// Besu internal dependencies
dependencySet(group: "${besuArtifactGroup}.internal", version: "${besuVersion}") {
entry "algorithms"
entry "api"
entry "core"
entry "dsl"
entry "eth"
entry "rlp"
entry "besu"
entry "metrics-core"
}

dependencySet(group: 'ch.qos.logback', version: '1.5.6') {
entry 'logback-core'
entry 'logback-classic'
}

dependency 'com.fasterxml.jackson.core:jackson-databind:2.17.2'
dependency 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.17.2'
dependency 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.17.2'

dependency 'com.google.auto.service:auto-service:1.1.1'

dependency 'com.google.guava:guava:33.3.0-jre'

dependency 'commons-io:commons-io:2.16.1'
dependency 'com.google.code.gson:gson:2.11.0'

dependency 'com.slack.api:slack-api-client:1.32.1'

dependency 'com.splunk.logging:splunk-library-javalogging:1.11.8'

dependencySet(group: 'info.picocli', version: '4.7.6') {
entry 'picocli'
entry 'picocli-codegen'
}

dependency 'com.squareup.okhttp3:okhttp:4.12.0'

dependencySet(group: 'io.tmio', version: '2.4.2') {
entry 'tuweni-bytes'
entry 'tuweni-net'
entry 'tuweni-toml'
entry 'tuweni-units'
}

dependency 'io.vertx:vertx-core:4.5.9'

dependency 'net.java.dev.jna:jna:5.14.0'

dependency 'org.assertj:assertj-core:3.26.3'

dependency 'org.apache.commons:commons-lang3:3.17.0'

dependencySet(group: 'org.apache.logging.log4j', version: '2.23.1') {
entry 'log4j-api'
entry 'log4j-core'
entry 'log4j-slf4j2-impl'
}

dependency 'org.awaitility:awaitility:4.2.2'

dependencySet(group: 'org.bouncycastle', version: '1.78.1') {
entry 'bcpkix-jdk18on'
entry 'bcprov-jdk18on'
entry 'jcajce'
}

dependency 'org.hibernate.validator:hibernate-validator:8.0.1.Final'

dependencySet(group: 'org.junit.jupiter', version: '5.11.0') {
entry 'junit-jupiter-api'
entry 'junit-jupiter-engine'
entry 'junit-jupiter-params'
}
dependency 'org.junit.vintage:junit-vintage-engine:5.11.0'

dependencySet(group: 'org.mockito', version: '5.13.0') {
entry 'mockito-core'
entry 'mockito-junit-jupiter'
}

dependency 'org.slf4j:slf4j-api:2.0.16'

dependencySet(group: 'org.web3j', version: '4.12.1') {
entry 'abi'
entry 'besu'
entry 'core'
entry 'crypto'
}

dependency "org.wiremock:wiremock:3.9.1"
// ToDo: remove when fixed in Besu, force version to avoid conflict with previous version
dependency 'org.apache.logging.log4j:log4j-api:2.24.1'
dependency 'org.apache.logging.log4j:log4j-core:2.24.1'
}
}
46 changes: 18 additions & 28 deletions sequencer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,48 +32,38 @@ dependencies {
// annotationProcessor generates the file META-INF/services/org.hyperledger.besu.plugin.BesuPlugin
annotationProcessor 'com.google.auto.service:auto-service'

compileOnly "${besuArtifactGroup}:besu-datatypes"
compileOnly "${besuArtifactGroup}:evm"
compileOnly "${besuArtifactGroup}:plugin-api"
compileOnly "${besuArtifactGroup}.internal:algorithms"
compileOnly "${besuArtifactGroup}.internal:api"
compileOnly "${besuArtifactGroup}.internal:core"
compileOnly "${besuArtifactGroup}.internal:rlp"

compileOnly 'com.google.auto.service:auto-service'
compileOnly 'com.google.auto.service:auto-service-annotations'
implementation project(":native:compress")

compileOnly 'info.picocli:picocli'
implementation "${besuArtifactGroup}:besu-datatypes"
implementation "${besuArtifactGroup}:evm"
implementation "${besuArtifactGroup}:plugin-api"
implementation "${besuArtifactGroup}.internal:algorithms"
implementation "${besuArtifactGroup}.internal:api"
implementation "${besuArtifactGroup}.internal:core"
implementation "${besuArtifactGroup}.internal:rlp"

compileOnly 'io.vertx:vertx-core'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
implementation 'com.google.auto.service:auto-service'

compileOnly 'com.squareup.okhttp3:okhttp'
implementation 'com.google.code.gson:gson'

implementation project(":native:compress")
implementation 'com.slack.api:slack-api-client'

implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
implementation 'info.picocli:picocli'

implementation 'io.tmio:tuweni-bytes'
implementation 'io.tmio:tuweni-units'
implementation 'io.tmio:tuweni-toml'

implementation 'org.bouncycastle:bcprov-jdk18on'
implementation 'io.vertx:vertx-web'

implementation 'org.hibernate.validator:hibernate-validator'

testImplementation "${besuArtifactGroup}:evm"
testImplementation "${besuArtifactGroup}:besu-datatypes"
testImplementation "${besuArtifactGroup}:plugin-api"
testImplementation "${besuArtifactGroup}.internal:algorithms"
testImplementation "${besuArtifactGroup}.internal:core"
testImplementation "${besuArtifactGroup}.internal:rlp"
testImplementation "${besuArtifactGroup}:plugin-api"
testImplementation "${besuArtifactGroup}.internal:besu"
testImplementation "info.picocli:picocli"
testImplementation "org.awaitility:awaitility"

// workaround for bug https://github.com/dnsjava/dnsjava/issues/329, remove when upgraded upstream
testImplementation 'dnsjava:dnsjava:3.6.1'


testImplementation 'org.awaitility:awaitility'
}

configurations {
Expand Down
Loading

0 comments on commit 8620350

Please sign in to comment.