Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
247 commits
Select commit Hold shift + click to select a range
2e979c8
checkin with implementation that I want to test
pinges Oct 21, 2025
e3b5763
set difficulty to zero for now
pinges Oct 21, 2025
5d37397
Include BALs in `debug_getBadBlocks` response (#9293)
mirgee Oct 13, 2025
e302cd0
Include generated BALs in `debug_getBadBlocks` response (#9295)
mirgee Oct 13, 2025
ce1e70a
EIP-7928 - Update engine API (#9213)
mirgee Oct 13, 2025
49142ab
ADD: UInt256 implementation of evm's op MOD (#9188)
thomas-quadratic Oct 13, 2025
19b1006
Fix build for gitworktrees (#9288)
lu-pinto Oct 13, 2025
5b2d228
Add Option to enable/disable opcode optimizations (#9299)
lu-pinto Oct 14, 2025
33ffa3a
add blockTimestamp to logs within tx receipt (#9294)
macfarla Oct 14, 2025
d34ef0c
Activate BALs on amsterdam instead of futureEips (#9296)
mirgee Oct 14, 2025
91e90f6
EIP-7928 - Fix failing code clearing spec tests on main (#9304)
mirgee Oct 14, 2025
5352565
test: upgrade to execution-spec-tests v5.3.0 (#9301)
Gabriel-Trintinalia Oct 15, 2025
86f1b11
chore: Update log4j to 2.25.2 (#9312)
usmansaleem Oct 15, 2025
6b61de1
Add test summary reporting to block-test command (#9246)
bshastry Oct 15, 2025
0043360
Only add CALL recipient to BAL if read (#9314)
mirgee Oct 15, 2025
f130d24
Implement era1 file export (#9081)
Matilda-Clerke Oct 15, 2025
1cdb79d
Revert "Fix: colored output is lost with 25.7.0 (#9250)" (#9320)
Gabriel-Trintinalia Oct 16, 2025
f31edf7
changelog (#9322)
macfarla Oct 16, 2025
72f1912
Request block builder to finalize when we get a getPayload request (#…
daniellehrner Oct 16, 2025
0a08952
remove parentBeaconBlockRoot from getPayload result (#9316)
ahamlat Oct 16, 2025
1dac634
tweaks to release checklist and container verify script (#9318)
macfarla Oct 16, 2025
caf34d7
Enable/disable trace fields for RPCs that dump traces to files (#9183)
lu-pinto Oct 17, 2025
6213be6
Cancelling a block creation, only stops the selection, to allow the b…
fab-10 Oct 17, 2025
71e6b06
Provide SECP256R1 default to precompile (#9307)
lu-pinto Oct 17, 2025
df52377
Update Netty to 4.2.7.Final (#9330)
macfarla Oct 19, 2025
1c1e6bc
Do not load recipient account when calculating CALL gas cost if trans…
mirgee Oct 20, 2025
46fdda9
Remove GetBlockFromPeerTask and RetryingGetBlockFromPeerTask, replaci…
Matilda-Clerke Oct 20, 2025
a2d1103
chore: eip-7935 bump mainnet gas limit to 60M (#9339)
Gabriel-Trintinalia Oct 21, 2025
cce24e5
check whether we are syncing earlier in fcu
pinges Oct 22, 2025
0aa284e
Interrupt running selection task when block creation is cancelled (#9…
fab-10 Oct 21, 2025
1a0a781
Introduce a more versatile txpool lifecycle logging (#9333)
fab-10 Oct 21, 2025
946e94f
CLI Tests - assert no errors before other assertions (#9340)
macfarla Oct 21, 2025
6886fe1
exclude icebox'd issues from being marked stale (#9328)
jflo Oct 22, 2025
ab368eb
add instructions for DCO into DCO.md (#9317)
macfarla Oct 22, 2025
5b68d85
add logging
pinges Oct 23, 2025
de03e78
more logging
pinges Oct 23, 2025
d2b833e
make it really simple and do a lot in parallel
pinges Oct 23, 2025
2dc2454
download all headers and remember last successfull block
pinges Oct 23, 2025
51835ad
fix off by one
pinges Oct 24, 2025
82da875
Support blob fee market when zeroBaseFee enabled for forks with blobs…
jframe Oct 22, 2025
464d2f6
Calculate world state root hash from BAL in parallel to block process…
mirgee Oct 22, 2025
924dec2
make BesuVersionUtils graal-safe (#9342)
garyschulte Oct 22, 2025
65ab65f
add test for logging to go to stdout (#9341)
macfarla Oct 22, 2025
85ce25e
run unit tests on bigger runners (#9348)
macfarla Oct 23, 2025
cbd8df1
Fix KeyValueStorage constructor params in ExecutionContextTestFixture…
siladu Oct 23, 2025
8d01970
Fix BAL generation during parallel preprocessing (#9352)
mirgee Oct 23, 2025
177023d
tuweni 2.7.2 (#9338)
macfarla Oct 23, 2025
95aaa84
check peer availability
pinges Oct 24, 2025
047370b
make sure the second stage starts with the same pivot
pinges Oct 24, 2025
39f3a0a
fix compile
pinges Oct 24, 2025
955af6f
compile
pinges Oct 24, 2025
d53e147
make sure the progress of the chain download is displayed
pinges Oct 27, 2025
ae92640
do less header in parallel
pinges Oct 27, 2025
d1aa8b3
work on pipeline restart
pinges Oct 29, 2025
94a5b4d
remove already stored check
pinges Oct 30, 2025
e0354db
set difficulty to 0
pinges Oct 30, 2025
d50fbb2
compile
pinges Oct 30, 2025
1cf3a95
modify how tmp file is created (#9343)
macfarla Oct 27, 2025
431857c
Do not create unchanged accounts in BlockAccessListStateRootHashCalcu…
mirgee Oct 27, 2025
6f76839
allow to directly set the signature algorithm instance (#9364)
garyschulte Oct 27, 2025
de03bab
QBFT/IBFT validation refactoring to allow use of validation outside o…
jframe Oct 28, 2025
c7fbfef
use tmp dir for --data-path in BesuCommand tests (#9350)
macfarla Oct 28, 2025
d8bdf33
use bonsai for blockchain tests (#9247)
matkt Oct 28, 2025
151c8c5
fix: testDocker gradle task (#9372)
usmansaleem Oct 29, 2025
32c799b
Enable Gradle parallel execution (#9371)
pinges Oct 29, 2025
54e70e6
Remove peer task toggle from AbstractPeerBlockValidator (#9205)
Matilda-Clerke Oct 29, 2025
58912ca
logs
pinges Oct 30, 2025
f5f7630
fix chain head
pinges Oct 30, 2025
cf70f99
add logging
pinges Oct 30, 2025
56a779a
store pivot header, restart from privious pivot
pinges Oct 31, 2025
b5f2f1c
Add event type to `AddedBlockContext` (#9369)
fab-10 Oct 30, 2025
9b6c8cb
Enforce `LogTopic` to be of 32 bytes (#9377)
fab-10 Oct 30, 2025
910d5d8
Add block creation log for PoS networks (#9378)
ahamlat Oct 30, 2025
322db69
Change log level, improve message and add test (#9374)
Gabriel-Trintinalia Oct 30, 2025
989d4ba
chore: add fusaka mainnet timestamps (#9380)
Gabriel-Trintinalia Oct 30, 2025
e8e60b2
enable disabled options test (#9376)
macfarla Oct 31, 2025
1c85ae3
rotate changelog - release 25.11.0 (#9383)
Gabriel-Trintinalia Oct 31, 2025
10bb5b8
feat(plugin): add tx by hash (#9384)
Gabriel-Trintinalia Oct 31, 2025
c14e9e7
upgrade vertx to 4.5.22 (#9375)
macfarla Oct 31, 2025
fd9e5fb
implement trace filtering by opcode in debug_* RPCs (#9335)
lu-pinto Oct 31, 2025
d69fbb4
fix finishing coordination and some rework
pinges Nov 4, 2025
d7568aa
Bump besu-errorprone to 1.2.0 (#9386)
siladu Oct 31, 2025
55a2782
use NotNull annotation consistent with codebase (#9381)
macfarla Oct 31, 2025
35e71b8
Generalize state root computation future into a `StateRootCommitter` …
mirgee Oct 31, 2025
7bc382f
remove remaining 4 deprecated CLI options (#9385)
macfarla Nov 2, 2025
35ca9cc
Read docker logs from stderr as well as stdout (#9319)
siladu Nov 2, 2025
82327d2
pins stale action to a sha (#9388)
jflo Nov 3, 2025
688d162
fix(getBlobs): return null if node is syncing (#9394)
Gabriel-Trintinalia Nov 4, 2025
1098b05
create access list - return success response even if tx reverted (#9358)
macfarla Nov 4, 2025
caea817
fix one off and gws
pinges Nov 4, 2025
529773a
fix one off in stage 2
pinges Nov 4, 2025
3a99a79
add logging
pinges Nov 4, 2025
52bbbf5
clean up
pinges Nov 6, 2025
de04d91
EIP-158 & EIP-7928 - Touch coinbase even when fees are zero (#9353)
mirgee Nov 4, 2025
59758c2
EIP-7928 - BAL bugfixes (#9397)
mirgee Nov 4, 2025
20cdafe
Remove RetryingGetHeaderFromPeerByHashTask (#9393)
Matilda-Clerke Nov 4, 2025
276534f
replace deprecated method calls for setting up CorsHandler (#9396)
macfarla Nov 5, 2025
71e0f29
better logging of non matching parent hash
pinges Nov 6, 2025
9ae9df6
update and store state before retry
pinges Nov 6, 2025
ba11cbc
Fix FixedThreadPool to actually use all the threads defined (#9390)
fab-10 Nov 6, 2025
2298a53
make code more readlable
pinges Nov 7, 2025
4f49031
fix continue to pivot method
pinges Nov 7, 2025
53bc315
remove logging
pinges Nov 8, 2025
21d1c93
add td
pinges Nov 11, 2025
b72269b
Remove redundant check in BlockAccessListStateRootHashCalculator (#9404)
mirgee Nov 6, 2025
06b3b86
re-enable test on all platforms (#9400)
macfarla Nov 7, 2025
003947e
Remove RetryingGetHeaderFromPeerByNumberTask (#9399)
Matilda-Clerke Nov 7, 2025
d3caa56
resolve completed TODOs and some hard fork tidy up (#9406)
macfarla Nov 7, 2025
79dd4d8
Add configuration options for BAL-related parameters (#9387)
mirgee Nov 7, 2025
7e0d89a
Transaction broadcast remove support for pre eth/65 peers (#9405)
fab-10 Nov 10, 2025
2f14358
Move tx precomputations to Computation executor (#9403)
fab-10 Nov 10, 2025
62c62a9
feat: Use multistage Docker build for selecting JRE (#9392)
usmansaleem Nov 11, 2025
0644245
Fix flaky test PivotBlockRetrieverTest.shouldRecoverFromUnresponsiveP…
Matilda-Clerke Nov 11, 2025
8ed73a4
back to 25 peers
pinges Nov 11, 2025
b344eca
set difficulty for the checkpoint at the beginning
pinges Nov 11, 2025
020a0aa
add logging
pinges Nov 11, 2025
a3c39bd
rename to SanpSyncChainDownloader
pinges Nov 12, 2025
7e4bec6
undo changes to checkpoint sync
pinges Nov 12, 2025
7da4030
try to optimise request sizes
pinges Nov 13, 2025
e5bcaaa
don't change the parallelism
pinges Nov 13, 2025
a867a3e
Remove RetryingGetHeadersEndingAtFromPeerByHashTask (#9411)
Matilda-Clerke Nov 11, 2025
a26bcf7
Log constructed and block BALs on mismatch (#9402)
mirgee Nov 11, 2025
c64522c
was hitting the operations limit with plenty left still. stale remova…
jflo Nov 11, 2025
7681b11
P256Verify unit test typo (#9412)
siladu Nov 11, 2025
fedfa0b
use error code 3 for reverts (#9365)
macfarla Nov 11, 2025
db53af5
update deprecated call to url (#9410)
macfarla Nov 12, 2025
cdf23a7
test: Implement fuzz testing framework for P256Verify precompiled con…
bshastry Nov 12, 2025
15eeb4b
Fix colored output (#9326)
jintukumardas Nov 12, 2025
92f1ef1
adds ETC deprecation warning to CHANGELOG (#9428)
jflo Nov 12, 2025
5d1efe8
clean up fast sync state
pinges Nov 16, 2025
01ab1d9
Modernize eth protocol configuration code (#9423)
fab-10 Nov 13, 2025
6b1abd4
Do not log BAL configuration in configuration overview on startup (#9…
mirgee Nov 13, 2025
61c0381
add explicit override for Address.hashCode (#9382)
macfarla Nov 13, 2025
126098f
Add benchmark for SelfBalance (#9415)
lu-pinto Nov 14, 2025
87a2850
Make the max size of a transactions p2p message configurable (#9424)
fab-10 Nov 14, 2025
ac55567
Add trace log to transaction broadcast for easier debug (#9433)
fab-10 Nov 14, 2025
ec66142
do not store headers again
pinges Nov 16, 2025
984f5c0
unused var
pinges Nov 16, 2025
102abc8
improve import
pinges Nov 17, 2025
466e83e
remove unused compareTo method (#9435)
macfarla Nov 16, 2025
ed520d7
use the right method for difficulty
pinges Nov 17, 2025
d80333f
logging
pinges Nov 17, 2025
4ab5b12
start world state after first backward header download
pinges Nov 18, 2025
4b9e3bb
add deprecation date for holesky, classic, mordor networks (#9437)
macfarla Nov 17, 2025
508f701
feat: Java 25 optimized vm options in startup scripts and in Docker i…
usmansaleem Nov 17, 2025
a61fc5a
add logging
pinges Nov 19, 2025
17e642b
Remove unused parameter, remove duplicated constructor (#9441)
Gabriel-Trintinalia Nov 18, 2025
24e6928
Optimise toFastHex for engine_getBlobsV2 (#9426)
siladu Nov 18, 2025
a016f18
Add transaction tracing support to block test command (#9310)
bshastry Nov 18, 2025
d9f8691
Ephemery Fusaka activation (#9354)
taxmeifyoucan Nov 19, 2025
6c57bb4
Revert "start world state after first backward header download"
pinges Nov 20, 2025
189d953
undo later start of world state sync
pinges Nov 20, 2025
96a7805
Fix BAL-related bug in constructor of `RequestProcessingContext` (#9446)
mirgee Nov 19, 2025
e185829
Include system call target in BAL (#9465)
mirgee Nov 19, 2025
3435da4
Fix: default to zero prevrandao if not present when creating a pendin…
fab-10 Nov 19, 2025
7e0fc67
Fix nonce encoding and decoding in BALs (#9468)
mirgee Nov 19, 2025
bf6dfc0
Fix nonce comparison in AccessLocationTracker (#9469)
mirgee Nov 19, 2025
da8f39f
linea genesis and network name (#9436)
macfarla Nov 19, 2025
0fcc851
feat: add state override to debug_traceCall (#9463)
Gabriel-Trintinalia Nov 19, 2025
5f6ca33
refactor(consensus): remove redundant Optional wrapping patterns (#9440)
Bilogweb3 Nov 20, 2025
a8ea583
docs: fix comment-code mismatch in PlatformDetector.normalizeJavaVers…
futreall Nov 20, 2025
3feed2e
add logging for get accounts
pinges Nov 24, 2025
19f3b2b
resolved some deprecation warnings (#9474)
macfarla Nov 21, 2025
0f322cc
refactor: decouple native requirement (#9479)
Gabriel-Trintinalia Nov 21, 2025
7577aef
remove PoW specific RPCs (#9481)
macfarla Nov 21, 2025
e45f462
removed experimental PoW mining options (#9480)
macfarla Nov 21, 2025
96482df
attempt fix for flaky BesuEventsPluginTest (#9483)
macfarla Nov 21, 2025
384a4f0
attempt fix for flaky test (#9482)
macfarla Nov 24, 2025
c673c88
RPC - return null result if requested block not found (#9303)
macfarla Nov 24, 2025
e7247f9
close rocksdb transaction correctly with bonsai (#9467)
matkt Nov 24, 2025
77f1d2a
no recursion and fix one off
pinges Nov 25, 2025
a0c39d7
feat: implement diff mode tracer (#9442)
Gabriel-Trintinalia Nov 24, 2025
70e0725
Various `TransactionType` small optimizations (#9439)
fab-10 Nov 24, 2025
53fddc5
Optimise engine_getPayload* and engine_getBlobsV2 (#9445)
siladu Nov 24, 2025
e071401
Always record call recipient in BAL when computing gas cost if transf…
mirgee Nov 24, 2025
3e3f292
remove PoW RPC method eth_coinbase (#9487)
macfarla Nov 25, 2025
284b66f
remove PoW CLI options --miner-enabled and --miner-coinbase (#9486)
macfarla Nov 25, 2025
1d0746d
reduce parallelism for header backward download
pinges Nov 26, 2025
95d99a9
increase parallelism back to old value and reduce the max outstanding…
pinges Nov 26, 2025
021e0ff
reduce the number of receipts downloaded at a time, and logging
pinges Nov 26, 2025
4178a56
more logging
pinges Nov 27, 2025
1de3aa4
fix transaction type decoding
pinges Dec 1, 2025
e07d3d9
Update Besu native libs to 1.4.1 (#9499)
fab-10 Nov 26, 2025
3f4901b
remove workerPool, use static factory (#9496)
MqllR Nov 26, 2025
6123916
refactor: move NetworkName to better package and rename it (#9490)
Gabriel-Trintinalia Nov 27, 2025
511d40d
add Clique mining deprecation message (#9500)
macfarla Nov 27, 2025
c28008b
update use of deprecated ObjectNode.fields() method (#9417)
macfarla Nov 27, 2025
6f8efbc
feat(genesis): Add Linea Osaka HF (#9505)
julien-marchand Nov 27, 2025
d604913
remove PoW CLI --miner-enabled, --miner-coinbase Part 2 (clique) (#9497)
macfarla Nov 27, 2025
add0f10
added Awaitility style async (#9492)
macfarla Nov 27, 2025
bcffa74
remove PoW support frm Json block importer (#9501)
macfarla Nov 27, 2025
8d9a51f
removed smart contract permissioning test resources (#9509)
macfarla Nov 28, 2025
ebbd0ba
remove PoW tests (#9507)
macfarla Nov 28, 2025
5650736
Silence expected WARN log that maybe print during block creation canc…
fab-10 Nov 28, 2025
7ff81b8
Bonsai archive genesis bug (#9485)
jframe Dec 1, 2025
2d3e171
Add default constructor to NoopMiningCoordinator (#9508)
macfarla Dec 1, 2025
15b664c
Make network option underscore and hyphen insensitive (#9512)
fab-10 Dec 1, 2025
eb46eb3
feat(genesis): Add Linea Mainnet Osaka HF (#9517)
julien-marchand Dec 1, 2025
69cf59d
add logging
pinges Dec 2, 2025
dab9dec
fix transaction receipt type 0c80 (#9520)
pinges Dec 2, 2025
5cffba2
add logging
pinges Dec 3, 2025
5620f32
Add MalformedRlpFromPeerException to PeerTaskExecutor system (#9521)
Matilda-Clerke Dec 2, 2025
c27b3b9
feat: Add eth_subscribe and eth_unsubscribe support to IPC service (#…
MqllR Dec 2, 2025
c10a91d
replace Pow miner in non-PoW tests (#9498)
macfarla Dec 2, 2025
9b11323
Optimize performances of AND, OR, XOR and NOT opcodes (#9489)
ahamlat Dec 2, 2025
b8d9eef
add linea update PR to changelog (#9523)
macfarla Dec 2, 2025
70188d7
Fix: MiningConfiguration object must not be re-created (#9518)
fab-10 Dec 2, 2025
f8f4c42
feat(block-simulator): compute blob gas and add support for parent be…
Gabriel-Trintinalia Dec 3, 2025
6aaa155
Add changelog entry for #9519 (#9526)
pinges Dec 3, 2025
f2af50d
more logging
pinges Dec 3, 2025
eeea5f5
comment out all comments
pinges Dec 4, 2025
b69b38b
do not assign a peer
pinges Dec 4, 2025
46107fb
get back the logging
pinges Dec 4, 2025
87e6249
do never assign a peer
pinges Dec 4, 2025
2f8f871
Revert "get back the logging"
pinges Dec 4, 2025
85e036f
fix: only touch coinbase after valid transaction in state tests (#9524)
bshastry Dec 3, 2025
17c50b6
Enable BAL-based state root computation to persist state changes (#9438)
mirgee Dec 3, 2025
2d0efdb
Fix for gas estimation related to failing Hive tests (#9530)
fab-10 Dec 3, 2025
2b8f2d1
wait for transaction to be executed before checking update (#9522)
macfarla Dec 3, 2025
61f8646
feat: allow plugins to send p2p messages (#9527)
Gabriel-Trintinalia Dec 3, 2025
4e47482
remove genesis files no longer used in ATs (#9532)
macfarla Dec 4, 2025
c4fb10a
clean up PR
pinges Dec 9, 2025
66762c9
feat: Add RPC timeout interruption with CompletableFuture-based imple…
jflo Dec 5, 2025
c6ef0c5
Improve output of plugin versions (#9534)
fab-10 Dec 5, 2025
040c712
Fix: Register all BFT sub-protocols during IBFT2→QBFT consensus migra…
saeeddawod Dec 5, 2025
a03e014
feat: Implement callTracer for debug_trace* (#9072)
usmansaleem Dec 5, 2025
9f49e13
rotate changelog - release 25.12.0-RC1 (#9543)
matkt Dec 5, 2025
ba98395
accept client or server timeout for flaky timeout test (#9552)
macfarla Dec 9, 2025
c43fc57
fix off by one
pinges Dec 9, 2025
828e6a4
optimize header retrieval
pinges Dec 10, 2025
01e2e76
Revert "Rpc Timeout interruption (#9117)" (#9555)
macfarla Dec 10, 2025
77cc18e
fix off by one and add unit tests
pinges Dec 10, 2025
d182c7a
more unit tests
pinges Dec 10, 2025
0cfe5ac
fix file generation
pinges Dec 11, 2025
06999b3
refactor: move target gas limit to network definition (#9502)
Gabriel-Trintinalia Dec 10, 2025
0aac223
cleanup
pinges Dec 12, 2025
9b7e7c0
some logging and comment improvements
pinges Dec 15, 2025
43c5eac
Merge branch 'main' of github.com:hyperledger/besu into HeadersBackward
pinges Dec 15, 2025
187e7cd
fix some problems
pinges Dec 15, 2025
25130b9
fix bft acceptance test
pinges Dec 16, 2025
d4498cd
Merge branch 'main' of github.com:hyperledger/besu into HeadersBackward
pinges Dec 16, 2025
67bc075
add consensus as well
pinges Dec 16, 2025
8a845f5
fix unit test
pinges Dec 16, 2025
4127ed6
remove some redundant tests and fix others
pinges Dec 18, 2025
f1612ba
remove and fix some more unit tests
pinges Dec 18, 2025
acc2f80
Merge branch 'main' of github.com:hyperledger/besu into HeadersBackward
pinges Dec 18, 2025
0defe82
more test clean-up
pinges Dec 18, 2025
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 @@ -482,7 +482,11 @@ public ThreadBesuNodeRunner provideThreadBesuNodeRunner() {
public static class BesuControllerModule {
@Provides
@Singleton
public SynchronizerConfiguration provideSynchronizationConfiguration() {
public SynchronizerConfiguration provideSynchronizationConfiguration(final BesuNode node) {
// Use the synchronizer configuration set on the node, otherwise use default
if (node.getSynchronizerConfiguration() != null) {
return node.getSynchronizerConfiguration();
}
final SynchronizerConfiguration synchronizerConfiguration =
SynchronizerConfiguration.builder().build();
return synchronizerConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
import org.hyperledger.besu.ethereum.eth.sync.snapsync.ImmutableSnapSyncConfiguration;
import org.hyperledger.besu.ethereum.eth.sync.snapsync.SnapSyncConfiguration;
import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode;

import java.util.stream.Stream;
Expand Down Expand Up @@ -51,10 +53,24 @@ public void shouldSyncValidatorNode(
final BesuNode validator3 = nodeFactory.createBonsaiNodeFixedPort(besu, "validator3");
final BesuNode validator4 = nodeFactory.createBonsaiNodeFixedPort(besu, "validator4");

// Configure validators with specified sync mode
// Enable snap server on validators 1-3 so they can serve world state data
// This is required for SNAP/CHECKPOINT sync modes to work
final SnapSyncConfiguration snapServerEnabledConfig =
ImmutableSnapSyncConfiguration.builder().isSnapServerEnabled(true).build();
final SynchronizerConfiguration fullSyncWithSnapServer =
SynchronizerConfiguration.builder()
.syncMode(SyncMode.FULL)
.syncMinimumPeerCount(1)
.snapSyncConfiguration(snapServerEnabledConfig)
.build();

validator1.setSynchronizerConfiguration(fullSyncWithSnapServer);
validator2.setSynchronizerConfiguration(fullSyncWithSnapServer);
validator3.setSynchronizerConfiguration(fullSyncWithSnapServer);

// Configure validator4 with the test's specified sync mode (FULL/SNAP/CHECKPOINT)
final SynchronizerConfiguration syncConfig =
SynchronizerConfiguration.builder().syncMode(syncMode).syncMinimumPeerCount(1).build();

validator4.setSynchronizerConfiguration(syncConfig);

// Start first three validators
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ configure(allprojects - project(':platform')) {
java {
// This path needs to be relative to each project
target 'src/**/*.java'
targetExclude '**/src/reference-test/**', '**/src/main/generated/**', '**/src/test/generated/**', '**/src/jmh/generated/**'
targetExclude '**/src/reference-test/**', '**/src/main/generated/**', '**/src/test/generated/**', '**/src/jmh/generated/**', '**/build/generated/**'
removeUnusedImports()
googleJavaFormat('1.25.2')
importOrder 'org.hyperledger', 'java', ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public void subscribe() {
}
syncState.subscribeSyncStatus(
syncStatus -> {
if (syncState.syncTarget().isPresent()) {
if (syncState.syncTarget().isPresent() || !syncState.isInitialSyncPhaseDone()) {
// We're syncing so stop doing other stuff
LOG.info("Stopping BFT mining coordinator while we are syncing");
stop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.hyperledger.besu.ethereum.eth.sync.state.SyncState;

import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;

Expand Down Expand Up @@ -85,7 +86,7 @@ protected boolean weAreAValidator(final ValidatorProvider validatorProvider) {
}

@Override
public Optional<FastSyncState> selectNewPivotBlock() {
public CompletableFuture<FastSyncState> selectNewPivotBlock() {

final BftContext bftContext = protocolContext.getConsensusContext(BftContext.class);
final ValidatorProvider validatorProvider = bftContext.getValidatorProvider();
Expand All @@ -102,7 +103,11 @@ public Optional<FastSyncState> selectNewPivotBlock() {
throw new NoSyncRequiredException();
}

return bestPeer.flatMap(this::fromBestPeer);
return bestPeer
.map(this::fromBestPeer)
.orElse(
CompletableFuture.failedFuture(
new RuntimeException("No peers with sufficient height")));
} else {
// Treat us being the only validator as a special case. We are the only node that can produce
// blocks so we won't wait to sync with a non-validator node that may or may not exist
Expand Down Expand Up @@ -154,6 +159,7 @@ public Optional<FastSyncState> selectNewPivotBlock() {
}
}

return Optional.empty();
return CompletableFuture.failedFuture(
new RuntimeException("Not enough peers to select pivot block"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
package org.hyperledger.besu.consensus.qbft.sync;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
Expand All @@ -30,13 +29,11 @@
import org.hyperledger.besu.ethereum.eth.manager.EthPeers;
import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
import org.hyperledger.besu.ethereum.eth.sync.fastsync.FastSyncState;
import org.hyperledger.besu.ethereum.eth.sync.fastsync.NoSyncRequiredException;
import org.hyperledger.besu.ethereum.eth.sync.state.SyncState;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -79,8 +76,12 @@ public void returnEmptySyncStateIfValidatorWithOtherValidatorsButNoPeers() {
BFTPivotSelectorFromPeers pivotSelector =
new BFTPivotSelectorFromPeers(
ethContext, syncConfig, syncState, protocolContext, nodeKey, blockHeader);
Optional<FastSyncState> pivotState = pivotSelector.selectNewPivotBlock();
assertThat(pivotState.isEmpty()).isTrue();
try {
pivotSelector.selectNewPivotBlock().get();
fail("Expected CompletableFuture to be failed but it completed successfully");
} catch (Exception e) {
// Expected - the future should fail when no peers are available
}
}

@Test
Expand All @@ -99,7 +100,7 @@ public void returnNoSyncRequiredIfOnlyValidatorAndNoPeers() {
ethContext, syncConfig, syncState, protocolContext, nodeKey, blockHeader);

try {
Optional<FastSyncState> pivotState = pivotSelector.selectNewPivotBlock();
pivotSelector.selectNewPivotBlock();
fail("Expected NoSyncRequiredException but none thrown");
} catch (NoSyncRequiredException e) {
// Ignore - just make sure we get here
Expand All @@ -114,8 +115,12 @@ public void returnEmptySyncStateIfNonValidatorWithNoBestPeer() {
new BFTPivotSelectorFromPeers(
ethContext, syncConfig, syncState, protocolContext, nodeKey, blockHeader);

Optional<FastSyncState> pivotState = pivotSelector.selectNewPivotBlock();
assertThat(pivotState.isEmpty()).isTrue();
try {
pivotSelector.selectNewPivotBlock().get();
fail("Expected CompletableFuture to be failed but it completed successfully");
} catch (Exception e) {
// Expected - the future should fail when no best peer is available
}
}

@Test
Expand All @@ -127,7 +132,11 @@ public void returnEmptySyncStateIfValidatorAndNotAtGenesisAndOtherValidators() {
new BFTPivotSelectorFromPeers(
ethContext, syncConfig, syncState, protocolContext, nodeKey, blockHeader);

Optional<FastSyncState> pivotState = pivotSelector.selectNewPivotBlock();
assertThat(pivotState.isEmpty()).isTrue();
try {
pivotSelector.selectNewPivotBlock().get();
fail("Expected CompletableFuture to be failed but it completed successfully");
} catch (Exception e) {
// Expected - the future should fail when no best peer is available
}
}
}
6 changes: 4 additions & 2 deletions ethereum/api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,10 @@ tasks.register('generateTestBlockchain') {
dependsOn(configurations.testResourceGeneration)
dependsOn(processTestResources)
doLast {
if(!dataPath.exists()) {
mkdir(dataPath)
if(!file(blocksBin).exists()) {
if(!dataPath.exists()) {
mkdir(dataPath)
}

javaexec {
main = 'org.hyperledger.besu.Besu'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext)
mergeCoordinator.getOrSyncHeadByHash(
forkChoice.getHeadBlockHash(), forkChoice.getFinalizedBlockHash());

if (maybeNewHead.isEmpty()) {
if (maybeNewHead.isEmpty() || mergeContext.get().isSyncing()) {
return syncingResponse(requestId, forkChoice);
}

Expand Down Expand Up @@ -191,10 +191,6 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext)
return new JsonRpcSuccessResponse(requestId, parameterValidationResult);
}

if (mergeContext.get().isSyncing()) {
return syncingResponse(requestId, forkChoice);
}

maybePayloadAttributes.ifPresentOrElse(
this::logPayload, () -> LOG.debug("Payload attributes are null"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@ default boolean blockIsOnCanonicalChain(final Hash blockHeaderHash) {
*/
Optional<BlockHeader> getBlockHeader(long blockNumber);

/**
* Returns a list of block headers starting from the given block number.
*
* @param startBlockNumber The number of the first block header.
* @param numberOfHeaders The number of blocks to retrieve.
* @return The block headers.
*/
List<BlockHeader> getBlockHeaders(long startBlockNumber, int numberOfHeaders);

/**
* Return true if the block corresponding the hash is present.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.LogWithMetadata;
import org.hyperledger.besu.ethereum.core.SyncBlock;
import org.hyperledger.besu.ethereum.core.SyncBlockBody;
import org.hyperledger.besu.ethereum.core.SyncBlockWithReceipts;
import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.core.TransactionReceipt;
import org.hyperledger.besu.ethereum.mainnet.block.access.list.BlockAccessList;
Expand Down Expand Up @@ -88,7 +90,7 @@ public class DefaultBlockchain implements MutableBlockchain {

private Counter gasUsedCounter = NoOpMetricsSystem.NO_OP_COUNTER;
private Counter numberOfTransactionsCounter = NoOpMetricsSystem.NO_OP_COUNTER;
// difficultyForSyncing is thread safe, as it is only used in the one thread of the import step

private Difficulty difficultyForSyncing = Difficulty.ZERO;

private DefaultBlockchain(
Expand Down Expand Up @@ -371,6 +373,35 @@ public Optional<BlockHeader> getBlockHeader(final long blockNumber) {
return blockchainStorage.getBlockHash(blockNumber).flatMap(this::getBlockHeader);
}

@Override
public List<BlockHeader> getBlockHeaders(final long firstBlock, final int numberOfHeaders) {
List<BlockHeader> headers = new ArrayList<>(numberOfHeaders);

final Optional<BlockHeader> optionalBlockHeaderStart =
getBlockHeader(firstBlock + numberOfHeaders - 1);
if (optionalBlockHeaderStart.isEmpty()) {
LOG.error("Missing header at block number {}", firstBlock + numberOfHeaders - 1);
throw new IllegalStateException(
"Missing header at block " + (firstBlock + numberOfHeaders - 1));
} else {
final BlockHeader startBlockHeader = optionalBlockHeaderStart.get();
headers.add(startBlockHeader);
Hash nextHash = startBlockHeader.getParentHash();
for (int i = 0; i < numberOfHeaders - 1; i++) {
Optional<BlockHeader> optionalBlockHeader = getBlockHeader(nextHash);
if (optionalBlockHeader.isEmpty()) {
LOG.error("Missing header for block {}", nextHash);
throw new IllegalStateException("Missing header for block " + nextHash);
} else {
BlockHeader blockHeader = optionalBlockHeader.get();
headers.addFirst(blockHeader);
nextHash = blockHeader.getParentHash();
}
}
}
return headers;
}

@Override
public Optional<BlockHeader> getBlockHeader(final Hash blockHeaderHash) {
return blockHeadersCache
Expand Down Expand Up @@ -523,6 +554,18 @@ public synchronized void storeBlock(
appendBlockHelper(new BlockWithReceipts(block, receipts), true, true);
}

@Override
public void storeBlockHeaders(final List<BlockHeader> blockHeaders) {
final BlockchainStorage.Updater updater = blockchainStorage.updater();
blockHeaders.forEach(
header -> {
final Hash hash = header.getHash();
updater.putBlockHeader(hash, header);
updater.putBlockHash(header.getNumber(), hash);
});
updater.commit();
}

@Override
public void unsafeStoreHeader(final BlockHeader blockHeader, final Difficulty totalDifficulty) {
// as this is used only to store premerge block headers, we don't cache the header in this case
Expand Down Expand Up @@ -650,6 +693,31 @@ public synchronized void unsafeImportBlock(
updater.commit();
}

@Override
public void unsafeImportSyncBodiesAndReceipts(
final List<SyncBlockWithReceipts> blocksAndReceipts, final boolean indexTransactions) {
final BlockchainStorage.Updater updater = blockchainStorage.updater();
for (final SyncBlockWithReceipts blockAndReceipts : blocksAndReceipts) {
final SyncBlock block = blockAndReceipts.getBlock();
final BlockHeader header = block.getHeader();
final Hash blockHash = header.getHash();
final SyncBlockBody body = block.getBody();
updater.putBlockHash(header.getNumber(), blockHash);
updater.putSyncBlockBody(blockHash, body);
updater.putTransactionReceipts(blockHash, blockAndReceipts.getReceipts());
this.totalDifficulty = calculateTotalDifficultyForSyncing(header);
updater.putTotalDifficulty(blockHash, totalDifficulty);
this.chainHeader = header;
if (indexTransactions) {
final List<Hash> listOfTxHashes =
body.getEncodedTransactions().stream().map(Hash::hash).toList();
indexTransactionsForBlock(updater, blockHash, listOfTxHashes);
}
}
updater.setChainHead(chainHeader.getBlockHash());
updater.commit();
}

@Override
public synchronized void unsafeSetChainHead(
final BlockHeader blockHeader, final Difficulty totalDifficulty) {
Expand All @@ -674,6 +742,14 @@ public Difficulty calculateTotalDifficulty(final BlockHeader blockHeader) {
return blockHeader.getDifficulty().add(parentTotalDifficulty);
}

/**
* Calculates the total difficulty (TD) during the sync. This method calculates the TD relying on
* the TD of the previous block being available. This method has to be called IN ORDER and is NOT
* THREAD SAFE.
*
* @param blockHeader The block header of the block for which the total difficulty is needed.
* @return The total difficulty
*/
private Difficulty calculateTotalDifficultyForSyncing(final BlockHeader blockHeader) {
if (blockHeader.getNumber() == BlockHeader.GENESIS_BLOCK_NUMBER) {
difficultyForSyncing = blockHeader.getDifficulty();
Expand All @@ -682,7 +758,13 @@ private Difficulty calculateTotalDifficultyForSyncing(final BlockHeader blockHea
blockchainStorage
.getTotalDifficulty(blockHeader.getParentHash())
.orElseThrow(
() -> new IllegalStateException("Blockchain is missing total difficulty data."));
() ->
new IllegalStateException(
"Blockchain is missing total difficulty data for block "
+ (blockHeader.getNumber() - 1)
+ ", block hash "
+ blockHeader.getParentHash()
+ "."));
difficultyForSyncing = parentTotalDifficulty.add(blockHeader.getDifficulty());
} else {
difficultyForSyncing = difficultyForSyncing.add(blockHeader.getDifficulty());
Expand Down Expand Up @@ -736,6 +818,13 @@ private BlockAddedEvent updateCanonicalChainData(
if (newBlock.getHeader().getParentHash().equals(chainHead) || chainHead == null) {
return handleNewHead(updater, newBlock, receipts, transactionIndexing);
} else {
LOG.error(
"New block {} parent hash {} does not match current head block {} hash {} (chainHead= {}).",
newBlock.getHeader().getNumber(),
newBlock.getHeader().getParentHash(),
chainHeader.getNumber(),
chainHeader.getHash(),
chainHead);
throw new RuntimeException("Blocks during sync should always be in order");
}
} catch (final NoSuchElementException e) {
Expand Down
Loading