diff --git a/pkg/innerring/processors/governance/process_update.go b/pkg/innerring/processors/governance/process_update.go index 7d54a642cf..a3de8ecb44 100644 --- a/pkg/innerring/processors/governance/process_update.go +++ b/pkg/innerring/processors/governance/process_update.go @@ -2,8 +2,11 @@ package governance import ( "encoding/binary" + "encoding/hex" "sort" + "strings" + "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "go.uber.org/zap" ) @@ -43,7 +46,10 @@ func (gp *Processor) processAlphabetSync() { return } - gp.log.Info("alphabet list has been changed, starting update") + gp.log.Info("alphabet list has been changed, starting update", + zap.String("side_chain_alphabet", prettyKeys(sidechainAlphabet)), + zap.String("new_alphabet", prettyKeys(newAlphabet)), + ) // 1. Vote to side chain committee via alphabet contracts. err = gp.voter.VoteForSidechainValidator(newAlphabet) @@ -65,6 +71,11 @@ func (gp *Processor) processAlphabetSync() { } else { sort.Sort(newInnerRing) + gp.log.Info("update of the inner ring list", + zap.String("before", prettyKeys(innerRing)), + zap.String("after", prettyKeys(newInnerRing)), + ) + if gp.notaryDisabled { err = gp.netmapClient.UpdateInnerRing(newInnerRing) } else { @@ -103,3 +114,15 @@ func (gp *Processor) processAlphabetSync() { gp.log.Info("finished alphabet list update") } + +func prettyKeys(keys keys.PublicKeys) string { + const delimiter = "," + + sb := strings.Builder{} + for _, key := range keys { + sb.WriteString(hex.EncodeToString(key.Bytes())) + sb.WriteString(delimiter) + } + + return strings.TrimRight(sb.String(), delimiter) +} diff --git a/pkg/innerring/state.go b/pkg/innerring/state.go index b0e014a363..e0750f0326 100644 --- a/pkg/innerring/state.go +++ b/pkg/innerring/state.go @@ -99,7 +99,8 @@ func (s *Server) voteForSidechainValidator(validators keys.PublicKeys) error { if err != nil { s.log.Warn("can't invoke vote method in alphabet contract", zap.Int8("alphabet_index", int8(letter)), - zap.Uint64("epoch", epoch)) + zap.Uint64("epoch", epoch), + zap.String("error", err.Error())) } })