node/p2p: separate governor config and status message prefix (#1956)

Co-authored-by: tbjump <unknown>
This commit is contained in:
tbjump 2022-11-28 10:58:26 -06:00 committed by GitHub
parent 17e732c741
commit e2f3f69e2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -461,7 +461,8 @@ func (gov *ChainGovernor) CollectMetrics(hb *gossipv1.Heartbeat, sendC chan []by
}
}
var governorMessagePrefix = []byte("governor|")
var governorMessagePrefixConfig = []byte("governor_config_000000000000000000|")
var governorMessagePrefixStatus = []byte("governor_status_000000000000000000|")
func (gov *ChainGovernor) publishConfig(hb *gossipv1.Heartbeat, sendC chan []byte, gk *ecdsa.PrivateKey, ourAddr ethCommon.Address) {
chains := make([]*gossipv1.ChainGovernorConfig_Chain, 0)
@ -498,7 +499,7 @@ func (gov *ChainGovernor) publishConfig(hb *gossipv1.Heartbeat, sendC chan []byt
return
}
digest := ethCrypto.Keccak256Hash(append(governorMessagePrefix, b...))
digest := ethCrypto.Keccak256Hash(append(governorMessagePrefixConfig, b...))
sig, err := ethCrypto.Sign(digest.Bytes(), gk)
if err != nil {
@ -577,7 +578,7 @@ func (gov *ChainGovernor) publishStatus(hb *gossipv1.Heartbeat, sendC chan []byt
return
}
digest := ethCrypto.Keccak256Hash(append(governorMessagePrefix, b...))
digest := ethCrypto.Keccak256Hash(append(governorMessagePrefixStatus, b...))
sig, err := ethCrypto.Sign(digest.Bytes(), gk)
if err != nil {