feat: move plugins into besu-plugins (#879)

* feat: move plugins into besu-plugins

* fix: naming of the besu-plugins folder

* feat: update description for pluginName

* feat: comment out unused task in gradle.build

* feat: align the same besu version used across all modules

* feat: removed vertx-helper dependency in message-anchoring module
This commit is contained in:
jonesho
2025-04-17 16:30:25 +08:00
committed by GitHub
parent 5b6f038b99
commit 74703cfd64
74 changed files with 106 additions and 49 deletions

View File

@@ -5,7 +5,7 @@ on:
pluginName:
required: true
type: string
description: 'plugin name used for the tag name, e.g staterecovery'
description: 'plugin name used for the tag name, e.g linea-staterecovery'
workspaceModulePath:
required: true
type: string
@@ -56,22 +56,22 @@ jobs:
- name: Build
run: |
GRAGLE_PATH=:$(echo "${{inputs.workspaceModulePath}}" | sed 's/\//:/g')
GRAGLE_PATH=:$(echo "besu-plugins/${{inputs.workspaceModulePath}}" | sed 's/\//:/g')
echo $GRAGLE_PATH
./gradlew $GRAGLE_PATH:shadowJar -Pversion=v${{inputs.version}}
ls -lh ${{inputs.workspaceModulePath}}/build/libs
ls -lh besu-plugins/${{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}}
arguments: full-release --git-root-search --basedir=${{github.workspace}}/besu-plugins/${{inputs.workspaceModulePath}} -P=version=v${{inputs.version}}
env:
GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN_RELEASE_ACCESS }}
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
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

View File

@@ -39,7 +39,7 @@ jobs:
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 #v4.2.1
- name: Staterecovery - Build and Unit tests
run: |
./gradlew state-recovery:besu-plugin:buildNeeded
./gradlew besu-plugins:state-recovery:besu-plugin:buildNeeded
# Install pnpm to deploy smart contracts
# FIXME: use web3j to deploy contracts and remove this.
- name: Setup nodejs environment
@@ -48,7 +48,7 @@ jobs:
pnpm-install-options: '--frozen-lockfile --prefer-offline --filter contracts --ignore-scripts'
- name: Staterecovery - Build plugin shadowJar
run: |
./gradlew state-recovery:besu-plugin:shadowJar
./gradlew besu-plugins:state-recovery:besu-plugin:shadowJar
- name: Login to Docker Hub
if: ${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}
uses: docker/login-action@v3
@@ -58,7 +58,7 @@ jobs:
- name: Run integration tests
timeout-minutes: 15
run: |
./gradlew state-recovery:test-cases:integrationTest
./gradlew besu-plugins:state-recovery:test-cases:integrationTest
# - name: Setup upterm session
# if: ${{ inputs.e2e-tests-with-ssh }}
# uses: lhotari/action-upterm@v1
@@ -68,7 +68,7 @@ jobs:
# run: |
# mkdir -p tmp/local/
# chmod -R a+w tmp/local/
# ./gradlew state-recovery:test-cases:e2eTest
# ./gradlew besu-plugins:state-recovery:test-cases:e2eTest
# TMP disable as it conflicts with coordinator report
# - name: Run Jacoco Staterecovery
# run: |

View File

@@ -71,19 +71,6 @@ dependencies {
implementation ("org.web3j:core:${libs.versions.web3j.get()}") {
exclude group: 'org.slf4j', module: 'slf4j-nop'
}
testImplementation 'org.hyperledger.besu:plugin-api:25.2.1-linea1'
testImplementation 'info.picocli:picocli:4.7.6'
testImplementation 'io.vertx:vertx-core'
}
tasks.register('copyShadowJarToLocalBesu', Copy) {
def jarFileSuffix = "${project.version}" != 'unspecified' ? "${project.version}" : "SNAPSHOT"
def jarFiles = project.getLayout().buildDirectory.dir("libs").get()
.asFileTree
.filter { it.name.endsWith("-${jarFileSuffix}.jar") }
.files
if (jarFiles.size() > 0) {
from jarFiles[0]
into file("$rootDir/tmp/linea-besu-sequencer/plugins")
}
}

View File

