Compare commits

...

1 Commits

Author SHA1 Message Date
Potuz
5d1abef5de verbose logs on attestations 2022-08-08 10:35:28 -03:00
2 changed files with 24 additions and 0 deletions

View File

@@ -329,6 +329,12 @@ func (f *ForkChoice) updateBalances(newBalances []uint64) error {
if nextNode == nil {
return errors.Wrap(ErrNilNode, "could not update balances")
}
log.WithFields(logrus.Fields{
"root": fmt.Sprintf("%#x", bytesutil.Trunc(vote.nextRoot[:])),
"NodeBalance": nextNode.balance,
"oldBalance": oldBalance,
"newBalance": newBalance,
}).Info("applying vote to new root")
nextNode.balance += newBalance
}
@@ -352,6 +358,12 @@ func (f *ForkChoice) updateBalances(newBalances []uint64) error {
f.store.proposerBoostLock.RUnlock()
currentNode.balance = 0
} else {
log.WithFields(logrus.Fields{
"root": fmt.Sprintf("%#x", bytesutil.Trunc(vote.currentRoot[:])),
"NodeBalance": currentNode.balance,
"oldBalance": oldBalance,
"newBalance": newBalance,
}).Info("removing vote from old root")
currentNode.balance -= oldBalance
}
}

View File

@@ -8,7 +8,9 @@ import (
fieldparams "github.com/prysmaticlabs/prysm/config/fieldparams"
"github.com/prysmaticlabs/prysm/config/params"
types "github.com/prysmaticlabs/prysm/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/encoding/bytesutil"
"github.com/prysmaticlabs/prysm/time/slots"
"github.com/sirupsen/logrus"
"go.opencensus.io/trace"
)
@@ -31,6 +33,11 @@ func (s *Store) applyProposerBoostScore(newBalances []uint64) error {
log.WithError(errInvalidProposerBoostRoot).Errorf(fmt.Sprintf("invalid prev root %#x", s.previousProposerBoostRoot))
return nil
}
log.WithFields(logrus.Fields{
"root": fmt.Sprintf("%#x", bytesutil.Trunc(s.previousProposerBoostRoot[:])),
"previousBalance": previousNode.balance,
"proposerBoostScore": s.previousProposerBoostScore,
}).Info("removing proposer Boost Score")
previousNode.balance -= s.previousProposerBoostScore
}
@@ -45,6 +52,11 @@ func (s *Store) applyProposerBoostScore(newBalances []uint64) error {
if err != nil {
return err
}
log.WithFields(logrus.Fields{
"root": fmt.Sprintf("%#x", bytesutil.Trunc(s.proposerBoostRoot[:])),
"previousBalance": currentNode.balance,
"proposerBoostScore": proposerScore,
}).Info("applying proposer Boost Score")
currentNode.balance += proposerScore
}
s.previousProposerBoostRoot = s.proposerBoostRoot