<｜begin▁of▁sentence｜>### Instruction:
In the realm of blockchain technology, consider a scenario where we're examining the stability of consensus among participants in a decentralized network over two distinct blocks of time. We have two separate sets of connections — let's regard them as block-graphs G1 and G2, representing the peer-to-peer interactions within the network at these two different block intervals. As a blockchain developer, you're tasked with verifying if the foundational consensus algorithms that influence the network's topology exhibit any shifts between these two snapshots.

How might we rigorously evaluate the changes in the "consensus geometry," or latent positions, of these peer-to-peer networks to ensure the integrity and consistency of our blockchain protocol? This investigation is crucial for understanding the long-term robustness of our distributed ledger systems.
### Response:
import numpy as np
import networkx as nx
from graspologic.inference import latent_position_test
from graspologic.embed import AdjacencySpectralEmbed

# Generate two random graphs G1 and G2 using NetworkX
G1 = nx.erdos_renyi_graph(n=100, p=0.5)
G2 = nx.erdos_renyi_graph(n=100, p=0.5)

# Convert the graphs to adjacency matrices
A1 = nx.to_numpy_array(G1)
A2 = nx.to_numpy_array(G2)

# Embed the graphs using Adjacency Spectral Embedding
ase = AdjacencySpectralEmbed(n_components=2)
X1 = ase.fit_transform(A1)
X2 = ase.fit_transform(A2)

# Perform the latent position test
result = latent_position_test(A1=A1, A2=A2, embedding='ase', n_components=2, test_case='rotation', n_bootstraps=500, workers=1)

# Print the results
print(f'Statistic: {result.stat}')
print(f'P-value: {result.pvalue}')
if result.pvalue < 0.05:
    print('The latent positions of the two graphs are significantly different.')
else:
    print('The latent positions of the two graphs are not significantly different.')
<|EOT|>
