Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Modify Record Cache to commit entries to state and expire entrie…
…s from history correctly Fix record cache to commit added entries to the queue state Ensure the record cache will also remove entries from the queue state when expired Created a "TruePredicate" class for when we require a predicate, but it should always be true, so we avoid duplicating the code yet again. This was needed for removing the head item from the queue state. Fix record cache to remove entries from histories when expired Fix tests as needed Adjust comments to match design and clarify the History map semantics. Signed-off-by: Lev Povolotsky <lev@swirldslabs.com> Signed-off-by: Joseph Sinclair <joseph.sinclair@swirldslabs.com>
- Loading branch information
1 parent
0cdcec3
commit 5a131fe
Showing
3 changed files
with
73 additions
and
35 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
...a-node/hedera-app-spi/src/main/java/com/hedera/node/app/spi/validation/TruePredicate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright (C) 2023 Hedera Hashgraph, LLC | ||
* | ||
* 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. | ||
*/ | ||
|
||
package com.hedera.node.app.spi.validation; | ||
|
||
import java.util.function.Predicate; | ||
|
||
public class TruePredicate implements Predicate { | ||
public static final Predicate INSTANCE = new TruePredicate(); | ||
Check warning on line 22 in hedera-node/hedera-app-spi/src/main/java/com/hedera/node/app/spi/validation/TruePredicate.java Codecov / codecov/patchhedera-node/hedera-app-spi/src/main/java/com/hedera/node/app/spi/validation/TruePredicate.java#L21-L22
|
||
|
||
@Override | ||
public boolean test(Object ignored) { | ||
return true; | ||
Check warning on line 26 in hedera-node/hedera-app-spi/src/main/java/com/hedera/node/app/spi/validation/TruePredicate.java Codecov / codecov/patchhedera-node/hedera-app-spi/src/main/java/com/hedera/node/app/spi/validation/TruePredicate.java#L26
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters