An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client https://wiki.hyperledger.org/display/besu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
besu/plugin-api/build.gradle

83 lines
2.4 KiB

/*
* Copyright 2019 ConsenSys AG.
*
* 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.
*/
import java.security.MessageDigest
apply plugin: 'java-library'
jar {
archiveBaseName = 'plugin-api'
manifest {
attributes(
'Specification-Title': archiveBaseName,
'Specification-Version': project.version,
'Implementation-Title': archiveBaseName,
'Implementation-Version': calculateVersion()
)
}
}
dependencies {
api 'org.apache.tuweni:tuweni-bytes'
api 'org.apache.tuweni:tuweni-units'
}
configurations { testArtifacts }
artifacts { testSupportArtifacts testSupportJar }
class FileStateChecker extends DefaultTask {
@Input
Set<File> files
@Input
String knownHash
@TaskAction
def CheckState() {
def digestor = MessageDigest.getInstance("SHA-256")
this.files.toSorted(Comparator.comparing({it.canonicalPath})).each {
digestor.update(it.readBytes())
}
def currentHash = digestor.digest().encodeBase64().toString()
if (this.knownHash != currentHash) {
throw new GradleException("""For the Plugin APIs the checksum of the project did not match what was expected.
If this is a deliberate change where you have thought through backwards compatibility,
then update "Expected" for "Calculated" in the appropriate build.gradle as the knownHash for this task.
Expected : ${this.knownHash}
Calculated : ${currentHash}
""")
}
}
}
tasks.register('checkAPIChanges', FileStateChecker) {
description = "Checks that the API for the Plugin-API project does not change without deliberate thought"
files = sourceSets.main.allJava.files
[EIP-1559] Step 2 - Apply transaction structure modification (#620) * Added changelog entries for PR: - https://github.com/hyperledger/besu/pull/430 - https://github.com/hyperledger/besu/pull/440 Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * ### Description BlockHeader object needs to be modified in order to add the new field (baseFee) as specified in the EIP. We should take care about the RLP encoding/decoding of this structure since it has to include or not the new fields depending on whether we are pre fork or post fork. - Update `core.BlockHeader.java` - Add `baseFee` - Update `readFrom` method for RLP decoding - Update `writeTo` method for RLP encoding - Update `plugin.data.BlockHeader.java` - Add `getBaseFee` method Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * ### Description Transaction object needs to be modified in order to add the 2 new fields (`gasPremium` and `feeCap`) as specified in the EIP. We should take care about the RLP encoding/decoding of this structure since it has to include or not the new fields depending on whether we are pre fork or post fork. - Update core `Transaction` object - Add gasPremium and feeCap fields - Update readFrom method for RLP decoding - Update writeTo method for RLP encoding - Update plugin `Transaction` interface - Add `getGasPremium` and `getFeeCap` methods This EIP introduces gasPremium and feeCap fields in the transaction. They need to be included in the signing mechanism. Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * TODO Add CLI command line flag `--Xeip1559-enabled`. Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * Remove TODO Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * spotless apply Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * Merge step 0 and make EIP-1559 specific fields optional Add feature flag guard for RLP encoding / decoding of transactions Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * fix error Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * Address PR comments Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net> * update plugin api known hash Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
5 years ago
knownHash = 'NBD1ERyo7NhRpiiRvFg1s5O7mulJGUAOJNldnzhD3M4='
}
check.dependsOn('checkAPIChanges')
publishing {
publications {
mavenJava(MavenPublication) {
groupId 'org.hyperledger.besu'
pom {
name = 'Besu Plugins Library'
description = 'Core Plugins Libraries for Besu'
}
}
}
}