Skip to content

Commit

Permalink
Merge branch 'main' into fix-typo
Browse files Browse the repository at this point in the history
  • Loading branch information
savvar9991 authored Feb 3, 2025
2 parents 2a14f5c + 0a0ef9f commit 3cab052
Show file tree
Hide file tree
Showing 21 changed files with 326 additions and 179 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ jobs:
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Build without tests
run: ./gradlew build -PreleaseNativeLibs -PreleaseVersion=${{ steps.get_version.outputs.VERSION }} -x test -x spotlessCheck
- name: Build artifacts
run: ./gradlew artifacts -PreleaseNativeLibs -PreleaseVersion=${{ steps.get_version.outputs.VERSION }}
env:
JAVA_OPTS: -Xmx2g -Dorg.gradle.daemon=false

Expand All @@ -75,7 +75,7 @@ jobs:
draft: true
prerelease: false

- name: Upload Release Asset
- name: Upload Release Lib Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
Expand All @@ -85,3 +85,14 @@ jobs:
asset_path: ./sequencer/build/libs/linea-sequencer-${{ steps.get_version.outputs.VERSION }}.jar
asset_name: linea-sequencer-${{ steps.get_version.outputs.VERSION }}.jar
asset_content_type: application/octet-stream

- name: Upload Release Dist Asset
id: upload-release-dist-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./sequencer/build/distributions/linea-sequencer-${{ steps.get_version.outputs.VERSION }}.zip
asset_name: linea-sequencer-${{ steps.get_version.outputs.VERSION }}.zip
asset_content_type: application/octet-stream
14 changes: 12 additions & 2 deletions acceptance-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,25 @@ tasks.register('acceptanceTests', Test) {
}

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

testImplementation project(":sequencer")
testImplementation project(':sequencer')

testImplementation "${besuArtifactGroup}:besu-datatypes"
testImplementation "${besuArtifactGroup}.internal:api"
testImplementation "${besuArtifactGroup}.internal:core"
testImplementation "${besuArtifactGroup}.internal:dsl"
testImplementation "${besuArtifactGroup}.internal:eth"
testImplementation "${besuArtifactGroup}.internal:metrics-core"
testImplementation "${besuArtifactGroup}.internal:services"

testImplementation 'net.consensys.linea.zktracer:arithmetization'

testImplementation 'org.awaitility:awaitility'
}

test.enabled = false

