ava-labs / avalanchego

Go implementation of an Avalanche node.
https://avax.network
BSD 3-Clause "New" or "Revised" License
2.09k stars 646 forks source link

Remove `Cancel` from the `Job` interface #3127

Closed StephenButtolph closed 1 week ago

StephenButtolph commented 1 week ago

Why this should be merged

The prior implementation seemed to be a bit unintuitive with how cancellation was implemented and used by the voter job. This PR is attempting to make the behavior as explicit as possible.

How this works

Rather than having Execute and Cancel function that are called, there is a single Execute which takes in the results of resolving the dependencies.

How this was tested