Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7311: add GetReceiptsFromPeerTask #7638

Open
wants to merge 83 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
4b80016
7311: Add PeerTask system for use in future PRs
Matilda-Clerke Sep 17, 2024
a8d5a9f
7311: Clean up some warnings
Matilda-Clerke Sep 17, 2024
4c64dbe
7311: Add feature toggle for enabling use of the peertask system wher…
Matilda-Clerke Sep 17, 2024
7a94fe2
7311: Remove log used for testing, apply spotless
Matilda-Clerke Sep 17, 2024
ace5dd1
7311: Add private constructor to PeerTaskFeatureToggle to prevent ins…
Matilda-Clerke Sep 17, 2024
52d440a
7311: Switch to logging a warning instead of throwing an exception wh…
Matilda-Clerke Sep 17, 2024
f392a0f
7311: Update javadoc to match previous commit
Matilda-Clerke Sep 17, 2024
2fb2690
7311: spotless
Matilda-Clerke Sep 17, 2024
f14aaeb
7311: Fix broken BesuCommandTest
Matilda-Clerke Sep 18, 2024
06553be
Merge branch 'refs/heads/7311-add-cli-feature-toggle-for-peertask-sys…
Matilda-Clerke Sep 18, 2024
1ba5184
7311: add class
Matilda-Clerke Sep 18, 2024
f2500dd
7311: Move PeerTaskFeatureToggle to more appropriate location
Matilda-Clerke Sep 18, 2024
0992c35
Merge branch 'refs/heads/7311-add-cli-feature-toggle-for-peertask-sys…
Matilda-Clerke Sep 18, 2024
33b810b
7311: add X prefix to peertask-system-enabled
Matilda-Clerke Sep 18, 2024
a378d22
Merge branch 'refs/heads/7311-add-cli-feature-toggle-for-peertask-sys…
Matilda-Clerke Sep 18, 2024
15b6bdf
7311: Move --Xpeertask-system-enabled out of BesuCommand and make hidden
Matilda-Clerke Sep 18, 2024
a9f6714
Merge branch 'refs/heads/7311-add-cli-feature-toggle-for-peertask-sys…
Matilda-Clerke Sep 18, 2024
e3fbc6c
7311: spotless
Matilda-Clerke Sep 18, 2024
c03bffb
Merge branch 'refs/heads/7311-add-cli-feature-toggle-for-peertask-sys…
Matilda-Clerke Sep 18, 2024
5e8b750
Merge branch 'main' into 7311-add-cli-feature-toggle-for-peertask-system
macfarla Sep 18, 2024
e4be5c0
Merge branch 'main' into 7311-add-peertask-foundation-code
Matilda-Clerke Sep 18, 2024
bc11e0c
Merge branch 'main' into 7311-add-cli-feature-toggle-for-peertask-system
Matilda-Clerke Sep 18, 2024
b2a45c2
7311: Add GetReceiptsFromPeerTask
Matilda-Clerke Sep 19, 2024
513b74f
7311: Move isPeerTaskSystemEnabled to SynchronizerOptions
Matilda-Clerke Sep 19, 2024
6b86919
Merge remote-tracking branch 'origin/7311-add-cli-feature-toggle-for-…
Matilda-Clerke Sep 19, 2024
645e0e3
Merge branch 'refs/heads/7311-add-cli-feature-toggle-for-peertask-sys…
Matilda-Clerke Sep 19, 2024
4522414
Merge branch 'main' into 7311-add-GetReceiptsFromPeerTask
Matilda-Clerke Sep 19, 2024
28fc2cd
Merge remote-tracking branch 'origin/7311-add-GetReceiptsFromPeerTask…
Matilda-Clerke Sep 19, 2024
2364ed5
7311: Fix javadoc issue
Matilda-Clerke Sep 19, 2024
ced19cd
Merge branch 'refs/heads/7311-add-cli-feature-toggle-for-peertask-sys…
Matilda-Clerke Sep 19, 2024
03f6495
7311: Fix javadoc issue
Matilda-Clerke Sep 19, 2024
5859444
Merge branch 'main' into 7311-add-peertask-foundation-code
Matilda-Clerke Sep 19, 2024
9a4f3dd
Merge branch 'main' into 7311-add-GetReceiptsFromPeerTask
Matilda-Clerke Sep 19, 2024
97e5918
7311: Move PeerTaskFeatureToggleTestHelper to TestUtil and fix Runner…
Matilda-Clerke Sep 20, 2024
e0f736d
7311: spotless
Matilda-Clerke Sep 20, 2024
df7f62d
Merge branch 'main' into 7311-add-GetReceiptsFromPeerTask
Matilda-Clerke Sep 20, 2024
c335cbe
Merge branch 'main' into 7311-add-peertask-foundation-code
Matilda-Clerke Sep 20, 2024
98aefcd
Merge branch 'main' into 7311-add-cli-feature-toggle-for-peertask-system
Matilda-Clerke Sep 20, 2024
6e734f9
7311: Remove PeerTaskFeatureToggle in favor of including isPeerTaskSy…
Matilda-Clerke Sep 20, 2024
42ca85b
Merge branch 'main' into 7311-add-cli-feature-toggle-for-peertask-system
Matilda-Clerke Sep 20, 2024
76724ed
Merge branch 'refs/heads/7311-add-cli-feature-toggle-for-peertask-sys…
Matilda-Clerke Sep 20, 2024
fc9b3f2
7311: Adjust to the removal of PeerTaskFeatureToggle and use Synchron…
Matilda-Clerke Sep 20, 2024
08c66fd
7311: Reduce timeout in PeerTaskRequestSender to 5s
Matilda-Clerke Sep 20, 2024
049cae2
7311: Refactor PeerManager to be an interface
Matilda-Clerke Sep 20, 2024
b6ec075
Merge branch 'main' into 7311-add-GetReceiptsFromPeerTask
Matilda-Clerke Sep 20, 2024
5afba63
Merge branch 'main' into 7311-add-peertask-foundation-code
Matilda-Clerke Sep 20, 2024
3c1178c
Merge branch 'refs/heads/7311-add-peertask-foundation-code' into 7311…
Matilda-Clerke Sep 20, 2024
5c3a61a
7311: Fix up compile errors after merge
Matilda-Clerke Sep 20, 2024
8448898
7311: Fix MetricsAcceptanceTest
Matilda-Clerke Sep 20, 2024
ab21100
7311: Fix MetricsAcceptanceTest
Matilda-Clerke Sep 20, 2024
2ac52f0
Merge branch 'main' into 7311-add-GetReceiptsFromPeerTask
Matilda-Clerke Sep 20, 2024
f2ac53e
Merge branch 'main' into 7311-add-peertask-foundation-code
Matilda-Clerke Sep 23, 2024
3de578d
Merge branch 'main' into 7311-add-GetReceiptsFromPeerTask
Matilda-Clerke Sep 23, 2024
e901fdf
Merge branch 'main' into 7311-add-peertask-foundation-code
Matilda-Clerke Sep 24, 2024
24e73a8
Merge branch 'main' into 7311-add-GetReceiptsFromPeerTask
Matilda-Clerke Sep 24, 2024
f077206
7311: Fix DownloadReceiptsStep when using peer task system
Matilda-Clerke Sep 25, 2024
fa12495
Merge branch 'main' into 7311-add-GetReceiptsFromPeerTask
Matilda-Clerke Sep 25, 2024
6e349e1
Merge branch 'main' into 7311-add-peertask-foundation-code
Matilda-Clerke Sep 25, 2024
ad86ae6
7311: Rename PeerManager to PeerSelector
Matilda-Clerke Sep 25, 2024
38f04ab
7311: Reword PeerSelector javadoc to avoid implementation details
Matilda-Clerke Sep 25, 2024
6de3fb3
7311: Use ConcurrentHashMap in DefaultPeerSelector
Matilda-Clerke Sep 25, 2024
da9cd43
7311: Reword trace log in DefaultPeerSelector
Matilda-Clerke Sep 25, 2024
ce7d245
7311: Remove unused imports
Matilda-Clerke Sep 25, 2024
c9eb22e
7311: Use a 1 second delay between retries in PeerTaskExecutor to mat…
Matilda-Clerke Sep 25, 2024
e2fda73
7311: Add testGetPeerButNoPeerMatchesFilter to DefaultPeerSelectorTest
Matilda-Clerke Sep 25, 2024
608fece
7311: Add testGetPeerButNoPeerMatchesFilter to DefaultPeerSelectorTest
Matilda-Clerke Sep 25, 2024
0e76000
Merge branch 'refs/heads/7311-add-peertask-foundation-code' into 7311…
Matilda-Clerke Sep 25, 2024
2d07800
7311: spotless
Matilda-Clerke Sep 25, 2024
b910b4d
Merge branch 'refs/heads/7311-add-peertask-foundation-code' into 7311…
Matilda-Clerke Sep 25, 2024
ad26297
7311: Fix MetricsAcceptanceTest
Matilda-Clerke Sep 20, 2024
96c8030
7311: Fix MetricsAcceptanceTest
Matilda-Clerke Sep 20, 2024
b0f2ed0
7311: Modify PeerTaskExecutor metric to include response time from peer
Matilda-Clerke Sep 26, 2024
598b519
7311: Use SubProtocol instead of subprotocol name string in PeerTask
Matilda-Clerke Sep 26, 2024
bc25b16
7311: rename timing context to ignored to prevent intellij warnings
Matilda-Clerke Sep 26, 2024
e31bb70
7311: Use constants for number of retries
Matilda-Clerke Sep 26, 2024
41923d3
7311: Convert PeerTaskExecutorResult to a record
Matilda-Clerke Sep 26, 2024
720f94e
7311: Rename PeerTaskBehavior to PeerTaskRetryBehavior
Matilda-Clerke Sep 29, 2024
7d845b3
7311: Move peer selection logic to PeerSelector
Matilda-Clerke Sep 30, 2024
50c26f1
7311: spotless
Matilda-Clerke Sep 30, 2024
b7c0c95
Merge branch 'main' into 7311-add-peertask-foundation-code
Matilda-Clerke Sep 30, 2024
a81855d
Merge branch 'main' into 7311-add-peertask-foundation-code
Matilda-Clerke Sep 30, 2024
64adedc
Merge branch 'refs/heads/7311-add-peertask-foundation-code' into 7311…
Matilda-Clerke Sep 30, 2024
2c1446e
7311: Fix up everything broken after merge
Matilda-Clerke Oct 1, 2024
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 @@ -55,6 +55,10 @@
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
import org.hyperledger.besu.ethereum.eth.manager.MergePeerFilter;
import org.hyperledger.besu.ethereum.eth.manager.MonitoredExecutors;
import org.hyperledger.besu.ethereum.eth.manager.peertask.DefaultPeerSelector;
import org.hyperledger.besu.ethereum.eth.manager.peertask.PeerSelector;
import org.hyperledger.besu.ethereum.eth.manager.peertask.PeerTaskExecutor;
import org.hyperledger.besu.ethereum.eth.manager.peertask.PeerTaskRequestSender;
import org.hyperledger.besu.ethereum.eth.manager.snap.SnapProtocolManager;
import org.hyperledger.besu.ethereum.eth.peervalidation.CheckpointBlocksPeerValidator;
import org.hyperledger.besu.ethereum.eth.peervalidation.ClassicForkPeerValidator;
Expand Down Expand Up @@ -652,6 +656,10 @@ public BesuController build() {
}

