@Test
  void shouldRetrieveStateUpdatePostTracingForAllBlocks() {
    final Address addressToVerify =
        Address.fromHexString("0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b");

    final long persistedNonceForAccount =
        worldStateArchive.getWorldState().get(addressToVerify).getNonce();

    final long startBlock = 1;
    final long endBlock = 32;
    final BlockAwareOperationTracer opTracer = mock(BlockAwareOperationTracer.class);

    traceService.trace(
        startBlock,
        endBlock,
        worldState -> {
          assertThat(worldState.get(addressToVerify).getNonce()).isEqualTo(0);
        },
        worldState -> {
          assertThat(worldState.get(addressToVerify).getNonce())
              .isEqualTo(persistedNonceForAccount);
        },
        opTracer);

    assertThat(worldStateArchive.getWorldState().get(addressToVerify).getNonce())
        .isEqualTo(persistedNonceForAccount);

    LongStream.rangeClosed(startBlock, endBlock)
        .mapToObj(blockchain::getBlockByNumber)
        .map(Optional::get)
        .forEach(
            tracedBlock -> {
              verify(opTracer)
                  .traceStartBlock(
                      tracedBlock.getHeader(),
                      tracedBlock.getBody(),
                      tracedBlock.getHeader().getCoinbase());
              tracedBlock
                  .getBody()
                  .getTransactions()
                  .forEach(
                      tx -> {
                        verify(opTracer).tracePrepareTransaction(any(), eq(tx));
                        verify(opTracer).traceStartTransaction(any(), eq(tx));
                        verify(opTracer)
                            .traceEndTransaction(
                                any(),
                                eq(tx),
                                anyBoolean(),
                                any(),
                                any(),
                                anyLong(),
                                any(),
                                anyLong());
                      });

              verify(opTracer).traceEndBlock(tracedBlock.getHeader(), tracedBlock.getBody());
            });
  }
The blockchain for testing has a height of 32 and the account
0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b makes a transaction per block. So, in the head, the
nonce of this account should be 32.
app/src/test/java/org/hyperledger/besu/services/TraceServiceImplTest.java