Skip to content

Commit

Permalink
log
Browse files Browse the repository at this point in the history
  • Loading branch information
s2quake committed Feb 4, 2025
1 parent 062b3c3 commit f6ce114
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Libplanet.Net/Consensus/ConsensusContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -485,13 +485,25 @@ private void OnTipChanged(object? sender, (Block _, Block NewTip) e)
/// </exception>
private Context CreateContext(long height, BlockCommit? lastCommit)
{
_logger.Information(
"Creating a new context for height #{Height} with last commit {LastCommit}",
height,
lastCommit);
var nextStateRootHash = _blockChain.GetNextStateRootHash(height - 1) ??
throw new NullReferenceException(
$"Could not find the next state root hash for index {height - 1}");
_logger.Information(
"Next state root hash for height #{Height} is {NextStateRootHash}",
height,
nextStateRootHash);
ValidatorSet validatorSet = _blockChain
.GetWorldState(nextStateRootHash)
.GetValidatorSet();

_logger.Information(
"Validator set for height #{Height} is {ValidatorSet}",
height,
validatorSet);
Context context = new Context(
_blockChain,
height,
Expand Down

0 comments on commit f6ce114

Please sign in to comment.