Skip to content

Commit

Permalink
fix: checksum address / value when pruning snapshot (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
authcall committed Oct 21, 2022
1 parent d579fab commit 64fd178
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/services/pkg/snapshot/snapshot.go
Expand Up @@ -462,12 +462,11 @@ func PruneSnapshotOwnedByComponent(snapshot *pb.ECSStateSnapshot, pruneForAddres
// Extract the address that is the 'value' of OwnedBy.
ownedByValue := hexutil.Encode(stateEntry.Value[12:])
// Discard this state entry if the value is not for the specified address.
if ownedByValue != pruneForAddress {
if utils.ChecksumAddressString(ownedByValue) != utils.ChecksumAddressString(pruneForAddress) {
continue
}
} else {
prunedState = append(prunedState, stateEntry)
}
prunedState = append(prunedState, stateEntry)
}

percentSizeAfterPrune := float64(len(prunedState)) / float64(len(snapshot.State))
Expand Down

0 comments on commit 64fd178

Please sign in to comment.