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

chore: add additional logs #27

Merged
merged 6 commits into from
Apr 11, 2024
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
2 changes: 1 addition & 1 deletion chains/evm/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (c *EVMChain) ReceiveMessage(m *message.Message) (*proposal.Proposal, error
func (c *EVMChain) Write(props []*proposal.Proposal) error {
err := c.executor.Execute(props)
if err != nil {
c.logger.Err(err).Msgf("error writing proposals %+v on network %d", props, c.DomainID())
c.logger.Err(err).Str("messageID", props[0].MessageID).Msgf("error writing proposals %+v on network %d", props, c.DomainID())
return err
}

Expand Down
2 changes: 1 addition & 1 deletion chains/substrate/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (c *SubstrateChain) ReceiveMessage(m *message.Message) (*proposal.Proposal,
func (c *SubstrateChain) Write(props []*proposal.Proposal) error {
err := c.executor.Execute(props)
if err != nil {
c.logger.Err(err).Msgf("error writing proposals %+v on network %d", props, c.DomainID())
c.logger.Err(err).Str("messageID", props[0].MessageID).Msgf("error writing proposals %+v on network %d", props, c.DomainID())
return err
}

Expand Down
6 changes: 6 additions & 0 deletions relayer/relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,16 @@ func (r *Relayer) route(msgs []*message.Message) {
log := log.With().Uint8("domainID", destChain.DomainID()).Str("messageID", msgs[0].ID).Logger()
props := make([]*proposal.Proposal, 0)
for _, m := range msgs {
log.Debug().Msgf("Sending message")

prop, err := destChain.ReceiveMessage(m)
if err != nil {
log.Err(err).Msgf("Failed receiving message %+v", m)
continue
}

log.Debug().Msgf("Received message")

if prop != nil {
props = append(props, prop)
}
Expand All @@ -77,6 +82,7 @@ func (r *Relayer) route(msgs []*message.Message) {
return
}

log.Debug().Msgf("Writing message")
err := destChain.Write(props)
if err != nil {
log.Err(err).Msgf("Failed writing message")
Expand Down
Loading