  We study the frequentist properties of Bayesian statistical inference for the
stochastic block model, with an unknown number of classes of varying sizes. We
equip the space of vertex labellings with a prior on the number of classes and,
conditionally, a prior on the labels. The number of classes may grow to
infinity as a function of the number of vertices, depending on the sparsity of
the graph. We derive non-asymptotic posterior contraction rates of the form
$P_{\theta_{0,n}}\Pi_n(B_n\mid X^n)\le \epsilon_n$, where $X^n$ is the observed
graph, generated according to $P_{\theta_{0,n}}$, $B_n$ is either $\{\theta_{0,
n}\}$ or, in the very sparse case, a ball around $\theta_{0,n}$ of known
extent, and $\epsilon_n$ is an explicit rate of convergence.
  These results enable conversion of credible sets to confidence sets. In the
sparse case, credible tests are shown to be confidence sets. In the very sparse
case, credible sets are enlarged to form confidence sets. Confidence levels are
explicit, for each $n$, as a function of the credible level and the rate of
convergence.
  Hypothesis testing between the number of classes is considered with the help
of posterior odds, and is shown to be consistent. Explicit upper bounds on
errors of the first and second type and an explicit lower bound on the power of
the tests are given.
