optimism icon indicating copy to clipboard operation
optimism copied to clipboard

op-challenger: Implement expanded honest challenger behaviour

Open ajsutton opened this issue 2 years ago • 1 comments

Description

Implements the expanded honest actor behaviour to counter freeloaders as per https://github.com/ethereum-optimism/specs/pull/21/ The code has deliberately been adjusted to be much closer to the python in the spec implementation.

This identifies two problems with the spec:

  1. The honest challenger is incorrectly countering correct attacks (correct hash and in correct position)
  2. The honest challenger counters its own claims against freeloaders because in the sub-game created to invalidate the freeloader claim, the honest challenger is on the opposite team to when considering the root claim. ie if they were defending, they're now challenging.

TODO: This same logic needs to be applied for checking if we should step and add unit and e2e test for that case. Specifically we should not try to step against our own claims that are countering a freeloader and should step against a freeloader at max depth.

Tests

Added game solver unit tests to cover the key cases and demonstrate the self-countering issue. Updated the e2e test to operate in the top half of the game - previously the freeloader claims were at the game max depth and had to be counted by calling step rather than performing moves.

Metadata

  • https://github.com/ethereum-optimism/client-pod/issues/103

ajsutton avatar Feb 22 '24 03:02 ajsutton

Note: I haven't updated the tests for stepping (and possibly broke step calls - not entirely sure).

ajsutton avatar Feb 22 '24 06:02 ajsutton

Replaced by https://github.com/ethereum-optimism/optimism/pull/9640

ajsutton avatar Feb 25 '24 23:02 ajsutton