iron-fish / ironfish

A novel cryptocurrency focused on privacy and accessibility.
https://ironfish.network
Mozilla Public License 2.0
964 stars 579 forks source link

Fix `Worker` handling of `JobAborted` requests #5093

Closed andiflabs closed 1 week ago

andiflabs commented 1 week ago

Summary

Job.abort() sends a JobAborted request to the worker. Worker.onMessageFromParent() is able to handle such requests, but Worker.parseRequest() rejects them. Fixed Worker.parseRequest() so that such requests are no longer rejected.

Also fixed JobAbortedMessage.deserializePayload() to return the correct type.

Testing Plan

Documentation

N/A

Breaking Change

N/A

NullSoldier commented 1 week ago

This was introduced here, https://github.com/iron-fish/ironfish/pull/1155/files#diff-37121b9a047d787288b096b47cdc558dfc452d21e069ef2045b87a49e13394a8L113

It looks like it might have been a copy paste error that prevented this from getting plumbed through and handled here. https://github.com/iron-fish/ironfish/pull/1155/files#diff-37121b9a047d787288b096b47cdc558dfc452d21e069ef2045b87a49e13394a8R147 It worked fine in the JSON messages because we never validated the incoming message types.