Skip to content

Commit

Permalink
Merge branch 'main' into feat/129-enable-auto-deposit-erc20-bridge-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
VGau authored Jan 21, 2025
2 parents 3bbd9b6 + 39679c7 commit f62cf1f
Show file tree
Hide file tree
Showing 6 changed files with 158 additions and 28 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/reuse-github-release-besu-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Github Release for Besu Plugins
on:
workflow_call:
inputs:
pluginName:
required: true
type: string
description: 'plugin name used for the tag name, e.g staterecovery'
workspaceModulePath:
required: true
type: string
description: 'Path to plugin to release, e.g state-recovery/besu-plugin'
version:
required: true
type: string
description: 'Release semantic version: e.g "1.0.0"'
workflow_dispatch:
inputs:
pluginName:
required: true
type: string
description: 'plugin name used for the tag name, e.g staterecovery'
workspaceModulePath:
required: true
type: string
description: 'Path to plugin to release, e.g state-recovery/besu-plugin'
version:
required: true
type: string
description: 'Release semantic version: e.g "1.0.0"'

jobs:
release:
runs-on: gha-runner-scale-set-ubuntu-22.04-amd64-med
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

# Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Clean
# ./gradlew clean is necessary because the build is cached
# and cause issues with JReleaser
run: ./gradlew clean

- name: Build
run: |
GRAGLE_PATH=:$(echo "${{inputs.workspaceModulePath}}" | sed 's/\//:/g')
echo $GRAGLE_PATH
./gradlew $GRAGLE_PATH:shadowJar -Pversion=v${{inputs.version}}
ls -lh ${{inputs.workspaceModulePath}}/build/libs
- name: Release to GitHub
uses: jreleaser/release-action@v2
with:
arguments: full-release --git-root-search --basedir=${{ github.workspace }}/${{inputs.workspaceModulePath}} -P=version=v${{inputs.version}}
env:
GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN_RELEASE_ACCESS }}
JRELEASER_TAG_NAME: ${{inputs.pluginName}}-v${{inputs.version}}
JRELEASER_PROJECT_VERSION: ${{inputs.version}}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_GITHUB_USERNAME: ${{ github.actor }}
JRELEASER_GITHUB_EMAIL: ${{ github.actor }}@users.noreply.github.com

