Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark lord017 colors in consensus #113

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions consensus/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,10 @@ func (in *Inner) sync(checkpoint [32]byte) error {
}
in.apply_optimistic_update(&optimisticUpdate)
errorChan <- nil
log.Printf("consensus client in sync with checkpoint: 0x%s", hex.EncodeToString(checkpoint[:]))
log.Printf(
"\033[1;36mconsensus client in sync with checkpoint: 0x%s\033[0m",
hex.EncodeToString(checkpoint[:]),
)
}()

if err := <-errorChan; err != nil {
Expand Down Expand Up @@ -835,6 +838,7 @@ func (in *Inner) apply_finality_update(update *consensus_core.FinalityUpdate) {
if checkpoint != nil {
in.lastCheckpoint = checkpoint
}
in.Log_finality_update(update)
}
func (in *Inner) apply_optimistic_update(update *consensus_core.OptimisticUpdate) {
genUpdate := GenericUpdate{
Expand All @@ -846,6 +850,7 @@ func (in *Inner) apply_optimistic_update(update *consensus_core.OptimisticUpdate
if checkpoint != nil {
in.lastCheckpoint = checkpoint
}
in.Log_optimistic_update(update)
}
func (in *Inner) Log_finality_update(update *consensus_core.FinalityUpdate) {
participation := float32(getBits(update.SyncAggregate.SyncCommitteeBits[:])) / 512.0 * 100.0
Expand All @@ -861,7 +866,7 @@ func (in *Inner) Log_finality_update(update *consensus_core.FinalityUpdate) {
seconds := int(age.Seconds()) % 60

log.Printf(
"finalized slot slot=%d confidence=%.*f%% age=%02d:%02d:%02d:%02d",
"\033[1;32mfinalized slot\033[0m slot=%d confidence=%.*f%% age=%02d:%02d:%02d:%02d",
in.Store.FinalizedHeader.Slot, decimals, participation, int(days), hours, minutes, seconds,
)
}
Expand All @@ -879,7 +884,7 @@ func (in *Inner) Log_optimistic_update(update *consensus_core.OptimisticUpdate)
seconds := int(age.Seconds()) % 60

log.Printf(
"updated head slot=%d confidence=%.*f%% age=%02d:%02d:%02d:%02d",
"\033[1;33mupdated head\033[0m slot=%d confidence=%.*f%% age=%02d:%02d:%02d:%02d",
in.Store.OptimisticHeader.Slot, decimals, participation, int(days), hours, minutes, seconds,
)
}
Expand Down
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func IsProofValid(
for _, node := range branch {
branchInMerkle = append(branchInMerkle, merkle.Value(node))
}
fmt.Print(attestedHeader.StateRoot)

err := merkle.VerifyProof(common.Hash(attestedHeader.StateRoot), uint64(index), branchInMerkle, merkle.Value(leafObject))
if err != nil {
log.Println("Error in verifying Merkle proof:", err)
Expand Down
Loading