Skip to content

Ticket redemption test fails against the streamflow geth image #267

Description

@rickstaa

yarn test currently runs two cases (23 are skipped). subgraph does not fail passes. correctly updates the broadcaster deposit when ticket value is less than deposit fails, so the suite exits 1 even when the subgraph is fine.

Found while validating #263, after #265 and #266 made the docker stack bootable again.

Three problems, in order of discovery:

  1. The ticket hash is ABI-encoded with the wrong types: recipientRandHash as string (contract: bytes32) and auxData as uint256 (contract: bytes). ethers throws value out-of-bounds before anything reaches the chain. Fix: use TicketBroker.getTicketHash(ticket).
  2. signer.signMessage(hexString) signs the UTF-8 text of the hex string, not the hash bytes. And geth's personal_sign requires a password argument that ethers' remote signer does not send, so it fails with missing value for required argument 2. Fix: provider.send("personal_sign", [hash, address, ""]).
  3. With 1 and 2 fixed, redeemWinningTicket reverts on chain. Reason not yet identified. The geth-with-livepeer-protocol:streamflow image deploys a 2022 protocol commit, so this may be an image-side rule. Not worth debugging until the anvil-based test image from the testnet proposal exists.

The test also has no assertion, it only logs the query result.

Suggested short-term: land fixes 1 and 2 and it.skip the case with a pointer here, so yarn test exits 0 and can gate dependency PRs. Branch fix/ticket-hash-encoding has 1 and 2.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions