Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
2c35bf4
refactor(backfill): add gap classification with GapType and TypedGap
AlfredoG87 Dec 31, 2025
a490f54
refactor(backfill): implement dual scheduler architecture
AlfredoG87 Dec 31, 2025
8b305fd
refactor(backfill): update plugin for dual scheduler orchestration
AlfredoG87 Dec 31, 2025
c00a6b2
refactor(backfill): consolidate fetcher and remove BackfillGrpcClient
AlfredoG87 Dec 31, 2025
178c8d4
test(backfill): add timeout annotations to prevent test hangs
AlfredoG87 Dec 31, 2025
db1d66f
docs(backfill): update documentation for dual scheduler architecture
AlfredoG87 Dec 31, 2025
48bcb8a
stylefix
AlfredoG87 Dec 31, 2025
474db3e
Restoring Persistence Backpressure to blocks by Encapsulating that lo…
AlfredoG87 Jan 1, 2026
c44f0c3
Added and improved UT coverage for new components
AlfredoG87 Jan 2, 2026
8fc0974
further UT improvements and deduplication
AlfredoG87 Jan 2, 2026
d1947f4
further UT improvements and deduplication
AlfredoG87 Jan 2, 2026
268768d
Codacy and spotless stylefix recommendations
AlfredoG87 Jan 2, 2026
0717f19
- Exposed Configuration for webClient HTTP2 tuning parameters, and se…
AlfredoG87 Jan 2, 2026
ba2657d
Missing Tests for PriorityHealthBasedStrategy class and some nits aro…
AlfredoG87 Jan 2, 2026
a7d73a9
Added mergeContiguousRanges() in BackfillFetcher.java
AlfredoG87 Jan 2, 2026
a3db1be
stylefix
AlfredoG87 Jan 2, 2026
94ee4c2
codacy nits and improved comments on TestBlockNodeServer class
AlfredoG87 Jan 2, 2026
5170ef8
Updated Documentation to reflect new Architecture Design
AlfredoG87 Jan 2, 2026
d9250bc
Improved UTs for BackfillFetcherTest and GapDetectorTest, increasing …
AlfredoG87 Jan 2, 2026
22dfff2
Further UT improvements and Logs QOL improvements on Messaging Facility
AlfredoG87 Jan 2, 2026
a85d2d3
increasing timeout on test to make it more stable since it covers man…
AlfredoG87 Jan 3, 2026
21209b2
added validation constants for HTTP2 Tuning Config parameters for Blo…
AlfredoG87 Jan 5, 2026
72b92c8
added validation constants for HTTP2 Tuning Config parameters for Blo…
AlfredoG87 Jan 5, 2026
34cf96c
- Used MetricsHolder pattern to simplify constructors and testing, al…
AlfredoG87 Jan 5, 2026
7bfa890
removed the applyJitter Method, since we don't have that many concurr…
AlfredoG87 Jan 5, 2026
c5f4cc4
added how the health score system works to the design doc
AlfredoG87 Jan 5, 2026
d11221f
extracted mergeContiguousRanges to be part of LongRange class itself.
AlfredoG87 Jan 6, 2026
3996216
- improved java doc wording
AlfredoG87 Jan 6, 2026
14b2361
- Added comment for Status Enum ordinal brittleness
AlfredoG87 Jan 6, 2026
ded8a6b
- improved variable name to be more explicit hwm to highWaterMark
AlfredoG87 Jan 6, 2026
8b6c18b
micro optimization to avoid parsing blockHeader twice on backfill pro…
AlfredoG87 Jan 6, 2026
bb292b7
- Config readability nit
AlfredoG87 Jan 6, 2026
3cc3a14
style-fix change after rebase with main.
AlfredoG87 Jan 6, 2026
659fc0b
codacy suggestion
AlfredoG87 Jan 6, 2026
ca2daf7
Fixed timeout issues found during remote e2e tests, and then digged d…
AlfredoG87 Jan 6, 2026
1367b03
reduce logs
AlfredoG87 Jan 7, 2026
cf0920a
small nits
AlfredoG87 Jan 7, 2026
828a200
removing dead vestigial code and going full on health based exponenti…
AlfredoG87 Jan 7, 2026
13f9dbc
replacing Exception instances for RuntimeException
AlfredoG87 Jan 7, 2026
4a45bb7
Unify detectGaps flow and fix greedy gap classification
AlfredoG87 Jan 7, 2026
06da7ca
Improved readability of createScheduler by extracting lambda into inn…
AlfredoG87 Jan 7, 2026
526f793
improved log wording pr review nit
AlfredoG87 Jan 7, 2026
b9c3bcc
improved backfill webClient config parameters validation, logging and…
AlfredoG87 Jan 7, 2026
792bb25
added more descriptive logs.
AlfredoG87 Jan 7, 2026
c09c94b
Added a new Edge Test Case and validation to prvent it from schedulin…
AlfredoG87 Jan 8, 2026
200d132
Found, Tested and Fixed yet another bug that was discovered while e2e…
AlfredoG87 Jan 8, 2026
86b178b
codacy suggestion
AlfredoG87 Jan 8, 2026
24149b7
small improvement
AlfredoG87 Jan 8, 2026
46a1a40
bring terms back and improved them, made them sorted and added more.
AlfredoG87 Jan 9, 2026
540bb8c
node_id field for future compatibility with BN AB (address book) shou…
AlfredoG87 Jan 9, 2026
78ca315
improved Diagram that that explains backfill internal architecture mo…
AlfredoG87 Jan 9, 2026
5f56af9
added additional try catch at stop to ensure a graceful shutdown
AlfredoG87 Jan 9, 2026
3e11e07
style fix and codacy fix
AlfredoG87 Jan 9, 2026
b346617
codacy fix
AlfredoG87 Jan 9, 2026
40c838c
small nits
AlfredoG87 Jan 9, 2026
a73247d
- disabled spotless on BackfillConfiguration due to known issue with …
AlfredoG87 Jan 13, 2026
0f274e4
PR Review suggestions
AlfredoG87 Jan 13, 2026
e107cae
as per jjohanes review, we should have proto files in its default fol…
AlfredoG87 Jan 13, 2026
27bd0ae
removing unnecessary require on module-info.java
AlfredoG87 Jan 13, 2026
febb305
restoring requires org.antlr.antlr4.runtime as is really needed for q…
AlfredoG87 Jan 13, 2026
3dd263c
use real metrics and explicit types in BackfillFetcherTest
AlfredoG87 Jan 13, 2026
42988cc
improve BackfillFetcherTest readability and isolation
AlfredoG87 Jan 13, 2026
b737359
add client reference assertion in stale connection test
AlfredoG87 Jan 13, 2026
ac4ada8
Test Improvements and removal of test-only method from BackfillPersis…
AlfredoG87 Jan 14, 2026
8299df1
fix display names and improve test clarity per PR review
AlfredoG87 Jan 14, 2026
bd5364a
removing redundant test
AlfredoG87 Jan 14, 2026
b69b335
Address PR review feedback: remove redundant config test, clarify tes…
AlfredoG87 Jan 14, 2026
c4739f9
codacy suggestion
AlfredoG87 Jan 14, 2026
6989497
Address jsync PR review feedback (latest)
AlfredoG87 Jan 14, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ public void stop() {
}
}