# Persist logs
- name: JReleaser release output
if: always()
uses: actions/upload-artifact@v4
with:
name: jreleaser-release
path: |
build/jreleaser/trace.log
build/jreleaser/output.properties
45 changes: 26 additions & 19 deletions .github/workflows/staterecovery-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,28 +60,35 @@ jobs:
- name: Staterecovery - Build plugin shadowJar
run: |
./gradlew state-recovery:besu-plugin:shadowJar
- name: Login to Docker Hub
if: ${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Run integration tests
timeout-minutes: 15
run: |
./gradlew state-recovery:test-cases:integrationTest
- name: Run Jacoco
- name: Run Jacoco Staterecovery
run: |
./gradlew jacocoRootReport
- name: Upload Jacoco test coverage report
uses: actions/upload-artifact@v4
with:
name: jacocoRootReport-${{ env.COMMIT_TAG }}.xml
if-no-files-found: error
path: |
${{ github.workspace }}/build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml
- name: Upload coverage to Codecov
if: ${{ env.CODECOV_TOKEN != '' }}
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
files: ${{ github.workspace }}/build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml
flags: kotlin
os: linux
name: codecov-staterecovery
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
# TMP disable as it conflicts with coordinator report
# - name: Upload Jacoco report Staterecovery
# uses: actions/upload-artifact@v4
# with:
# name: jacocoRootReport-${{ env.COMMIT_TAG }}.xml
# if-no-files-found: error
# path: |
# ${{ github.workspace }}/build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml
# - name: Upload coverage to Codecov Staterecovery
# if: ${{ env.CODECOV_TOKEN != '' }}
# uses: codecov/codecov-action@v5
# with:
# fail_ci_if_error: true
# files: ${{ github.workspace }}/build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml
# flags: kotlin
# os: linux
# name: codecov-staterecovery
# verbose: true
# token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 2 additions & 2 deletions docker/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -748,8 +748,8 @@ services:
- ./config/zkbesu-shomei/zkbesu-config.toml:/var/lib/besu/zkbesu-config.toml:ro
- ./config/zkbesu-shomei/log4j-staterecovery.xml:/var/lib/besu/log4j.xml:ro
- ./config/linea-local-dev-genesis-PoA-besu.json/:/var/lib/besu/genesis.json:ro
- ../state-recovery/besu-plugin/build/libs/linea-staterecovery-plugin-0.0.1-rc2.jar:/opt/besu/lib/linea-staterecovery-plugin-0.0.1-rc2.jar
- ../state-recovery/besu-plugin/build/libs/linea-staterecovery-plugin-0.0.1-rc2.jar:/opt/besu/plugins/linea-staterecovery-plugin-0.0.1-rc2.jar
- ../state-recovery/besu-plugin/build/libs/linea-staterecovery-besu-plugin-SNAPSHOT.jar:/opt/besu/lib/linea-staterecovery-besu-plugin-SNAPSHOT.jar
- ../state-recovery/besu-plugin/build/libs/linea-staterecovery-besu-plugin-SNAPSHOT.jar:/opt/besu/plugins/linea-staterecovery-besu-plugin-SNAPSHOT.jar

shomei-sr:
image: consensys/linea-shomei:2.3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import com.github.tomakehurst.wiremock.matching.EqualToPattern
import com.github.tomakehurst.wiremock.matching.RequestPatternBuilder
import io.micrometer.core.instrument.Tag
import io.micrometer.core.instrument.simple.SimpleMeterRegistry
import io.vertx.core.Future
import io.vertx.core.Vertx
import io.vertx.core.http.HttpClientOptions
import io.vertx.core.http.HttpVersion
Expand All @@ -31,6 +32,7 @@ import org.apache.logging.log4j.Level
import org.apache.logging.log4j.LogManager
import org.apache.logging.log4j.Logger
import org.assertj.core.api.Assertions.assertThat
import org.awaitility.Awaitility.await
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
Expand Down Expand Up @@ -350,18 +352,23 @@ class VertxHttpJsonRpcClientTest {
fun makesRequest_measuresRequest() {
replyRequestWith(JsonObject().put("jsonrpc", "2.0").put("id", "1").put("result", 3))

client.makeRequest(JsonRpcRequestListParams("2.0", 1, "randomNumber", emptyList())).get()
client.makeRequest(JsonRpcRequestListParams("2.0", 1, "randomNumber", emptyList())).get()
client.makeRequest(JsonRpcRequestListParams("2.0", 1, "randomNumber", emptyList())).get()
val requestsFutures = (1..100).map {
client.makeRequest(JsonRpcRequestListParams("2.0", 1, "randomNumber", emptyList()))
}
Future.all(requestsFutures).get()

val timer =
meterRegistry.timer(
"jsonrpc.request",
listOf(Tag.of("method", "randomNumber"), Tag.of("endpoint", "localhost"))
)

assertThat(timer).isNotNull
assertThat(timer.count()).isEqualTo(3)

await()
.atMost(2, TimeUnit.SECONDS)
.untilAsserted {
assertThat(timer.count()).isEqualTo(requestsFutures.size.toLong())
}
}

private fun replyRequestWith(jsonRpcResponse: JsonObject) {
Expand Down
5 changes: 3 additions & 2 deletions state-recovery/besu-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ plugins {
}

group = 'build.linea.staterecovery'
archivesBaseName = 'linea-staterecovery-plugin'
version = '0.0.1-rc2'
archivesBaseName = 'linea-staterecovery-besu-plugin'

dependencies {
compileOnly("info.picocli:picocli:${libs.versions.picoli.get()}") {
Expand Down Expand Up @@ -53,6 +52,8 @@ shadowJar {
if ("${project.version}" != 'unspecified') {
archiveClassifier.set('')
archiveVersion.set("${project.version}")
} else {
archiveClassifier.set('SNAPSHOT')
}

dependencies {
Expand Down
31 changes: 31 additions & 0 deletions state-recovery/besu-plugin/jreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
project:
name: staterecovery
description: Linea State Recovery Besu Plugin
longDescription: Besu Plugin to allow Linea rollup state recovery from L1 Blob data
links:
homepage: https://github.com/Consensys/linea-monorepo
authors:
- Linea automations
license: APACHE-2.0
inceptionYear: '2025'
stereotype: NONE
java:
version: '21'
groupId: build.linea
artifactId: linea-staterecovery-besu-plugin

release:
github:
overwrite: true
releaseName: 'State Recovery {{version}}'
changelog:
enabled: false
commitAuthor:
name: 'Linea automations'
email: 'linea-automations@consensys.net'

distributions:
staterecovery:
type: SINGLE_JAR
artifacts:
- path: 'build/libs/linea-staterecovery-besu-plugin-{{version}}.jar'

0 comments on commit f62cf1f

Please sign in to comment.