Skip to content

Commit

Permalink
Merge branch 'develop' into 10308-clear-side-effects-after-REVERTED_S…
Browse files Browse the repository at this point in the history
…UCCESS
  • Loading branch information
thenswan committed Dec 12, 2023
2 parents 03be5d0 + d971a0f commit 4ffac75
Show file tree
Hide file tree
Showing 229 changed files with 4,809 additions and 3,365 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
/platform-sdk/swirlds-platform-core/ @hashgraph/platform-hashgraph
/platform-sdk/swirlds-sign-tool/ @hashgraph/platform-hashgraph
/platform-sdk/swirlds-unit-tests/common/ @hashgraph/platform-hashgraph @hashgraph/platform-base
/platform-sdk/swirlds-unit-tests/core/ @hashgraph/platform-hashgraph
/platform-sdk/swirlds-unit-tests/structures/ @hashgraph/platform-data @hashgraph/platform-architects
/platform-sdk/swirlds-unit-tests/core/ @hashgraph/platform-hashgraph @hashgraph/platform-base
/platform-sdk/swirlds-unit-tests/structures/ @hashgraph/platform-data @hashgraph/platform-architects @hashgraph/platform-base
/platform-sdk/swirlds-virtualmap/ @hashgraph/platform-data @hashgraph/platform-architects
/platform-sdk/**/module-info.java @hashgraph/platform-hashgraph @hashgraph/platform-base @hashgraph/release-engineering @hashgraph/release-engineering-managers

Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/platform-zxf-jrs-daily-interval-05.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,43 @@ jobs:
needs:
- NewNodesMinStake
if: ${{ !cancelled() && always() }}

LegacyIntakePipeline:
name: LegacyIntakePipeline
uses: ./.github/workflows/zxc-jrs-regression.yaml
with:
ref: ${{ github.event.inputs.ref }}
branch-name: ${{ github.event.inputs.branch-name }}
panel-config: "configs/suites/daily/4N/GCP-Daily-LegacyIntakePipeline-4N.json"
secrets:
access-token: ${{ secrets.PLATFORM_GH_ACCESS_TOKEN }}
jrs-ssh-user-name: ${{ secrets.PLATFORM_JRS_SSH_USER_NAME }}
jrs-ssh-key-file: ${{ secrets.PLATFORM_JRS_SSH_KEY_FILE }}
gcp-project-number: ${{ secrets.PLATFORM_GCP_PROJECT_NUMBER }}
gcp-sa-key-contents: ${{ secrets.PLATFORM_GCP_KEY_FILE }}
slack-api-token: ${{ secrets.PLATFORM_SLACK_API_TOKEN }}
gradle-cache-username: ${{ secrets.GRADLE_CACHE_USERNAME }}
gradle-cache-password: ${{ secrets.GRADLE_CACHE_PASSWORD }}
needs:
- NewNodesZeroStake
if: ${{ !cancelled() && always() }}

SBReconnectLegacyIntake:
name: SBReconnectLegacyIntake
uses: ./.github/workflows/zxc-jrs-regression.yaml
with:
ref: ${{ github.event.inputs.ref }}
branch-name: ${{ github.event.inputs.branch-name }}
panel-config: "configs/suites/daily/10N/SBReconnect-LegacyIntake-10N.json"
secrets:
access-token: ${{ secrets.PLATFORM_GH_ACCESS_TOKEN }}
jrs-ssh-user-name: ${{ secrets.PLATFORM_JRS_SSH_USER_NAME }}
jrs-ssh-key-file: ${{ secrets.PLATFORM_JRS_SSH_KEY_FILE }}
gcp-project-number: ${{ secrets.PLATFORM_GCP_PROJECT_NUMBER }}
gcp-sa-key-contents: ${{ secrets.PLATFORM_GCP_KEY_FILE }}
slack-api-token: ${{ secrets.PLATFORM_SLACK_API_TOKEN }}
gradle-cache-username: ${{ secrets.GRADLE_CACHE_USERNAME }}
gradle-cache-password: ${{ secrets.GRADLE_CACHE_PASSWORD }}
needs:
- LegacyIntakePipeline
if: ${{ !cancelled() && always() }}
2 changes: 1 addition & 1 deletion .github/workflows/support/scripts/loki-logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ do
echo "query_result = [$query_result]"
echo "nodes = [$nodes]"

