makerdao / auction-keeper

Maker Keeper Framework: Keeper to participate in `flip`, `flop` and `flap` auctions in multicollateral Dai.
GNU Affero General Public License v3.0
123 stars 70 forks source link

Restarting models if other auction took over `id` due to chain reorg #3

Open ghost opened 6 years ago

ghost commented 6 years ago

It can happen, if several auctions of the same type are about to be kicked roughly at the same time, that due to a chain reorg auction's id will change. Currently the model we originally spawned for this auction will just receive updated bid/lot/tab, but it will keep running.

We should discuss if it's not too confusing for a model that it gets spawned for one auction but then 'reconfigured' for another one. Alternative would be to kill the original model if we detect the auction is not the same auction anymore (by different bid/lot/tab I guess, depending on auction type) and spawn a new model which will get provided the right bid/lot/tab values since beginning.

rainbreak commented 6 years ago

Maybe there is a better id scheme than incrementing? For example, a hash of the caller and a nonce.

EdNoepel commented 5 years ago

Is this still a valid use case? If so, I'd like to document it in the README. Also, if so, is there a way to simulate a chain reorg on a local testchain?

Since the user runs a different flip keeper for each ilk, I suppose this would only impact bidding strategies where the price is influenced by the lot size.