@@ -8,5 +8,5 @@ dependencies {
api(project(':jvm-libs:generic:extensions:kotlin'))
api(project(':jvm-libs:generic:serialization:jackson'))
api(project(':jvm-libs:linea:core:domain-models'))
api(project(':state-recovery:appcore:domain-models'))
api(project(':besu-plugins:state-recovery:appcore:domain-models'))
}

View File

@@ -14,8 +14,8 @@ dependencies {
api(project(':jvm-libs:linea:clients:linea-state-manager'))
api('build.linea:blob-decompressor:1.1.1')
api(project(':state-recovery:appcore:clients-interfaces'))
api(project(':state-recovery:appcore:domain-models'))
api(project(':besu-plugins:state-recovery:appcore:clients-interfaces'))
api(project(':besu-plugins:state-recovery:appcore:domain-models'))
api project(':jvm-libs:linea:besu-rlp-and-mappers')
api project(':jvm-libs:linea:besu-libs')

View File

@@ -0,0 +1,71 @@
plugins {
id 'net.consensys.zkevm.kotlin-library-conventions'
id 'com.gradleup.shadow' version '8.3.5'
}
group = 'build.linea.staterecovery'
archivesBaseName = 'linea-staterecovery-besu-plugin'
dependencies {
compileOnly("info.picocli:picocli:${libs.versions.picoli.get()}") {
because 'Required for command line parsing. Provided by Besu at runtime.'
}
implementation "org.jetbrains.kotlin:kotlin-reflect:1.9.21"
api(project(":jvm-libs:generic:vertx-helper"))
api(project(":jvm-libs:generic:serialization:jackson"))
api(project(":jvm-libs:linea:metrics:micrometer"))
api(project(":jvm-libs:linea:clients:linea-l1-contract-client"))
api(project(":jvm-libs:linea:web3j-extensions"))
api(project(":besu-plugins:state-recovery:appcore:logic"))
api(project(":besu-plugins:state-recovery:clients:blobscan-client"))
api(project(":besu-plugins:state-recovery:clients:eth-api"))
}
ext.groupsToIncludeInShadow = [
"build.linea.*",
"io.micrometer.*",
"org.jetbrains.kotlin:kotlin-reflect.*",
"org.jetbrains.kotlinx:kotlinx-datetime.*",
"tech.pegasys.teku.internal:async",
"com.michael-bull.kotlin-result:kotlin-result.*",
"com.fasterxml.jackson.module:jackson-module-kotlin",
]
def canIncludeLib(String lib) {
def allowed = groupsToIncludeInShadow.find { libAllowed ->
lib.matches(libAllowed)
} != null
allowed
}
tasks.create("testLibsInclusion", Task) {
// def lib = "build.linea.internal:kotlin-extensions"
doLast {
def lib = "com.michael-bull.kotlin-result:kotlin-result"
println("Can include $lib: ${canIncludeLib(lib)}")
}
}
shadowJar {
if ("${project.version}" != 'unspecified') {
archiveClassifier.set('')
archiveVersion.set("${project.version}")
} else {
archiveClassifier.set('SNAPSHOT')
}
dependencies {
exclude { dependency ->
!canIncludeLib("${dependency.moduleGroup}:${dependency.moduleName}")
}
}
manifest {
attributes(
'Specification-Title': archiveBaseName,
'Specification-Version': project.version,
'Implementation-Title': archiveBaseName,
'Implementation-Version': project.version,
)
}
}

View File

@@ -17,7 +17,7 @@ dependencies {
implementation(project(':jvm-libs:linea:clients:linea-state-manager'))
implementation(project(':jvm-libs:linea:core:domain-models'))
implementation(project(':jvm-libs:linea:core:long-running-service'))
implementation(project(':state-recovery:appcore:clients-interfaces'))
implementation(project(':besu-plugins:state-recovery:appcore:clients-interfaces'))
implementation("io.vertx:vertx-web-client:${libs.versions.vertx}")
testImplementation "com.github.tomakehurst:wiremock-jre8:${libs.versions.wiremock.get()}"

View File

@@ -7,5 +7,5 @@ dependencies {
implementation(project(':jvm-libs:linea:web3j-extensions'))
implementation(project(':jvm-libs:generic:serialization:jackson'))
api(project(':jvm-libs:generic:json-rpc'))
implementation(project(':state-recovery:appcore:clients-interfaces'))
implementation(project(':besu-plugins:state-recovery:appcore:clients-interfaces'))
}

View File

@@ -9,10 +9,10 @@ group = 'build.linea.staterecover'
dependencies {
implementation("io.vertx:vertx-core:${libs.versions.vertx.get()}")
implementation(project(':state-recovery:appcore:logic'))
implementation(project(':state-recovery:besu-plugin'))
implementation(project(':state-recovery:clients:eth-api'))
implementation(project(':state-recovery:clients:blobscan-client'))
implementation(project(':besu-plugins:state-recovery:appcore:logic'))
implementation(project(':besu-plugins:state-recovery:besu-plugin'))
implementation(project(':besu-plugins:state-recovery:clients:eth-api'))
implementation(project(':besu-plugins:state-recovery:clients:blobscan-client'))
implementation('build.linea:l1-rollup-contract-client:6.0.0')
implementation project(':jvm-libs:generic:vertx-helper')
implementation project(':jvm-libs:generic:extensions:kotlin')

View File

@@ -3,7 +3,6 @@ plugins {
}
dependencies {
implementation project(':jvm-libs:generic:vertx-helper')
implementation project(':jvm-libs:generic:extensions:futures')
implementation project(':coordinator:core')
implementation project(':coordinator:clients:smart-contract-client')

View File

@@ -637,7 +637,7 @@ 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-besu-plugin-SNAPSHOT.jar:/opt/besu/plugins/linea-staterecovery-besu-plugin-SNAPSHOT.jar
- ../besu-plugins/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

View File

@@ -19,6 +19,7 @@ restassured = "5.3.0"
wiremock = "3.0.1"
# Runtime
besu = "25.2.1-linea1"
blobCompressor = "0.0.4"
blobShnarfCalculator = "0.0.4"
bouncycastle = "1.79"

View File

@@ -4,7 +4,7 @@ plugins {
}
def besuArtifactGroup="org.hyperledger.besu"
def besuVersion="25.2.1-linea1"
def besuVersion="${libs.versions.besu.get()}"
dependencies {
api("${besuArtifactGroup}:besu-datatypes:${besuVersion}") {

View File

@@ -55,7 +55,6 @@ include 'coordinator:persistence:db-common'
include 'coordinator:ethereum:gas-pricing'
include 'coordinator:ethereum:gas-pricing:static-cap'
include 'coordinator:ethereum:gas-pricing:dynamic-cap'
include 'finalized-tag-updater'
include 'testing-tools'
include 'testing-tools:app'
include 'traces-api-facade:app'
@@ -65,11 +64,11 @@ include 'transaction-decoder-tool'
include 'transaction-exclusion-api:app'
include 'transaction-exclusion-api:core'
include 'transaction-exclusion-api:persistence:rejectedtransaction'
include 'state-recovery:appcore:clients-interfaces'
include 'state-recovery:appcore:domain-models'
include 'state-recovery:appcore:logic'
include 'state-recovery:besu-plugin'
include 'state-recovery:clients:blobscan-client'
include 'state-recovery:clients:eth-api'
include 'state-recovery:test-cases'
include 'besu-plugins:finalized-tag-updater'
include 'besu-plugins:state-recovery:appcore:clients-interfaces'
include 'besu-plugins:state-recovery:appcore:domain-models'
include 'besu-plugins:state-recovery:appcore:logic'
include 'besu-plugins:state-recovery:besu-plugin'
include 'besu-plugins:state-recovery:clients:blobscan-client'
include 'besu-plugins:state-recovery:clients:eth-api'
include 'besu-plugins:state-recovery:test-cases'

View File

@@ -16,9 +16,9 @@ dependencies {
api(project(":jvm-libs:linea:metrics:micrometer"))
api(project(":jvm-libs:linea:clients:linea-l1-contract-client"))
api(project(":jvm-libs:linea:web3j-extensions"))
api(project(":state-recovery:appcore:logic"))
api(project(":state-recovery:clients:blobscan-client"))
api(project(":state-recovery:clients:eth-api"))
api(project(":besu-plugins:state-recovery:appcore:logic"))
api(project(":besu-plugins:state-recovery:clients:blobscan-client"))
api(project(":besu-plugins:state-recovery:clients:eth-api"))
}
ext.groupsToIncludeInShadow = [