/**
* Test implementation of BlockStreamSubscribeService that serves blocks from the historical facility.
* Simulates a real block node's streaming behavior for backfill integration tests.
*/
private static final class TestBlockStreamSubscribeService implements BlockStreamSubscribeServiceInterface {
private final HistoricalBlockFacility historicalBlockFacility;

Expand All @@ -66,14 +70,17 @@ public void subscribeBlockStream(
@NonNull final SubscribeStreamRequest request,
@NonNull final Pipeline<? super SubscribeStreamResponse> replies) {
boolean blocksAvailable = true;

for (long i = request.startBlockNumber(); i <= request.endBlockNumber(); i++) {
if (!historicalBlockFacility.availableBlocks().contains(i)) {
// Path 1: Requested block not available - send NOT_AVAILABLE and abort
replies.onNext(SubscribeStreamResponse.newBuilder()
.status(SubscribeStreamResponse.Code.NOT_AVAILABLE)
.build());
blocksAvailable = false;
break;
} else {
// Path 2: Block available - send block items followed by end-of-block marker
replies.onNext(SubscribeStreamResponse.newBuilder()
.blockItems(BlockItemSet.newBuilder()
.blockItems(historicalBlockFacility
Expand All @@ -88,6 +95,7 @@ public void subscribeBlockStream(
}
}

// Path 3: All requested blocks sent successfully - send SUCCESS status
if (blocksAvailable) {
replies.onNext(SubscribeStreamResponse.newBuilder()
.status(Code.SUCCESS)
Expand All @@ -97,7 +105,11 @@ public void subscribeBlockStream(
}
}

private class TrivialBlockNodeServerInterface implements BlockNodeServiceInterface {
/**
* Test implementation of BlockNodeService that returns server status from the historical facility.
* Reports the available block range for backfill source discovery.
*/
private static class TrivialBlockNodeServerInterface implements BlockNodeServiceInterface {
private final HistoricalBlockFacility historicalBlockFacility;

public TrivialBlockNodeServerInterface(final HistoricalBlockFacility historicalFacility) {
Expand All @@ -107,6 +119,7 @@ public TrivialBlockNodeServerInterface(final HistoricalBlockFacility historicalF
@Override
@NonNull
public ServerStatusResponse serverStatus(@NonNull final ServerStatusRequest request) {
// Returns the available block range from the historical facility
return ServerStatusResponse.newBuilder()
.firstAvailableBlock(
historicalBlockFacility.availableBlocks().min())
Expand Down
12 changes: 0 additions & 12 deletions block-node/backfill/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,3 @@ testModuleInfo {
requires("org.hiero.block.node.app.test.fixtures")
requires("org.mockito")
}

sourceSets {
main {
pbj {
srcDir(
layout.projectDirectory.dir(
"src/main/java/org/hiero/block/node/backfill/client/proto"
)
)
}
}
}
3 changes: 3 additions & 0 deletions block-node/backfill/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@
requires transitive org.hiero.block.node.spi;
requires transitive org.hiero.block.protobuf.pbj;
requires com.hedera.pbj.grpc.client.helidon;
requires org.hiero.block.node.app.config;
requires org.hiero.block.node.base;
requires io.helidon.common.tls;
requires io.helidon.webclient.api;
requires io.helidon.webclient.grpc;
requires io.helidon.webclient.http2;
requires java.logging;
requires org.antlr.antlr4.runtime;
requires static transitive com.github.spotbugs.annotations;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
import com.swirlds.config.api.validation.annotation.Min;
import org.hiero.block.node.base.Loggable;

// It is known that spotless does not format this file well
// We use the https://github.com/palantir/palantir-java-format formatter.
// @ConfigProperty(defaultValue = "10") – force a line break after the annotation.
// It is a non-configurable format without complete documentation
// we might consider switching to another formatter in the future.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line isn't true; we're pretty locked to the Palantir formatter for all Hiero projects.

// spotless:off

/**
* Configuration for the Backfill module.
*
Expand Down Expand Up @@ -39,4 +46,13 @@ public record BackfillConfiguration(
@Loggable @ConfigProperty(defaultValue = "1000") @Min(500) int perBlockProcessingTimeout,
@Loggable @ConfigProperty(defaultValue = "60000") @Min(10000) int grpcOverallTimeout,
@Loggable @ConfigProperty(defaultValue = "false") boolean enableTLS,
@Loggable @ConfigProperty(defaultValue = "false") boolean greedy) {}
@Loggable @ConfigProperty(defaultValue = "false") boolean greedy,
// Queue capacity settings for bounded queues
@Loggable @ConfigProperty(defaultValue = "20") @Min(1) @Max(1000) int historicalQueueCapacity,
@Loggable @ConfigProperty(defaultValue = "10") @Min(1) @Max(100) int liveTailQueueCapacity,
// Health scoring constants
@Loggable @ConfigProperty(defaultValue = "1000.0") double healthPenaltyPerFailure,
@Loggable @ConfigProperty(defaultValue = "300000") @Min(30000) long maxBackoffMs) {}

// restore spotless formatting
// spotless:on
Loading
Loading