public CompletableFuture<Task<SnapDataRequest>> requestLocalFlatAccounts(
      final Task<SnapDataRequest> requestTask) {

    final AccountFlatDatabaseHealingRangeRequest accountDataRequest =
        (AccountFlatDatabaseHealingRangeRequest) requestTask.getData();
    final BlockHeader blockHeader = fastSyncState.getPivotBlockHeader().get();

    // retrieve accounts from flat database
    final TreeMap<Bytes32, Bytes> accounts = new TreeMap<>();

    worldStateStorageCoordinator.applyOnMatchingFlatMode(
        FlatDbMode.FULL,
        onBonsai -> {
          accounts.putAll(
              onBonsai.streamFlatAccounts(
                  accountDataRequest.getStartKeyHash(),
                  accountDataRequest.getEndKeyHash(),
                  snapSyncConfiguration.getLocalFlatAccountCountToHealPerRequest()));
        });

    final List<Bytes> proofs = new ArrayList<>();
    if (!accounts.isEmpty()) {
      // generate range proof if accounts are present
      proofs.addAll(
          worldStateProofProvider.getAccountProofRelatedNodes(
              blockHeader.getStateRoot(), accounts.firstKey()));
      proofs.addAll(
          worldStateProofProvider.getAccountProofRelatedNodes(
              blockHeader.getStateRoot(), accounts.lastKey()));
    }

    accountDataRequest.setRootHash(blockHeader.getStateRoot());
    accountDataRequest.addLocalData(worldStateProofProvider, accounts, new ArrayDeque<>(proofs));

    return CompletableFuture.completedFuture(requestTask);
  }
Retrieves local accounts from the flat database and generates the necessary proof, updates the
data request with the retrieved information, and returns the modified data request task.

@param requestTask request data to fill
@return data request with local accounts
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/RequestDataStep.java