cardano-foundation / cardano-foundation/cf-java-rewards-calculation

[🐞 Bug]: RegisterAccountsUntil should check the stake key registration until the beginning of the current epoch.

Open
#67 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Java
Stars
22
Forks
3
PR merge metrics
No merged PRs in 30d

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Current (incorrect 🙈) Behavior

Currently, it checks the stake key registration until the stability window of the current epoch. I think it should check till the beginning of the current epoch.

We had similar code in Yaci Store, which caused a mismatch in the adapot calculation for epoch 884 on the Preview network. This issue has already been fixed in Yaci Store.

In epoch 884, 15 pools retired, and the reward accounts for 10 retired pools were registered and deregistered in epoch 884.

https://github.com/cardano-foundation/cf-java-rewards-calculation/blob/b05eddf495af6dc12d96c49718f27c34fa2042b1/validation/src/main/java/org/cardanofoundation/rewards/validation/data/fetcher/DbSyncDataFetcher.java#L118

### Expected Behavior (what you should have seen 🎉)

10 pool refunds should go to treasury.

### Steps To Reproduce

Run adapot calculation of Preview epoch 884.

### Environment

```markdown
- OS:
- Java JDK:
```

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.