-
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.
Merge branch 'main' into rel/0.1.4-test25
- Loading branch information
Showing
68 changed files
with
3,370 additions
and
990 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,12 @@ jobs: | |
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
|
||
- name: Set up GCC | ||
uses: egor-tensin/setup-gcc@v1 | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
|
@@ -36,6 +42,12 @@ jobs: | |
acceptanceTest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
|
||
- name: Set up GCC | ||
uses: egor-tensin/setup-gcc@v1 | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
|
@@ -54,46 +66,50 @@ jobs: | |
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-report | ||
name: acceptance-test-report | ||
path: acceptance-tests/build/reports/tests/ | ||
|
||
tests: | ||
libCompressTest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: | | ||
${{ secrets.CONSTRAINTS_SSH_KEY }} | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
|
||
- name: Set up GCC | ||
uses: egor-tensin/setup-gcc@v1 | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
|
||
# The asset URL for the latest release can be found with: | ||
# curl -L -H "Accept: application/vnd.github+json" \ | ||
# -H "Authorization: Bearer YOUR_GH_API_TOKEN" \ | ||
# -H "X-GitHub-Api-Version: 2022-11-28" \ | ||
# https://api.github.com/repos/ConsenSys/corset/releases/latest | ||
# | jq '.assets[] | select(.name|endswith("x86_64-unknown-linux-musl.tar.gz")) | .url' | ||
- name: Install Corset | ||
run: | | ||
curl -L \ | ||
-H "Accept: application/octet-stream" \ | ||
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
-o corset.tar.gz \ | ||
https://api.github.com/repos/Consensys/corset/releases/assets/147491099 | ||
tar xzf corset.tar.gz | ||
mv corset $HOME | ||
echo $HOME >> $GITHUB_PATH | ||
- name: Run libcompress JNI tests | ||
run: ./gradlew :native:compress:test | ||
env: | ||
JAVA_OPTS: -Dorg.gradle.daemon=false | ||
|
||
- name: Upload test report | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: compress-test-report | ||
path: compress/build/reports/tests/ | ||
|
||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
|
||
- name: Run unit tests | ||
run: ./gradlew :arithmetization:test | ||
|
@@ -103,8 +119,8 @@ jobs: | |
- name: Upload test report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-report | ||
path: build/reports/tests/ | ||
name: unit-test-report | ||
path: arithmetization/build/reports/tests/ | ||
|
||
spotless: | ||
runs-on: ubuntu-latest | ||
|
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
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
67 changes: 67 additions & 0 deletions
67
...tests/src/test/java/linea/plugin/acc/test/rpc/linea/EstimateGasCompatibilityModeTest.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,67 @@ | ||
/* | ||
* 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 linea.plugin.acc.test.rpc.linea; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.math.BigDecimal; | ||
import java.math.RoundingMode; | ||
import java.util.List; | ||
|
||
import org.hyperledger.besu.datatypes.Wei; | ||
import org.hyperledger.besu.ethereum.core.Transaction; | ||
|
||
public class EstimateGasCompatibilityModeTest extends EstimateGasTest { | ||
private static final BigDecimal PRICE_MULTIPLIER = BigDecimal.valueOf(1.2); | ||
|
||
@Override | ||
public List<String> getTestCliOptions() { | ||
return getTestCommandLineOptionsBuilder() | ||
.set("--plugin-linea-estimate-gas-compatibility-mode-enabled=", "true") | ||
.set( | ||
"--plugin-linea-estimate-gas-compatibility-mode-multiplier=", | ||
PRICE_MULTIPLIER.toPlainString()) | ||
.build(); | ||
} | ||
|
||
@Override | ||
protected void assertIsProfitable( | ||
final Transaction tx, | ||
final Wei baseFee, | ||
final Wei estimatedPriorityFee, | ||
final Wei estimatedMaxGasPrice, | ||
final long estimatedGasLimit) { | ||
final var minGasPrice = minerNode.getMiningParameters().getMinTransactionGasPrice(); | ||
final var minPriorityFee = minGasPrice.subtract(baseFee); | ||
final var compatibilityMinPriorityFee = | ||
Wei.of( | ||
PRICE_MULTIPLIER | ||
.multiply(new BigDecimal(minPriorityFee.getAsBigInteger())) | ||
.setScale(0, RoundingMode.CEILING) | ||
.toBigInteger()); | ||
|
||
// since we are in compatibility mode, we want to check that returned profitable priority fee is | ||
// the min priority fee per gas * multiplier + base fee | ||
final var expectedMaxGasPrice = baseFee.add(compatibilityMinPriorityFee); | ||
assertThat(estimatedMaxGasPrice).isEqualTo(expectedMaxGasPrice); | ||
} | ||
|
||
@Override | ||
protected void assertMinGasPriceLowerBound(final Wei baseFee, final Wei estimatedMaxGasPrice) { | ||
// since we are in compatibility mode, we want to check that returned profitable priority fee is | ||
// the min priority fee per gas * multiplier + base fee | ||
assertIsProfitable(null, baseFee, null, estimatedMaxGasPrice, 0); | ||
} | ||
} |
Oops, something went wrong.