jar {
enabled = false
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void lineaEstimateGasPriorityFeeMinGasPriceLowerBound() {
final Account sender = accounts.getSecondaryBenefactor();

final CallParams callParams =
new CallParams(null, sender.getAddress(), null, "", "", "0", null, null, null);
new CallParams(null, sender.getAddress(), null, null, "", "", "0", null, null, null);

final var reqLinea = new LineaEstimateGasRequest(callParams);
final var respLinea = reqLinea.execute(minerNode.nodeRequests()).getResult();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public void estimateGasFailsForExceedingModuleLineCountTest() throws Exception {
new EstimateGasTest.CallParams(
null,
sender.getAddress(),
null,
simpleStorage.getContractAddress(),
null,
payload.toHexString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public void lineaEstimateGasMatchesEthEstimateGas() {
new CallParams(
null,
sender.getAddress(),
null,
sender.getAddress(),
null,
Bytes.EMPTY.toHexString(),
Expand All @@ -123,6 +124,7 @@ public void passingGasPriceFieldWorks() {
new CallParams(
null,
sender.getAddress(),
null,
sender.getAddress(),
null,
Bytes.EMPTY.toHexString(),
Expand All @@ -146,6 +148,7 @@ public void passingChainIdFieldWorks() {
new CallParams(
"0x539",
sender.getAddress(),
null,
sender.getAddress(),
null,
Bytes.EMPTY.toHexString(),
Expand All @@ -169,6 +172,7 @@ public void passingEIP1559FieldsWorks() {
new CallParams(
null,
sender.getAddress(),
null,
sender.getAddress(),
null,
Bytes.EMPTY.toHexString(),
Expand All @@ -192,6 +196,7 @@ public void passingChainIdAndEIP1559FieldsWorks() {
new CallParams(
"0x539",
sender.getAddress(),
null,
sender.getAddress(),
null,
Bytes.EMPTY.toHexString(),
Expand Down Expand Up @@ -219,6 +224,7 @@ public void passingStateOverridesWorks() {
new CallParams(
"0x539",
sender.getAddress(),
null,
sender.getAddress(),
"1",
Bytes.EMPTY.toHexString(),
Expand All @@ -239,6 +245,49 @@ public void passingStateOverridesWorks() {
"transaction up-front cost 0x208cbab601 exceeds transaction sender account balance 0x0");
}

@Test
public void passingNonceWorks() {

final Account sender = accounts.getSecondaryBenefactor();

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

final var reqLinea = new LineaEstimateGasRequest(callParams);
final var respLinea = reqLinea.execute(minerNode.nodeRequests());
assertThat(respLinea.hasError()).isFalse();
assertThat(respLinea.getResult()).isNotNull();

// try with a future nonce
final CallParams callParamsFuture =
new CallParams(
null,
sender.getAddress(),
"10",
sender.getAddress(),
null,
Bytes.EMPTY.toHexString(),
"0",
null,
"0x1234",
null);

final var reqLineaFuture = new LineaEstimateGasRequest(callParamsFuture);
final var respLineaFuture = reqLineaFuture.execute(minerNode.nodeRequests());
assertThat(respLineaFuture.hasError()).isFalse();
assertThat(respLineaFuture.getResult()).isNotNull();
}

@Test
public void lineaEstimateGasIsProfitable() {

Expand All @@ -259,6 +308,7 @@ public void lineaEstimateGasIsProfitable() {
new CallParams(
null,
sender.getAddress(),
null,
sender.getAddress(),
null,
payload.toHexString(),
Expand Down Expand Up @@ -320,6 +370,7 @@ public void invalidParametersLineaEstimateGasRequestReturnErrorResponse() {
null,
sender.getAddress(),
null,
null,
"",
"",
String.valueOf(Integer.MAX_VALUE),
Expand All @@ -341,6 +392,7 @@ public void revertedTransactionReturnErrorResponse() throws Exception {
new CallParams(
null,
sender.getAddress(),
null,
simpleStorage.getContractAddress(),
"",
"",
Expand All @@ -363,6 +415,7 @@ public void failedTransactionReturnErrorResponse() {
null,
sender.getAddress(),
null,
null,
"",
Accounts.GENESIS_ACCOUNT_TWO_PRIVATE_KEY,
"0",
Expand All @@ -371,7 +424,8 @@ public void failedTransactionReturnErrorResponse() {
null));
final var respLinea = reqLinea.execute(minerNode.nodeRequests());
assertThat(respLinea.getCode()).isEqualTo(-32000);
assertThat(respLinea.getMessage()).isEqualTo("Failed transaction, reason: INVALID_OPERATION");
assertThat(respLinea.getMessage())
.isEqualTo("Failed transaction, reason: Invalid opcode: 0xc8");
}

@Test
Expand Down Expand Up @@ -491,6 +545,7 @@ static class RawEstimateGasResponse extends org.web3j.protocol.core.Response<Str
record CallParams(
String chainId,
String from,
String nonce,
String to,
String value,
String data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package linea.plugin.acc.test.rpc.linea;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import java.math.BigInteger;
import java.util.ArrayList;
Expand All @@ -23,7 +24,6 @@
import linea.plugin.acc.test.LineaPluginTestBase;
import linea.plugin.acc.test.TestCommandLineOptionsBuilder;
import linea.plugin.acc.test.tests.web3j.generated.RevertExample;
import linea.plugin.acc.test.tests.web3j.generated.SimpleStorage;
import org.hyperledger.besu.datatypes.Hash;
import org.hyperledger.besu.tests.acceptance.dsl.account.Account;
import org.hyperledger.besu.tests.acceptance.dsl.account.Accounts;
Expand Down Expand Up @@ -54,33 +54,10 @@ public List<String> getTestCliOptions() {

@Test
public void transactionOverModuleLineCountNotAccepted() throws Exception {
final SimpleStorage simpleStorage = deploySimpleStorage();
final Web3j web3j = minerNode.nodeRequests().eth();
final String contractAddress = simpleStorage.getContractAddress();
final String txData = simpleStorage.add(BigInteger.valueOf(100)).encodeFunctionCall();

// this tx will not be accepted since it goes above the line count limit
final RawTransaction txModuleLineCountTooBig =
RawTransaction.createTransaction(
CHAIN_ID,
BigInteger.valueOf(1),
GAS_LIMIT.divide(BigInteger.TEN),
contractAddress,
VALUE,
txData,
GAS_PRICE,
GAS_PRICE.multiply(BigInteger.TEN).add(BigInteger.ONE));
final byte[] signedTxContractInteraction =
TransactionEncoder.signMessage(
txModuleLineCountTooBig, Credentials.create(Accounts.GENESIS_ACCOUNT_TWO_PRIVATE_KEY));

final EthSendTransaction signedTxContractInteractionResp =
web3j.ethSendRawTransaction(Numeric.toHexString(signedTxContractInteraction)).send();

assertThat(signedTxContractInteractionResp.hasError()).isTrue();
assertThat(signedTxContractInteractionResp.getError().getMessage())
.isEqualTo(
"Transaction 0xe813560d9a3aedff46be12fc32706d8fe9b6565dd7e2db47457a9c416f2d45d7 line count for module ADD=2017 is above the limit 70");
assertThatThrownBy(() -> deploySimpleStorage())
.hasMessage(
"JsonRpcError thrown with code -32000. Message: Transaction 0x63ea5c9ec0f0fae53683c1b5f1998fe806f1ad5b655a1d03a9771f1976be45a9 line count for module ROM=2369 is above the limit 2300");

assertThat(getTxPoolContent()).isEmpty();

Expand Down
4 changes: 2 additions & 2 deletions acceptance-tests/src/test/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
<Configuration level="INFO">
<Properties>
<Property name="root.log.level">TRACE</Property>
</Properties>
Expand All @@ -13,4 +13,4 @@
<AppenderRef ref="Console" />
</Root>
</Loggers>
</Configuration>
</Configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ EUC = 16384 # can probably be lower
EXP = 32760
EXT = 20
GAS = 262144
HUB = 174
HUB = 176
MMIO = 1048576
MMU = 524288
MOD = 20
MUL = 20
MXP = 35
PHONEY_RLP = 65536 # can probably get lower
ROM = 2402
ROM = 2300
ROM_LEX = 20
SHF = 63
TX_RLP = 131072
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ EUC = 16384 # can probably be lower
EXP = 32760
EXT = 20
GAS = 262144
HUB = 51
HUB = 52
MMIO = 1048576
MMU = 524288
MOD = 20
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
releaseVersion=0.8.0-rc8.4
besuVersion=24.12-delivery41
arithmetizationVersion=0.8.0-rc8
releaseVersion=1.2.0-rc3.2
besuVersion=25.1-delivery45
arithmetizationVersion=beta-v1.2.0-rc3
besuArtifactGroup=io.consensys.linea-besu
distributionIdentifier=linea-sequencer
distributionBaseUrl=https://artifacts.consensys.net/public/linea-besu/raw/names/linea-besu.tar.gz/versions/
18 changes: 12 additions & 6 deletions gradle/build-aliases.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@
*/

// Default tasks and build aliases
defaultTasks 'build', 'checkLicense', 'javadoc', 'jar'
defaultTasks 'build', 'checkLicense', 'javadoc', 'artifacts'

def buildAliases = ['dev': [
'spotlessApply',
'build',
'checkLicense',
]]
def buildAliases = [
'dev': [
'spotlessApply',
'build',
'checkLicenses'
],
'artifacts' : [
'jar',
'distPlugin'
]
]

def expandedTaskList = []
gradle.startParameter.taskNames.each {
Expand Down
3 changes: 1 addition & 2 deletions gradle/common-dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

dependencies {
api 'org.slf4j:slf4j-api'
implementation 'org.slf4j:slf4j-api'

testImplementation 'org.apache.commons:commons-lang3'
testImplementation 'com.google.guava:guava'
Expand All @@ -28,7 +28,6 @@ dependencies {

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'

Expand Down
Loading

0 comments on commit 3cab052

Please sign in to comment.