Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/acceptance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ defaults:
run:
shell: bash

env:
LC_ALL: C.UTF-8

jobs:
acceptance:
runs-on: hiero-mirror-node-linux-large
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ defaults:
run:
shell: bash

env:
LC_ALL: C.UTF-8

jobs:
lint:
runs-on: hiero-mirror-node-linux-large
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ defaults:
run:
shell: bash

env:
LC_ALL: C.UTF-8

jobs:
images:
runs-on: hiero-mirror-node-linux-medium
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/copy-stackgres-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ defaults:
run:
shell: bash

env:
LC_ALL: C.UTF-8

permissions:
id-token: write
contents: read
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/gh-pages-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ defaults:
run:
shell: bash

env:
LC_ALL: C.UTF-8

permissions:
contents: write

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/rosetta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ permissions:
contents: read

env:
LC_ALL: C.UTF-8
MODULE: rosetta
NETWORK: previewnet

Expand Down
11 changes: 4 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@ plugins {
extra.apply {
set("besuVersion", "25.2.2")
set("blockNodeVersion", "0.24.2")
set("commons-lang3.version", "3.20.0") // Temporary until next Spring Boot
set("consensusNodeVersion", "0.70.0-rc.2")
set("grpcVersion", "1.78.0")
set("jooq.version", "3.20.10") // Must match buildSrc/build.gradle.kts
set("mapStructVersion", "1.6.3")
set("nodeJsVersion", "24.13.0")
set("protobufVersion", "4.33.4")
set("springGrpcVersion", "0.12.0")
set("springGrpcVersion", "1.0.1")
set("tuweniVersion", "2.3.1")
set("web3jVersion", "5.0.2")
}

// Creates a platform/BOM with specific versions so subprojects don't need to specify a version when
Expand All @@ -42,7 +40,6 @@ dependencies {
val protobufVersion: String by rootProject.extra
val springGrpcVersion: String by rootProject.extra
val tuweniVersion: String by rootProject.extra
val web3jVersion: String by rootProject.extra

api("com.asarkar.grpc:grpc-test:2.0.0")
api("com.esaulpaugh:headlong:13.3.1")
Expand All @@ -61,11 +58,11 @@ dependencies {
api("com.ongres.scram:client:2.1")
api("commons-beanutils:commons-beanutils:1.11.0")
api("commons-io:commons-io:2.21.0")
api("io.cucumber:cucumber-bom:7.23.0")
api("io.cucumber:cucumber-bom:7.34.1")
api("io.fabric8:kubernetes-client-bom:7.5.2")
api("io.github.mweirauch:micrometer-jvm-extras:0.2.2")
api("io.grpc:grpc-bom:$grpcVersion")
api("io.hypersistence:hypersistence-utils-hibernate-63:3.14.1")
api("io.hypersistence:hypersistence-utils-hibernate-71:3.15.0")
api("io.projectreactor:reactor-core-micrometer:1.2.12")
api("jakarta.inject:jakarta.inject-api:2.0.1")
api("net.java.dev.jna:jna:5.18.1")
Expand All @@ -85,7 +82,7 @@ dependencies {
api("org.msgpack:jackson-dataformat-msgpack:0.9.11")
api("org.springframework.grpc:spring-grpc-spring-boot-starter:$springGrpcVersion")
api("org.springframework.grpc:spring-grpc-test:$springGrpcVersion")
api("org.web3j:core:$web3jVersion")
api("org.web3j:core:5.0.2")
api("software.amazon.awssdk:bom:2.41.14")
api("tech.pegasys:jc-kzg-4844:1.0.0")
api("uk.org.webcompere:system-stubs-jupiter:2.1.8")
Expand Down
20 changes: 7 additions & 13 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

plugins { `kotlin-dsl` }

repositories {
// Temporary until next web3j
maven("https://www.jitpack.io") { content { includeGroupByRegex(".*web3j.*") } }
gradlePluginPortal()
}
repositories { gradlePluginPortal() }

dependencies {
val dockerJavaVersion = "3.7.0"
Expand All @@ -18,30 +14,28 @@ dependencies {
implementation("com.github.docker-java:docker-java-core:$dockerJavaVersion")
implementation("com.bmuschko:gradle-docker-plugin:9.4.0")
implementation("com.diffplug.spotless:spotless-plugin-gradle:8.2.0")
implementation("com.gradleup.shadow:shadow-gradle-plugin:9.3.1")
implementation("com.github.node-gradle:gradle-node-plugin:7.1.0")
implementation("com.google.protobuf:protobuf-gradle-plugin:0.9.5")
implementation("com.gorylenko.gradle-git-properties:gradle-git-properties:2.5.4")
implementation("com.graphql-java-generator:graphql-gradle-plugin3:3.1")
implementation("com.gradleup.shadow:shadow-gradle-plugin:9.3.1")
implementation("com.graphql-java-generator:graphql-gradle-plugin3:4.0")
implementation("gradle.plugin.io.snyk.gradle.plugin:snyk:0.7.0")
implementation("io.freefair.gradle:lombok-plugin:9.2.0")
implementation("io.spring.gradle:dependency-management-plugin:1.1.7")
implementation("net.ltgt.gradle:gradle-errorprone-plugin:4.4.0")
implementation("org.apache.commons:commons-compress:1.28.0")
implementation("org.cyclonedx:cyclonedx-gradle-plugin:3.0.1")
implementation("org.flywaydb:flyway-database-postgresql:11.20.2")
implementation("org.cyclonedx:cyclonedx-gradle-plugin:2.4.1")
implementation("org.graalvm.buildtools:native-gradle-plugin:0.11.4")
implementation("org.gradle:test-retry-gradle-plugin:1.6.4")
implementation("org.jooq:jooq-codegen-gradle:$jooqVersion")
implementation("org.jooq:jooq-meta:$jooqVersion")
implementation("org.jooq:jooq-postgres-extensions:${jooqVersion}")
implementation("org.openapitools:openapi-generator-gradle-plugin:7.19.0")
implementation("org.owasp:dependency-check-gradle:12.2.0")
implementation("org.springframework.boot:spring-boot-gradle-plugin:3.5.9")
implementation("org.testcontainers:postgresql:1.21.4")
implementation(
"com.github.steven-sheehy.web3j-gradle-plugin:org.web3j.gradle.plugin:3644142546"
) // Temporary until next web3j
implementation("org.springframework.boot:spring-boot-gradle-plugin:4.0.2")
implementation("org.testcontainers:testcontainers-postgresql:2.0.2")
implementation("org.web3j:web3j-gradle-plugin:5.0.2")
}

val gitHook =
Expand Down
4 changes: 3 additions & 1 deletion buildSrc/src/main/kotlin/java-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ dependencies {

tasks.withType<JavaCompile>().configureEach {
// Disable dangling-doc-comments due to graphql-gradle-plugin-project #25
// Disable deprecation due to OpenAPI using deprecated Jackson2 in generated code
// Disable serial and this-escape warnings due to errors in generated code
// Disable rawtypes and unchecked due to Spring AOT generated configuration
options.compilerArgs.addAll(
listOf(
"-parameters",
"-Werror",
"-Xlint:all",
"-Xlint:-dangling-doc-comments,-preview,-rawtypes,-this-escape,-unchecked",
"-Xlint:-dangling-doc-comments,-deprecation,-preview,-rawtypes,-this-escape,-unchecked",
)
)
options.encoding = "UTF-8"
Expand All @@ -62,6 +63,7 @@ tasks.withType<JavaCompile>().configureEach {
check("NullAway", net.ltgt.gradle.errorprone.CheckSeverity.ERROR)
option("NullAway:OnlyNullMarked", "true")
option("NullAway:CustomContractAnnotations", "org.springframework.lang.Contract")
excludedPaths = ".*/build/generated/.*"
}
sourceCompatibility = "25"
targetCompatibility = "25"
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/jooq-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension
import org.flywaydb.core.Flyway
import org.testcontainers.containers.PostgreSQLContainer
import org.testcontainers.images.builder.Transferable
import org.testcontainers.postgresql.PostgreSQLContainer
import org.testcontainers.utility.DockerImageName

plugins {
Expand Down Expand Up @@ -73,7 +73,7 @@ val postgresqlContainer =
DockerImageName.parse("docker.io/library/postgres:16.9-alpine")
.asCompatibleSubstituteFor("postgres")
val container =
PostgreSQLContainer<Nothing>(image).apply {
PostgreSQLContainer(image).apply {
withCopyToContainer(initScript, "/docker-entrypoint-initdb.d/init.sh")
withUsername("postgres")
start()
Expand Down
15 changes: 10 additions & 5 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,26 @@ dependencies {
api("com.google.guava:guava")
api("com.google.protobuf:protobuf-java")
api("com.hedera.hashgraph:hedera-protobuf-java-api") { isTransitive = false }
api("io.hypersistence:hypersistence-utils-hibernate-63")
api("commons-codec:commons-codec")
api("io.hypersistence:hypersistence-utils-hibernate-71")
api("jakarta.servlet:jakarta.servlet-api")
api("org.apache.commons:commons-lang3")
api("org.apache.tuweni:tuweni-bytes")
api("org.apache.tuweni:tuweni-units")
api("org.slf4j:jcl-over-slf4j")
api("org.springframework.boot:spring-boot-jackson2")
api("org.springframework.boot:spring-boot-starter-data-jpa")
api("org.springframework.boot:spring-boot-starter-micrometer-metrics")
api("org.springframework.boot:spring-boot-starter-validation")
api("org.web3j:core")
api("jakarta.servlet:jakarta.servlet-api")
testImplementation("org.hyperledger.besu:evm")
testImplementation("org.springframework.boot:spring-boot-testcontainers")
testImplementation("org.testcontainers:postgresql")
testImplementation("io.micrometer:micrometer-core")
testImplementation("org.junit.platform:junit-platform-launcher")
testImplementation("org.hyperledger.besu:evm")
testImplementation("org.springframework:spring-web")
testImplementation("org.springframework.boot:spring-boot-starter-data-redis-test")
testImplementation("org.springframework.boot:spring-boot-starter-flyway-test")
testImplementation("org.springframework.boot:spring-boot-testcontainers")
testImplementation("org.testcontainers:testcontainers-postgresql")

testClasses(sourceSets["test"].output)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import org.hiero.mirror.common.config.CommonRuntimeHints;
import org.hiero.mirror.common.converter.CustomJsonFormatMapper;
import org.hiero.mirror.common.domain.SystemEntity;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.autoconfigure.orm.jpa.HibernatePropertiesCustomizer;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.hibernate.autoconfigure.HibernatePropertiesCustomizer;
import org.springframework.boot.persistence.autoconfigure.EntityScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportRuntimeHints;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,22 @@
import org.apache.commons.lang3.Strings;
import org.hiero.mirror.common.CommonProperties;
import org.hiero.mirror.common.domain.DomainBuilder;
import org.jspecify.annotations.NonNull;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.flyway.FlywayProperties;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.boot.autoconfigure.jdbc.JdbcConnectionDetails;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.flyway.autoconfigure.FlywayProperties;
import org.springframework.boot.jdbc.autoconfigure.DataSourceProperties;
import org.springframework.boot.jdbc.autoconfigure.JdbcConnectionDetails;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.lifecycle.TestcontainersStartup;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.transaction.support.TransactionOperations;
import org.testcontainers.containers.BindMode;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.containers.output.OutputFrame;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.postgresql.PostgreSQLContainer;
import org.testcontainers.utility.DockerImageName;

@TestConfiguration(proxyBeanMethods = false)
Expand Down Expand Up @@ -90,15 +91,15 @@ MeterRegistry meterRegistry() {
}

@Bean(POSTGRESQL)
PostgreSQLContainer<?> postgresql() {
PostgreSQLContainer postgresql() {
var imageName = v2 ? "gcr.io/mirrornode/citus:12.1.1" : "gcr.io/mirrornode/postgres:16-alpine";
var dockerImageName = DockerImageName.parse(imageName).asCompatibleSubstituteFor("postgres");
var logger = LoggerFactory.getLogger(PostgreSQLContainer.class);
var excluded = "terminating connection due to unexpected postmaster exit";
var logConsumer = new FilteringConsumer(
new Slf4jLogConsumer(logger, true),
o -> !Strings.CS.contains(o.getUtf8StringWithoutLineEnding(), excluded));
return new PostgreSQLContainer<>(dockerImageName)
return new PostgreSQLContainer(dockerImageName)
.withClasspathResourceMapping("init.sql", "/docker-entrypoint-initdb.d/init.sql", BindMode.READ_ONLY)
.withDatabaseName("mirror_node")
.withLogConsumer(logConsumer)
Expand All @@ -109,17 +110,17 @@ PostgreSQLContainer<?> postgresql() {
// Avoid using @ServiceConnection and use our own custom connection details so we can pass mirror_importer as user
@Bean
JdbcConnectionDetails jdbcConnectionDetails(
DataSourceProperties dataSourceProperties, PostgreSQLContainer<?> postgresql) {
DataSourceProperties dataSourceProperties, PostgreSQLContainer postgresql) {
TestcontainersStartup.start(postgresql);
return new JdbcConnectionDetails() {

@Override
public String getDriverClassName() {
public @NonNull String getDriverClassName() {
return postgresql.getDriverClassName();
}

@Override
public String getJdbcUrl() {
public @NonNull String getJdbcUrl() {
return postgresql.getJdbcUrl();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.data.redis.autoconfigure.DataRedisAutoConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -13,7 +13,7 @@
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.utility.DockerImageName;

@AutoConfigureAfter(RedisAutoConfiguration.class)
@AutoConfigureAfter(DataRedisAutoConfiguration.class)
@Configuration
public class RedisTestConfiguration {
@Bean
Expand Down
3 changes: 1 addition & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,7 @@ value, it is recommended to only populate overridden properties in the custom `a
| ---------------------------------------------------------- | ---------------- | --------------------------------------------------------------------------------------------------------- |
| `hiero.mirror.grpc.addressbook.cacheExpiry` | 2s | The amount of time to cache address book entries |
| `hiero.mirror.grpc.addressbook.cacheSize` | 50 | The maximum number of address book pages to cache |
| `hiero.mirror.grpc.addressbook.maxPageDelay` | 250ms | The maximum amount of time to sleep between paging for address book entries |
| `hiero.mirror.grpc.addressbook.minPageDelay` | 100ms | The minimum amount of time to sleep between paging for address book entries |
| `hiero.mirror.grpc.addressbook.pageDelay` | 250ms | The amount of time to sleep between paging for address book entries |
| `hiero.mirror.grpc.addressbook.pageSize` | 10 | The maximum number of address book entries to return in a single page |
| `hiero.mirror.grpc.addressbook.nodeStakeCacheExpiry` | 24h | The amount of time to cache node stake assignments |
| `hiero.mirror.grpc.addressbook.nodeStakeCacheSize` | 5 | The maximum number of versions of node stake assignments to cache |
Expand Down
6 changes: 4 additions & 2 deletions graphql/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,18 @@ dependencies {
implementation("jakarta.inject:jakarta.inject-api")
implementation("org.mapstruct:mapstruct")
implementation("org.springframework.boot:spring-boot-actuator-autoconfigure")
implementation("org.springframework.boot:spring-boot-health")
implementation("org.springframework.boot:spring-boot-starter-graphql")
implementation("org.springframework.boot:spring-boot-starter-web")
runtimeOnly("io.micrometer:micrometer-registry-prometheus")
runtimeOnly("org.postgresql:postgresql")
testImplementation(project(path = ":common", configuration = "testClasses"))
testImplementation("org.flywaydb:flyway-database-postgresql")
testImplementation("org.springframework.boot:spring-boot-starter-flyway-test")
testImplementation("org.springframework.boot:spring-boot-starter-graphql-test")
testImplementation("org.springframework.boot:spring-boot-testcontainers")
testImplementation("org.springframework.graphql:spring-graphql-test")
testImplementation("org.springframework:spring-webflux")
testImplementation("org.testcontainers:postgresql")
testImplementation("org.testcontainers:testcontainers-postgresql")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import java.util.function.Consumer;
import org.hiero.mirror.graphql.scalar.GraphQlDuration;
import org.hiero.mirror.graphql.scalar.GraphQlTimestamp;
import org.springframework.boot.autoconfigure.graphql.GraphQlSourceBuilderCustomizer;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.boot.graphql.autoconfigure.GraphQlSourceBuilderCustomizer;
import org.springframework.boot.jackson2.autoconfigure.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.graphql.execution.RuntimeWiringConfigurer;
Expand Down Expand Up @@ -68,6 +68,7 @@ SchemaDirectiveWiring validationDirectives() {

// Configure JSON parsing limits to reject malicious input
@Bean
@SuppressWarnings("removal")
Jackson2ObjectMapperBuilderCustomizer jacksonCustomizer() {
return builder -> {
var streamReadConstraints = StreamReadConstraints.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import org.hiero.mirror.graphql.interceptor.EndpointInstrumentation;
import org.hiero.mirror.graphql.interceptor.GraphQLInterceptor;
import org.springframework.boot.autoconfigure.graphql.GraphQlSourceBuilderCustomizer;
import org.springframework.boot.graphql.autoconfigure.GraphQlSourceBuilderCustomizer;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Bean;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
import org.springframework.boot.test.autoconfigure.graphql.tester.AutoConfigureHttpGraphQlTester;
import org.springframework.boot.graphql.test.autoconfigure.tester.AutoConfigureHttpGraphQlTester;
import org.springframework.graphql.ResponseError;
import org.springframework.graphql.test.tester.HttpGraphQlTester;

Expand Down
Loading
Loading