Skip to content

Commit

Permalink
fix: unpack errors on ReferenceBlockAttestation (#1199)
Browse files Browse the repository at this point in the history
# Related Github tickets

- Closes VolumeFi#1740

# Background

ReferenceBlockAttestation messages currently do not need an assignee,
however they are still queried for messages to relay, leading to unpack
error messages in palomad logs.
By first checking for publicAccessData, ReferenceBlockAttestation
messages are filtered before we try to unpack them as TurnstoneMsg and
avoid the errors.

# Testing completed

- [x] test coverage exists or has been added/updated
- [x] tested in a private testnet

# Breaking changes

- [x] I have checked my code for breaking changes
- [x] If there are breaking changes, there is a supporting migration.
  • Loading branch information
maharifu authored Jun 21, 2024
1 parent d25836d commit abae3cd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions x/consensus/keeper/concensus_keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ func (k Keeper) GetMessagesForRelaying(ctx context.Context, queueTypeName string
return msg.GetId() <= valsetUpdatesOnChain[0].GetId()
})

// Filter down to just messages that have neither publicAccessData nor errorData
msgs = slice.Filter(msgs, func(msg types.QueuedSignedMessageI) bool {
return msg.GetPublicAccessData() == nil && msg.GetErrorData() == nil
})

// Filter down to just messages assigned to this validator
msgs = slice.Filter(msgs, func(msg types.QueuedSignedMessageI) bool {
var unpackedMsg evmtypes.TurnstoneMsg
Expand All @@ -194,11 +199,6 @@ func (k Keeper) GetMessagesForRelaying(ctx context.Context, queueTypeName string
return unpackedMsg.GetAssignee() == valAddress.String()
})

// Filter down to just messages that have neither publicAccessData nor errorData
msgs = slice.Filter(msgs, func(msg types.QueuedSignedMessageI) bool {
return msg.GetPublicAccessData() == nil && msg.GetErrorData() == nil
})

if len(msgs) > defaultResponseMessageCount {
msgs = msgs[:defaultResponseMessageCount]
}
Expand Down

0 comments on commit abae3cd

Please sign in to comment.