if [[ $nodes = $maxnodes ]]; then
if [[ $nodes >= $maxnodes ]]; then
break
fi

Expand Down
2 changes: 1 addition & 1 deletion build-logic/project-plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {
)
implementation("me.champeau.jmh:jmh-gradle-plugin:0.7.2")
implementation("net.swiftzer.semver:semver:1.3.0")
implementation("org.gradlex:extra-java-module-info:1.6")
implementation("org.gradlex:extra-java-module-info:1.6.1")
implementation("org.gradlex:java-ecosystem-capabilities:1.3.1")
implementation("org.gradlex:java-module-dependencies:1.5")
implementation("org.owasp:dependency-check-gradle:8.4.2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ tasks.processResources { from(writeGitProperties) }
tasks.withType<AbstractArchiveTask>().configureEach {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
fileMode = 664
dirMode = 775
fileMode = 436 // octal: 0664
dirMode = 509 // octal: 0775
}

tasks.jar { exclude("**/classpath.index") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.hedera.node.app.hapi.utils.throttles;

import static com.hedera.node.app.hapi.utils.CommonUtils.productWouldOverflow;
import static com.swirlds.common.units.UnitConstants.SECONDS_TO_NANOSECONDS;
import static com.swirlds.base.units.UnitConstants.SECONDS_TO_NANOSECONDS;

/**
* Responsible for throttling transaction by gas limit. Uses a {@link DiscreteLeakyBucket} under the
Expand Down
1 change: 1 addition & 0 deletions hedera-node/hapi-utils/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
requires com.fasterxml.jackson.databind;
requires com.google.common;
requires com.sun.jna;
requires com.swirlds.base;
requires org.apache.commons.codec;
requires org.apache.logging.log4j.core;
requires org.apache.logging.log4j;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.hedera.node.app.hapi.utils.throttles;

import static com.swirlds.common.units.UnitConstants.SECONDS_TO_NANOSECONDS;
import static com.swirlds.base.units.UnitConstants.SECONDS_TO_NANOSECONDS;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,27 +573,19 @@ public void init(@NonNull final Platform platform, @NonNull final NodeId nodeId)
logger.info("Hederanode#{} is ACTIVE", nodeId);
startGrpcServer();
}
case BEHIND -> {
logger.info("Hederanode#{} is BEHIND", nodeId);
if (wasActive) shutdownGrpcServer();
}
case FREEZE_COMPLETE -> logger.info("Hederanode#{} is in FREEZE_COMPLETE", nodeId);
case REPLAYING_EVENTS -> logger.info("Hederanode#{} is REPLAYING_EVENTS", nodeId);
case STARTING_UP -> logger.info("Hederanode#{} is STARTING_UP", nodeId);
case CATASTROPHIC_FAILURE -> {
logger.info("Hederanode#{} is in CATASTROPHIC_FAILURE", nodeId);
if (wasActive) shutdownGrpcServer();
}
case CHECKING -> {
logger.info("Hederanode#{} is CHECKING", nodeId);
if (wasActive) shutdownGrpcServer();
}
case OBSERVING -> logger.info("Hederanode#{} is OBSERVING", nodeId);
case FREEZING -> {
logger.info("Hederanode#{} is FREEZING", nodeId);

case REPLAYING_EVENTS,
STARTING_UP,
OBSERVING,
RECONNECT_COMPLETE,
CHECKING,
FREEZING,
BEHIND -> logger.info("Hederanode#{} is {}", nodeId, platformStatus.name());

Check warning on line 583 in hedera-node/hedera-app/src/main/java/com/hedera/node/app/Hedera.java

View check run for this annotation

Codecov / codecov/patch

hedera-node/hedera-app/src/main/java/com/hedera/node/app/Hedera.java#L583

Added line #L583 was not covered by tests

case CATASTROPHIC_FAILURE, FREEZE_COMPLETE -> {
logger.info("Hederanode#{} is {}", nodeId, platformStatus.name());

Check warning on line 586 in hedera-node/hedera-app/src/main/java/com/hedera/node/app/Hedera.java

View check run for this annotation

Codecov / codecov/patch

hedera-node/hedera-app/src/main/java/com/hedera/node/app/Hedera.java#L586

Added line #L586 was not covered by tests
if (wasActive) shutdownGrpcServer();
}
case RECONNECT_COMPLETE -> logger.info("Hederanode#{} is RECONNECT_COMPLETE", nodeId);
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,11 +542,13 @@ public <T> T doDispatchPrecedingTransaction(
if (category != TransactionCategory.USER && category != TransactionCategory.CHILD) {
throw new IllegalArgumentException("Only user- or child-transactions can dispatch preceding transactions");
}
// This condition fails, because for lazy-account creation we charge fees, before dispatching the transaction,
// and the state will be modified.

if (stack.depth() > 1) {
throw new IllegalStateException(
"Cannot dispatch a preceding transaction when a savepoint has been created");
}
// if (stack.depth() > 1) {
// throw new IllegalStateException(
// "Cannot dispatch a preceding transaction when a savepoint has been created");
// }

// This condition fails, because for auto-account creation we charge fees, before dispatching the transaction,
// and the state will be modified.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public SingleTransactionRecordBuilderImpl addChild(
@NonNull final Configuration configuration,
@NonNull final HandleContext.TransactionCategory childCategory) {
requireNonNull(configuration, CONFIGURATION_MUST_NOT_BE_NULL);
return doAddChild(
return doAddFollowingChild(
configuration, ReversingBehavior.REVERSIBLE, NOOP_EXTERNALIZED_RECORD_CUSTOMIZER, childCategory);
}

Expand All @@ -231,7 +231,7 @@ public SingleTransactionRecordBuilderImpl addChild(
*/
public SingleTransactionRecordBuilderImpl addRemovableChild(@NonNull final Configuration configuration) {
requireNonNull(configuration, CONFIGURATION_MUST_NOT_BE_NULL);
return doAddChild(
return doAddFollowingChild(
configuration,
ReversingBehavior.REMOVABLE,
NOOP_EXTERNALIZED_RECORD_CUSTOMIZER,
Expand All @@ -255,11 +255,11 @@ public SingleTransactionRecordBuilderImpl addRemovableChildWithExternalizationCu
@NonNull final Configuration configuration, @NonNull final ExternalizedRecordCustomizer customizer) {
requireNonNull(configuration, CONFIGURATION_MUST_NOT_BE_NULL);
requireNonNull(customizer, "customizer must not be null");
return doAddChild(
return doAddFollowingChild(
configuration, ReversingBehavior.REMOVABLE, customizer, HandleContext.TransactionCategory.CHILD);
}

private SingleTransactionRecordBuilderImpl doAddChild(
private SingleTransactionRecordBuilderImpl doAddFollowingChild(
@NonNull final Configuration configuration,
final ReversingBehavior reversingBehavior,
@NonNull final ExternalizedRecordCustomizer customizer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,6 @@ public <T extends SwirldState> AutoCloseableWrapper<T> getLatestImmutableState(@
return null;
}

@Override
public <T extends SwirldState> AutoCloseableWrapper<T> getLatestSignedState(@NonNull String s) {
return null;
}

@Override
public boolean createTransaction(@NonNull byte[] bytes) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1047,23 +1047,25 @@ void testDispatchPrecedingWithNonUserTxnFails(final TransactionCategory category
@Test
void testDispatchPrecedingWithNonEmptyStackDoesntFail() {
// given
given(networkInfo.selfNodeInfo()).willReturn(selfNodeInfo);
given(selfNodeInfo.nodeId()).willReturn(0L);
final var context = createContext(defaultTransactionBody(), TransactionCategory.USER);
stack.createSavepoint();

// then
assertThatThrownBy(() -> context.dispatchPrecedingTransaction(
assertThatNoException()
.isThrownBy(() -> context.dispatchPrecedingTransaction(
defaultTransactionBody(),
SingleTransactionRecordBuilder.class,
VERIFIER_CALLBACK,
AccountID.DEFAULT))
.isInstanceOf(IllegalStateException.class);
assertThatThrownBy(() -> context.dispatchReversiblePrecedingTransaction(
AccountID.DEFAULT));
assertThatNoException()
.isThrownBy(() -> context.dispatchReversiblePrecedingTransaction(
defaultTransactionBody(),
SingleTransactionRecordBuilder.class,
VERIFIER_CALLBACK,
AccountID.DEFAULT))
.isInstanceOf(IllegalStateException.class);
verify(recordListBuilder, never()).addPreceding(any(), eq(LIMITED_CHILD_RECORDS));
AccountID.DEFAULT));
verify(recordListBuilder, never()).addRemovablePreceding(any());
verify(dispatcher, never()).dispatchHandle(any());
assertThat(stack.createReadableStates(FOOD_SERVICE)
.get(FRUIT_STATE_KEY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class RecordListBuilderTest extends AppTestBase {
private static final long MAX_CHILDREN = 10;

private static final Configuration CONFIGURATION = HederaTestConfigBuilder.create()
.withValue("consensus.message.maxPrecedingRecords", MAX_PRECEDING)
.withValue("consensus.message.maxFollowingRecords", MAX_CHILDREN)
.withValue("consensus.handle.maxPrecedingRecords", MAX_PRECEDING)
.withValue("consensus.handle.maxFollowingRecords", MAX_CHILDREN)
.getOrCreateConfig();
private static final int EXPECTED_CHILD_NANO_INCREMENT = 0;
private static final int EXPECTED_CHILD_NANO_INCREMENT_SCHEDULED =
Expand Down Expand Up @@ -138,8 +138,8 @@ void testAddTooManyPrecedingRecordsFails() {
// given
final var maxPreceding = 2L;
final var config = HederaTestConfigBuilder.create()
.withValue("consensus.message.maxPrecedingRecords", maxPreceding)
.withValue("consensus.message.maxFollowingRecords", MAX_CHILDREN)
.withValue("consensus.handle.maxPrecedingRecords", maxPreceding)
.withValue("consensus.handle.maxFollowingRecords", MAX_CHILDREN)
.getOrCreateConfig();
final var consensusTime = Instant.now();
final var recordListBuilder = new RecordListBuilder(consensusTime);
Expand Down Expand Up @@ -242,8 +242,8 @@ void testAddTooManyReversiblePrecedingRecordsFails() {
// given
final var maxPreceding = 2L;
final var config = HederaTestConfigBuilder.create()
.withValue("consensus.message.maxPrecedingRecords", maxPreceding)
.withValue("consensus.message.maxFollowingRecords", MAX_CHILDREN)
.withValue("consensus.handle.maxPrecedingRecords", maxPreceding)
.withValue("consensus.handle.maxFollowingRecords", MAX_CHILDREN)
.getOrCreateConfig();
final var consensusTime = Instant.now();
final var recordListBuilder = new RecordListBuilder(consensusTime);
Expand Down Expand Up @@ -356,8 +356,8 @@ void testRevertMultipleMixedPreceding() {
// given
final var maxPreceding = 4L;
final var config = HederaTestConfigBuilder.create()
.withValue("consensus.message.maxPrecedingRecords", maxPreceding)
.withValue("consensus.message.maxFollowingRecords", MAX_CHILDREN)
.withValue("consensus.handle.maxPrecedingRecords", maxPreceding)
.withValue("consensus.handle.maxFollowingRecords", MAX_CHILDREN)
.getOrCreateConfig();
final var consensusTime = Instant.now();
final var recordListBuilder = new RecordListBuilder(consensusTime);
Expand Down Expand Up @@ -452,8 +452,8 @@ void testAddTooManyChildrenFails() {
// given
final var maxChildren = 2L;
final var config = HederaTestConfigBuilder.create()
.withValue("consensus.message.maxPrecedingRecords", MAX_PRECEDING)
.withValue("consensus.message.maxFollowingRecords", maxChildren)
.withValue("consensus.handle.maxPrecedingRecords", MAX_PRECEDING)
.withValue("consensus.handle.maxFollowingRecords", maxChildren)
.getOrCreateConfig();
final var consensusTime = Instant.now();
final var recordListBuilder = new RecordListBuilder(consensusTime);
Expand Down Expand Up @@ -681,8 +681,8 @@ void testAddTooManyRemovableChildrenFails() {
// given
final var maxChildren = 2L;
final var config = HederaTestConfigBuilder.create()
.withValue("consensus.message.maxPrecedingRecords", MAX_PRECEDING)
.withValue("consensus.message.maxFollowingRecords", maxChildren)
.withValue("consensus.handle.maxPrecedingRecords", MAX_PRECEDING)
.withValue("consensus.handle.maxFollowingRecords", maxChildren)
.getOrCreateConfig();
final var consensusTime = Instant.now();
final var recordListBuilder = new RecordListBuilder(consensusTime);
Expand Down

0 comments on commit 4ffac75

Please sign in to comment.