Skip to content

Commit

Permalink
Merge branch 'develop' into 14293-skip-codacy-checks
Browse files Browse the repository at this point in the history
  • Loading branch information
rbarkerSL committed Sep 19, 2024
2 parents 1d79e1c + 7e2f3ca commit d98402d
Show file tree
Hide file tree
Showing 397 changed files with 26,100 additions and 24,722 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/node-zxc-compile-application-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,9 @@ jobs:
) &&
!cancelled()
}}
run: sed -i 's/^org.gradle.configuration-cache=.*$/org.gradle.configuration-cache=false/' gradle.properties
run: |
sed -i 's/^org.gradle.configuration-cache=.*$/org.gradle.configuration-cache=false/' gradle.properties
touch build.gradle.kts
- name: Setup Snyk
env:
Expand Down
17 changes: 0 additions & 17 deletions build.gradle.kts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ plugins {
// tasks from the 'build' group
defaultTasks("tasks")

tasks.named<TaskReportTask>("tasks") {
if (!isDetail) {
displayGroup = "build"
}
}

tasks.register("qualityGate") {
group = "build"
description = "Apply spotless rules and run all quality checks."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,23 @@ plugins {

// Configure Protobuf Plugin to download protoc executable rather than using local installed version
protobuf {
val libs = the<VersionCatalogsExtension>().named("libs")
protoc { artifact = "com.google.protobuf:protoc:" + libs.findVersion("google-proto").get() }
protoc { artifact = "com.google.protobuf:protoc" }
plugins {
// Add GRPC plugin as we need to generate GRPC services
id("grpc") {
artifact = "io.grpc:protoc-gen-grpc-java:" + libs.findVersion("grpc-proto").get()
}
id("grpc") { artifact = "io.grpc:protoc-gen-grpc-java" }
}
generateProtoTasks {
all().configureEach { plugins { id("grpc") { option("@generated=omit") } } }
}
}

sourceSets.all {
val compileProtoPath = getTaskName("", "compileProtoPath")
dependencies {
// For dependencies of protobuf compilation use versions from 'hedera-dependency-versions',
// but not 'runtime' dependencies of the platform (JAVA_API instead of JAVA_RUNTIME).
dependencies {
compileProtoPath(project(":hedera-dependency-versions")) {
attributes {
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_API))
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.REGULAR_PLATFORM))
}
}
configurations.configureEach {
if (name.startsWith("protobufToolsLocator") || name.endsWith("ProtoPath")) {
attributes { attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_API)) }
exclude(group = project.group.toString(), module = project.name)
withDependencies {
isTransitive = true
extendsFrom(configurations["internal"])
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
* limitations under the License.
*/

import org.gradlex.javamodule.dependencies.initialization.JavaModulesExtension
import org.gradlex.javamodule.dependencies.initialization.RootPluginsExtension

pluginManagement {
repositories {
gradlePluginPortal()
Expand All @@ -27,6 +30,10 @@ plugins {
id("org.gradlex.java-module-dependencies")
}

// Plugins that are global, but are applied to the "root project" instead of settings.
// by having this block here, we do not require a "build.gradle.kts" in the repository roots.
configure<RootPluginsExtension> { id("com.hedera.gradle.root") }

// Enable Gradle Build Scan
develocity {
buildScan {
Expand Down Expand Up @@ -63,3 +70,11 @@ buildCache {
// https://docs.gradle.org/current/userguide/composite_builds.html#included_build_declaring_substitutions
// Some functionality of the 'java-module-dependencies' plugin relies on this.
includeBuild(".")

configure<JavaModulesExtension> {
// Project to aggregate code coverage data for the whole repository into one report
module("gradle/reports")

// "BOM" with versions of 3rd party dependencies
versions("hedera-dependency-versions")
}
2 changes: 1 addition & 1 deletion hapi/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ plugins {
id("com.hedera.gradle.protobuf")
id("com.hedera.gradle.services-publish")
id("com.hedera.gradle.feature.test-fixtures")
alias(libs.plugins.pbj)
id("com.hedera.pbj.pbj-compiler") version "0.9.2"
}

description = "Hedera API"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ option java_multiple_files = true;
* This value MUST be transmitted in the "state changes" section of
* _each_ block, but MUST be updated at the beginning of the _next_ block.<br/>
* This value SHALL contain the block hash up to, and including, the
* immediately prior completed block.
* immediately prior completed block.<br/>
* The state change to update this singleton MUST be the last "output"
* block item in this block.
*/
message BlockStreamInfo {
/**
Expand Down Expand Up @@ -92,4 +94,41 @@ message BlockStreamInfo {
* The maximum length of this field SHALL be 8192 bytes.
*/
bytes trailing_block_hashes = 4;

/**
* A SHA2-384 hash value.<br/>
* This is the hash of the "input" subtree for this block.
*/
bytes input_tree_root_hash = 5;

/**
* A SHA2-384 hash value.<br/>
* This is the hash of consensus state at the _start_ of this block.
*/
bytes start_of_block_state_hash = 6;

/**
* A count of "output" block items in this block.
* <p>
* This SHALL count the number of output block items that _precede_
* the state change that updates this singleton.
*/
uint32 num_preceding_output_items = 7;

/**
* A concatenation of SHA2-384 hash values.<br/>
* This is the "rightmost" values of the "output" subtree.
* <p>
* The subtree containing these hashes SHALL be constructed from all "output"
* `BlockItem`s in this block that _precede_ the update to this singleton.
*/
repeated bytes rightmost_preceding_output_tree_hashes = 8;

/**
* A block-end consensus time stamp.
* <p>
* This field SHALL hold the last-used consensus time for
* the current block.
*/
proto.Timestamp block_end_time = 9;
}
2 changes: 1 addition & 1 deletion hapi/hedera-protobufs/services/state/roster/roster.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ message Roster {
* This list SHALL contain roster entries in natural order of ascending node ids.
* This list SHALL NOT be empty.<br/>
*/
repeated RosterEntry rosters = 1;
repeated RosterEntry roster_entries = 1;
}

/**
Expand Down
7 changes: 6 additions & 1 deletion hedera-dependency-versions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ dependencies {
api(enforcedPlatform("io.netty:netty-bom:4.1.110.Final"))

// forward logging from modules using SLF4J (e.g. 'org.hyperledger.besu.evm') to Log4J
runtime(javaModuleDependencies.gav("org.apache.logging.log4j.slf4j2.impl"))
runtime("org.apache.logging.log4j:log4j-slf4j2-impl") {
because("org.apache.logging.log4j.slf4j2.impl")
}
}

dependencies.constraints {
Expand Down Expand Up @@ -221,4 +223,7 @@ dependencies.constraints {
api("uk.org.webcompere:system-stubs-jupiter:2.1.5") {
because("uk.org.webcompere.systemstubs.jupiter")
}

api("com.google.protobuf:protoc:3.25.4")
api("io.grpc:protoc-gen-grpc-java:1.66.0")
}
2 changes: 2 additions & 0 deletions hedera-node/configuration/dev/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ balances.exportDir.path=data/accountBalances/
upgrade.artifacts.path=data/upgrade
contracts.chainId=298
contracts.maxGasPerSec=15000000000
contracts.systemContract.tokenInfo.v2.enabled=true
contracts.systemContract.updateNFTsMetadata.enabled=true
# Needed for end-end tests running on mod-service code
staking.periodMins=1
staking.fees.nodeRewardPercentage=10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
#Overrides that differ based on the network
bootstrap.genesisPublicKey=c249a323c878f5b5e2daccda6d731e6fdc32f870228d1cd4fae559d947dbc36c
contracts.chainId=297
contracts.systemContract.updateNFTsMetadata.enabled=true
ledger.id=0x02
entities.unlimitedAutoAssociationsEnabled=true
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ private ParsingConstants() {
"(" + "string,string,address,string,bool,int64,bool," + TOKEN_KEY + ARRAY_BRACKETS + "," + EXPIRY + ")";
public static final String HEDERA_TOKEN_V3 =
"(" + "string,string,address,string,bool,int64,bool," + TOKEN_KEY + ARRAY_BRACKETS + "," + EXPIRY_V2 + ")";
public static final String HEDERA_TOKEN_V4 = "(" + "string,string,address,string,bool,uint32,bool," + TOKEN_KEY
+ ARRAY_BRACKETS + "," + EXPIRY + ",bytes" + ")";
public static final String TOKEN_INFO = "("
+ HEDERA_TOKEN_V2
+ ",int64,bool,bool,bool,"
Expand Down Expand Up @@ -135,8 +137,11 @@ public enum FunctionType {
HAPI_TRANSFER_FROM_NFT,
HAPI_GET_APPROVED,
HAPI_GET_FUNGIBLE_TOKEN_INFO,
HAPI_GET_FUNGIBLE_TOKEN_INFO_V2,
HAPI_GET_TOKEN_INFO,
HAPI_GET_TOKEN_INFO_V2,
HAPI_GET_NON_FUNGIBLE_TOKEN_INFO,
HAPI_GET_NON_FUNGIBLE_TOKEN_INFO_V2,
HAPI_IS_APPROVED_FOR_ALL,
HAPI_IS_KYC,
GET_TOKEN_DEFAULT_FREEZE_STATUS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void invalidBytesInPemCannotRead() throws IOException {
final var genPemPath = Path.of(tmpDir.getPath() + "/generated.pem");
writeCertificatePemFile(genPemPath, Bytes.wrap("anyString").toByteArray());
final var exception = assertThrows(IOException.class, () -> readCertificatePemFile(genPemPath));
assertThat(exception.getMessage()).contains("problem parsing cert: java.io.IOException:");
assertThat(exception.getMessage()).contains("problem parsing cert: java.io.EOFException:");
final var msg = assertThrows(PreCheckException.class, () -> validateX509Certificate(Bytes.wrap("anyString")));
assertEquals(ResponseCodeEnum.INVALID_GOSSIP_CA_CERTIFICATE, msg.responseCode());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
import java.util.Objects;
import java.util.Spliterators;
import java.util.stream.StreamSupport;
import org.testcontainers.shaded.org.bouncycastle.cert.X509CertificateHolder;
import org.testcontainers.shaded.org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
import org.testcontainers.shaded.org.bouncycastle.openssl.PEMParser;
import org.testcontainers.shaded.org.bouncycastle.util.io.pem.PemObject;
import org.testcontainers.shaded.org.bouncycastle.util.io.pem.PemWriter;
import org.bouncycastle.cert.X509CertificateHolder;
import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
import org.bouncycastle.openssl.PEMParser;
import org.bouncycastle.util.io.pem.PemObject;
import org.bouncycastle.util.io.pem.PemWriter;

/**
* Utility class that provides static methods and constants to facilitate the Address Book Services functions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
requires transitive com.hedera.pbj.runtime;
requires com.hedera.node.config;
requires com.swirlds.config.api;
requires org.testcontainers;
requires org.bouncycastle.pkix;
requires org.bouncycastle.provider;
requires static com.github.spotbugs.annotations;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.hedera.node.app.blocks;

import static com.hedera.hapi.block.stream.output.StateIdentifier.STATE_ID_ACCOUNTS;
import static com.hedera.node.app.blocks.NaiveStreamingTreeHasher.hashNaively;
import static com.hedera.node.app.blocks.impl.NaiveStreamingTreeHasher.hashNaively;

import com.hedera.hapi.block.stream.BlockItem;
import com.hedera.hapi.block.stream.output.MapChangeKey;
Expand Down
Loading

0 comments on commit d98402d

Please sign in to comment.