Closed kerzhner closed 3 years ago
A challenger agent monitors rollup roots posted on chain. If the challenger agent detects an invalid root, the challenger agent initiates a challenge (currently implemented as the constructor).
This might be out of scope of a ChallengerAgent. A ChallengerAgent might be used only during a challenge, not to determine when to launch a challenge.
This might be out of scope of a ChallengerAgent. A ChallengerAgent might be used only during a challenge, not to determine when to launch a challenge.
I agree with that. Seems like there should be another component that monitors for when to launch a challenge.
Follows up on https://github.com/statechannels/dispute-game/pull/43. Fixes https://github.com/statechannels/dispute-game/issues/34.
This refactor includes:
ChallengerAgent
represents a player in the dispute game. The challenger agent is initialized with a role and a set of states for that role. The challenger agent API issplit
andproveFraudOrForfeit
. For now, the challenger agent is APIs are invoked manually by a player. The end goal is for the challenger agent to monitor an event stream. For example,constructor
).split
orproveFraudOrForfeit
in response to other player's actions.DisputeGame
is used for testing. In a production dispute, there is noDisputeGame
ChallengeManager
now keeps track of theloser
property and allows a player to forfeit.