Skip to content

Commit

Permalink
Merge pull request #574 from PeggyJV/collin/migration-fix
Browse files Browse the repository at this point in the history
Only unmarshal unapproved events in gravity migration
  • Loading branch information
cbrit authored Jan 28, 2025
2 parents 029b0fe + 4311069 commit de86d6e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion module/x/gravity/keeper/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,17 @@ func (m Migrator) DeletePendingEventVoteRecords(ctx sdk.Context) error {
var lowestNonce uint64
var unapprovedEventSigners []string
m.keeper.IterateEthereumEventVoteRecords(ctx, func(key []byte, eventVoteRecord *types.EthereumEventVoteRecord) bool {
// Skip approved events
if eventVoteRecord.Accepted {
return false
}

event, err := types.UnpackEvent(eventVoteRecord.Event)
if err != nil {
panic(err)
}
if !eventVoteRecord.Accepted && event.GetEventNonce() > lastObservedEventNonce {

if event.GetEventNonce() > lastObservedEventNonce {
v5Hash := OldHash(event)
ctx.Logger().Info("gravity: v5 event hash: ", v5Hash)
ctx.Logger().Info("gravity: v6 event hash: ", event.Hash())
Expand Down

0 comments on commit de86d6e

Please sign in to comment.