Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate the subgraph to support the latest instant-staking contract changes #1368

Closed
jaybuidl opened this issue Dec 13, 2023 · 0 comments · Fixed by #1372
Closed

Migrate the subgraph to support the latest instant-staking contract changes #1368

jaybuidl opened this issue Dec 13, 2023 · 0 comments · Fixed by #1372

Comments

@jaybuidl
Copy link
Member

jaybuidl commented Dec 13, 2023

This is a follow-up on PR #1228 which is not deployed yet but will be on Arbitrum Sepolia soon.

The SortitionModule must be added to the contracts to index in subgraph.yml (it's not currently).

The main change is that these 2 events and handles should now point to the SortitionModule instead of KlerosCore.

- event: StakeSet(indexed address,uint256,uint256)
  handler: handleStakeSet
- event: StakeDelayedNotTransferred(indexed address,uint256,uint256)
  handler: handleStakeDelayedNotTransferred

As a bonus, there's now an extra event StakeLocked in the SortitionModule to index the stake locking (with _unlock == false) and unlocking (with _unlock == true).

event StakeLocked(address indexed _address, uint256 _relativeAmount, bool _unlock);

Question: perhaps this trick is not necessary anymore with the new events?
https://github.com/unknownunknown1/kleros-v2/blob/5970449533103144b6d65c0c939c34f1992ff71c/subgraph/src/KlerosCore.ts#L195C1-L198

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

Successfully merging a pull request may close this issue.

1 participant