final EthContext ethContext = new EthContext(ethPeers, ethMessages, snapMessages, scheduler);
final PeerSelector peerSelector = new DefaultPeerSelector(currentProtocolSpecSupplier);
ethPeers.streamAllPeers().forEach(peerSelector::addPeer);
final PeerTaskExecutor peerTaskExecutor =
new PeerTaskExecutor(peerSelector, new PeerTaskRequestSender(), metricsSystem);
final boolean fullSyncDisabled = !SyncMode.isFullSync(syncConfig.getSyncMode());
final SyncState syncState = new SyncState(blockchain, ethPeers, fullSyncDisabled, checkpoint);

Expand Down Expand Up @@ -691,7 +699,8 @@ public BesuController build() {
scheduler,
peerValidators,
Optional.empty(),
forkIdManager);
forkIdManager,
peerSelector);

final PivotBlockSelector pivotBlockSelector =
createPivotSelector(
Expand All @@ -703,6 +712,7 @@ public BesuController build() {
worldStateStorageCoordinator,
protocolContext,
ethContext,
peerTaskExecutor,
syncState,
ethProtocolManager,
pivotBlockSelector);
Expand Down Expand Up @@ -825,6 +835,7 @@ private TrieLogPruner createTrieLogPruner(
* @param worldStateStorageCoordinator the world state storage
* @param protocolContext the protocol context
* @param ethContext the eth context
* @param peerTaskExecutor the PeerTaskExecutor
* @param syncState the sync state
* @param ethProtocolManager the eth protocol manager
* @param pivotBlockSelector the pivot block selector
Expand All @@ -835,6 +846,7 @@ protected DefaultSynchronizer createSynchronizer(
final WorldStateStorageCoordinator worldStateStorageCoordinator,
final ProtocolContext protocolContext,
final EthContext ethContext,
final PeerTaskExecutor peerTaskExecutor,
final SyncState syncState,
final EthProtocolManager ethProtocolManager,
final PivotBlockSelector pivotBlockSelector) {
Expand All @@ -846,6 +858,7 @@ protected DefaultSynchronizer createSynchronizer(
worldStateStorageCoordinator,
ethProtocolManager.getBlockBroadcaster(),
ethContext,
peerTaskExecutor,
syncState,
dataDirectory,
storageProvider,
Expand Down Expand Up @@ -1022,6 +1035,7 @@ protected String getSupportedProtocol() {
* @param peerValidators the peer validators
* @param mergePeerFilter the merge peer filter
* @param forkIdManager the fork id manager
* @param peerSelector the PeerSelector
* @return the eth protocol manager
*/
protected EthProtocolManager createEthProtocolManager(
Expand All @@ -1035,7 +1049,8 @@ protected EthProtocolManager createEthProtocolManager(
final EthScheduler scheduler,
final List<PeerValidator> peerValidators,
final Optional<MergePeerFilter> mergePeerFilter,
final ForkIdManager forkIdManager) {
final ForkIdManager forkIdManager,
final PeerSelector peerSelector) {
return new EthProtocolManager(
protocolContext.getBlockchain(),
networkId,
Expand All @@ -1049,7 +1064,8 @@ protected EthProtocolManager createEthProtocolManager(
mergePeerFilter,
synchronizerConfiguration,
scheduler,
forkIdManager);
forkIdManager,
peerSelector);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManager;
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
import org.hyperledger.besu.ethereum.eth.manager.MergePeerFilter;
import org.hyperledger.besu.ethereum.eth.manager.peertask.PeerSelector;
import org.hyperledger.besu.ethereum.eth.manager.snap.SnapProtocolManager;
import org.hyperledger.besu.ethereum.eth.peervalidation.PeerValidator;
import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
Expand Down Expand Up @@ -243,7 +244,8 @@ protected EthProtocolManager createEthProtocolManager(
final EthScheduler scheduler,
final List<PeerValidator> peerValidators,
final Optional<MergePeerFilter> mergePeerFilter,
final ForkIdManager forkIdManager) {
final ForkIdManager forkIdManager,
final PeerSelector peerSelector) {
return besuControllerBuilderSchedule
.get(0L)
.createEthProtocolManager(
Expand All @@ -257,7 +259,8 @@ protected EthProtocolManager createEthProtocolManager(
scheduler,
peerValidators,
mergePeerFilter,
forkIdManager);
forkIdManager,
peerSelector);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManager;
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
import org.hyperledger.besu.ethereum.eth.manager.MergePeerFilter;
import org.hyperledger.besu.ethereum.eth.manager.peertask.PeerSelector;
import org.hyperledger.besu.ethereum.eth.peervalidation.PeerValidator;
import org.hyperledger.besu.ethereum.eth.peervalidation.RequiredBlocksPeerValidator;
import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
Expand Down Expand Up @@ -99,7 +100,8 @@ protected EthProtocolManager createEthProtocolManager(
final EthScheduler scheduler,
final List<PeerValidator> peerValidators,
final Optional<MergePeerFilter> mergePeerFilter,
final ForkIdManager forkIdManager) {
final ForkIdManager forkIdManager,
final PeerSelector peerSelector) {

var mergeContext = protocolContext.getConsensusContext(MergeContext.class);

Expand Down Expand Up @@ -129,7 +131,8 @@ protected EthProtocolManager createEthProtocolManager(
scheduler,
peerValidators,
filterToUse,
forkIdManager);
forkIdManager,
peerSelector);

return ethProtocolManager;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManager;
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
import org.hyperledger.besu.ethereum.eth.manager.MergePeerFilter;
import org.hyperledger.besu.ethereum.eth.manager.peertask.PeerSelector;
import org.hyperledger.besu.ethereum.eth.manager.peertask.PeerTaskExecutor;
import org.hyperledger.besu.ethereum.eth.peervalidation.PeerValidator;
import org.hyperledger.besu.ethereum.eth.sync.DefaultSynchronizer;
import org.hyperledger.besu.ethereum.eth.sync.PivotBlockSelector;
Expand Down Expand Up @@ -163,7 +165,8 @@ protected EthProtocolManager createEthProtocolManager(
final EthScheduler scheduler,
final List<PeerValidator> peerValidators,
final Optional<MergePeerFilter> mergePeerFilter,
final ForkIdManager forkIdManager) {
final ForkIdManager forkIdManager,
final PeerSelector peerSelector) {
return mergeBesuControllerBuilder.createEthProtocolManager(
protocolContext,
synchronizerConfiguration,
Expand All @@ -175,7 +178,8 @@ protected EthProtocolManager createEthProtocolManager(
scheduler,
peerValidators,
mergePeerFilter,
forkIdManager);
forkIdManager,
peerSelector);
}

@Override
Expand Down Expand Up @@ -225,6 +229,7 @@ protected DefaultSynchronizer createSynchronizer(
final WorldStateStorageCoordinator worldStateStorageCoordinator,
final ProtocolContext protocolContext,
final EthContext ethContext,
final PeerTaskExecutor peerTaskExecutor,
final SyncState syncState,
final EthProtocolManager ethProtocolManager,
final PivotBlockSelector pivotBlockSelector) {
Expand All @@ -235,6 +240,7 @@ protected DefaultSynchronizer createSynchronizer(
worldStateStorageCoordinator,
protocolContext,
ethContext,
peerTaskExecutor,
syncState,
ethProtocolManager,
pivotBlockSelector);
Expand Down
34 changes: 28 additions & 6 deletions besu/src/test/java/org/hyperledger/besu/RunnerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public final class RunnerTest {
private Vertx vertx;

@BeforeEach
public void initVertx() {
public void initVertx() throws IllegalAccessException {
vertx = Vertx.vertx();
}

Expand All @@ -131,7 +131,7 @@ public void stopVertx() {
@TempDir private Path temp;

@Test
public void getFixedNodes() {
public void getFixedNodes() throws IllegalAccessException {
final EnodeURL staticNode =
EnodeURLImpl.fromString(
"enode://8f4b88336cc40ef2516d8b27df812e007fb2384a61e93635f1899051311344f3dcdbb49a4fe49a79f66d2f589a9f282e8cc4f1d7381e8ef7e4fcc6b0db578c77@127.0.0.1:30301");
Expand All @@ -153,26 +153,48 @@ public void fullSyncFromGenesis() throws Exception {
// set merge flag to false, otherwise this test can fail if a merge test runs first
MergeConfigOptions.setMergeEnabled(false);

syncFromGenesis(SyncMode.FULL, getFastSyncGenesis());
syncFromGenesis(SyncMode.FULL, getFastSyncGenesis(), false);
}

@Test
public void fullSyncFromGenesisUsingPeerTaskSystem() throws Exception {
// set merge flag to false, otherwise this test can fail if a merge test runs first
MergeConfigOptions.setMergeEnabled(false);

syncFromGenesis(SyncMode.FULL, getFastSyncGenesis(), true);
}

@Test
public void fastSyncFromGenesis() throws Exception {
// set merge flag to false, otherwise this test can fail if a merge test runs first
MergeConfigOptions.setMergeEnabled(false);

syncFromGenesis(SyncMode.FAST, getFastSyncGenesis());
syncFromGenesis(SyncMode.FAST, getFastSyncGenesis(), false);
}

@Test
public void fastSyncFromGenesisUsingPeerTaskSystem() throws Exception {
// set merge flag to false, otherwise this test can fail if a merge test runs first
MergeConfigOptions.setMergeEnabled(false);

syncFromGenesis(SyncMode.FAST, getFastSyncGenesis(), true);
}

private void syncFromGenesis(final SyncMode mode, final GenesisConfigFile genesisConfig)
private void syncFromGenesis(
final SyncMode mode,
final GenesisConfigFile genesisConfig,
final boolean isPeerTaskSystemEnabled)
throws Exception {
final Path dataDirAhead = Files.createTempDirectory(temp, "db-ahead");
final Path dbAhead = dataDirAhead.resolve("database");
final int blockCount = 500;
final NodeKey aheadDbNodeKey = NodeKeyUtils.createFrom(KeyPairUtil.loadKeyPair(dataDirAhead));
final NodeKey behindDbNodeKey = NodeKeyUtils.generate();
final SynchronizerConfiguration syncConfigAhead =
SynchronizerConfiguration.builder().syncMode(SyncMode.FULL).build();
SynchronizerConfiguration.builder()
.syncMode(SyncMode.FULL)
.isPeerTaskSystemEnabled(isPeerTaskSystemEnabled)
.build();
final ObservableMetricsSystem noOpMetricsSystem = new NoOpMetricsSystem();
final var miningParameters = MiningParameters.newDefault();
final var dataStorageConfiguration = DataStorageConfiguration.DEFAULT_FOREST_CONFIG;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*
* Copyright contributors to Hyperledger Besu.
*
* 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.
*
* SPDX-License-Identifier: Apache-2.0
*/
package org.hyperledger.besu.ethereum.mainnet;

import org.hyperledger.besu.datatypes.Hash;
import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.Request;
import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.core.TransactionReceipt;
import org.hyperledger.besu.ethereum.core.Withdrawal;
import org.hyperledger.besu.evm.log.LogsBloomFilter;

import java.util.List;

/** A utility class for body validation tasks. Implemented utilising BodyValidation */
public class BodyValidator {

/**
* Generates the transaction root for a list of transactions
*
* @param transactions the transactions
* @return the transaction root
*/
public Hash transactionsRoot(final List<Transaction> transactions) {
return BodyValidation.transactionsRoot(transactions);
}

/**
* Generates the withdrawals root for a list of withdrawals
*
* @param withdrawals the transactions
* @return the transaction root
*/
public Hash withdrawalsRoot(final List<Withdrawal> withdrawals) {
return BodyValidation.withdrawalsRoot(withdrawals);
}

/**
* Generates the requests root for a list of requests
*
* @param requests list of request
* @return the requests root
*/
public Hash requestsRoot(final List<Request> requests) {
return BodyValidation.requestsRoot(requests);
}

/**
* Generates the receipt root for a list of receipts
*
* @param receipts the receipts
* @return the receipt root
*/
public Hash receiptsRoot(final List<TransactionReceipt> receipts) {
return BodyValidation.receiptsRoot(receipts);
}

/**
* Generates the ommers hash for a list of ommer block headers
*
* @param ommers the ommer block headers
* @return the ommers hash
*/
public Hash ommersHash(final List<BlockHeader> ommers) {
return BodyValidation.ommersHash(ommers);
}

/**
* Generates the logs bloom filter for a list of transaction receipts
*
* @param receipts the transaction receipts
* @return the logs bloom filter
*/
public LogsBloomFilter logsBloom(final List<TransactionReceipt> receipts) {
return BodyValidation.logsBloom(receipts);
}
}
Loading
Loading