Skip to content

Commit

Permalink
coordinator: update besu libs (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpnovais authored Oct 22, 2024
1 parent fad0db4 commit ab8a897
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 18 deletions.
1 change: 1 addition & 0 deletions coordinator/ethereum/models-helper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies {
implementation "org.hyperledger.besu:evm:${libs.versions.besu.get()}"
implementation "org.hyperledger.besu.internal:rlp:${libs.versions.besu.get()}"
implementation "org.hyperledger.besu.internal:core:${libs.versions.besu.get()}"
implementation "org.hyperledger.besu:plugin-api:${libs.versions.besu.get()}"

testImplementation project(":jvm-libs:linea:testing:teku-helper")
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,17 @@ import org.hyperledger.besu.ethereum.core.Block
import org.hyperledger.besu.ethereum.core.BlockBody
import org.hyperledger.besu.ethereum.core.BlockHeaderBuilder
import org.hyperledger.besu.ethereum.core.Difficulty
import org.hyperledger.besu.ethereum.core.encoding.EncodingContext
import org.hyperledger.besu.ethereum.core.encoding.TransactionDecoder
import org.hyperledger.besu.ethereum.mainnet.BodyValidation
import org.hyperledger.besu.ethereum.mainnet.MainnetBlockHeaderFunctions
import org.hyperledger.besu.evm.log.LogsBloomFilter
import tech.pegasys.teku.ethereum.executionclient.schema.ExecutionPayloadV1

object FakeRLPEncoder : ExecutionPayloadV1Encoder {
override fun encode(payload: ExecutionPayloadV1): ByteArray {
return ByteArray(0)
}
}

object ExecutionPayloadV1RLPEncoderByBesuImplementation : ExecutionPayloadV1Encoder {
override fun encode(payload: ExecutionPayloadV1): ByteArray {
val parsedTransactions = payload.transactions.map(TransactionDecoder::decodeOpaqueBytes)
val parsedTransactions = payload.transactions
.map { TransactionDecoder.decodeOpaqueBytes(it, EncodingContext.BLOCK_BODY) }
val parsedBody = BlockBody(parsedTransactions, emptyList())
val blockHeader =
BlockHeaderBuilder.create()
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spotless = { id = "com.diffplug.spotless", version = "6.16.0" }
jreleaser = {id = "org.jreleaser", version = "1.13.1"}

[versions]
besu = "22.4.2"
besu = "24.10.0"
caffeine = "3.1.6"
hoplite = "2.7.5"
jackson = "2.18.0"
Expand Down
2 changes: 1 addition & 1 deletion jvm-libs/linea/teku-execution-client/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'net.consensys.zkevm.kotlin-common-minimal-conventions'
id 'net.consensys.zkevm.kotlin-library-conventions'
id 'java-library'
}

Expand Down
3 changes: 2 additions & 1 deletion jvm-libs/linea/web3j-extensions/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ dependencies {
implementation "org.hyperledger.besu:besu-datatypes:${libs.versions.besu.get()}"
implementation "org.hyperledger.besu:evm:${libs.versions.besu.get()}"
implementation "org.hyperledger.besu.internal:core:${libs.versions.besu.get()}"
implementation "org.hyperledger.besu.internal:crypto:${libs.versions.besu.get()}"
implementation "org.hyperledger.besu.internal:algorithms:${libs.versions.besu.get()}"
implementation "org.hyperledger.besu:plugin-api:${libs.versions.besu.get()}"

testImplementation "org.apache.logging.log4j:log4j-slf4j2-impl:${libs.versions.log4j.get()}"
testImplementation "com.fasterxml.jackson.core:jackson-annotations:${libs.versions.jackson.get()}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import org.apache.tuweni.bytes.Bytes32
import org.apache.tuweni.units.bigints.UInt256
import org.bouncycastle.math.ec.custom.sec.SecP256K1Curve
import org.hyperledger.besu.crypto.SECPSignature
import org.hyperledger.besu.datatypes.AccessListEntry
import org.hyperledger.besu.datatypes.Address
import org.hyperledger.besu.datatypes.Wei
import org.hyperledger.besu.ethereum.core.Transaction
import org.hyperledger.besu.ethereum.core.encoding.EncodingContext
import org.hyperledger.besu.ethereum.core.encoding.TransactionEncoder
import org.hyperledger.besu.evm.AccessListEntry
import org.web3j.protocol.core.methods.response.EthBlock
import tech.pegasys.teku.ethereum.executionclient.schema.ExecutionPayloadV1
import tech.pegasys.teku.infrastructure.bytes.Bytes20
Expand Down Expand Up @@ -133,11 +134,5 @@ fun EthBlock.TransactionObject.toBytes(): Bytes {
}
.build()

if (signature != null) {
if (this.v != transaction.v.toLong()) {
throw RuntimeException("Transactions v values do not match: original=${this.v}, inferred=${transaction.v}")
}
}

return TransactionEncoder.encodeOpaqueBytes(transaction)
return TransactionEncoder.encodeOpaqueBytes(transaction, EncodingContext.BLOCK_BODY)
}

0 comments on commit ab8a897

Please sign in to comment.