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

82 lines
2.3 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 }
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
Backward Sync should remember recent finalized blocks. (#3808) * Backward Sync is now remembering recent finalized blocks. When syncing using BWS we now consider finalized blocks reported by consensus layer. When no finalized block is specified, nothing strange will go on. When Finalized block is specified But Besu is not aware of any finalized block yet, we will sync as usual until the finalized block is about to get imported. A new invariant is introduced when importing blocks using BWS. All imported blocks has to descent from latest finalized block or a TTD block if we did not finalize yet. * Importing a finalized block updates the information in Besu Mutable Blockchain. * It is no longer possible to import blocks into the blockchain below a previously finalized block when using BWS * When a new finalized block gets announced while BWS is in progress and Besu already has it imported, the Mutable Blockchain gets updated, and the chain gets checked for possible pruning * When trying to import blocks of equal height as newly announced finalized block, then only the new announced finalized block will be possible to import using BWS * When importing a new block using BWS after finalized, we can now guarantee that the block descends from latest finalized block Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com> * BWS now has explicit parametrized check for how deep to sync Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com> * addressing review comments Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com> * Addressing review comment Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com> Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
2 years ago
knownHash = 'A/wa5e1GoPd1zLXgvMVI4eo29rC42gy0Il1mV5ocy2U='
}
check.dependsOn('checkAPIChanges')
publishing {
publications {
mavenJava(MavenPublication) {
groupId 'org.hyperledger.besu'
pom {
name = 'Besu Plugins Library'
description = 'Core Plugins Libraries for Besu'
}
}
}
}