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

Reward calculation fix for preprod and preview network #394

Merged
merged 13 commits into from
Nov 11, 2024

Conversation

satran004
Copy link
Member

@satran004 satran004 commented Nov 8, 2024

  • Preprod network issue was due to multiple retired pools in an epoch sharing the same reward account. The reward account was receiving payment with only one refund.
  • Since the Preview network starts directly from the Alonzo era, adjusted the logic accordingly for reward calculation.
  • Fix fee calculation issue in preview for one of the invalid tx where total collateral = null and collateralReturn is set.

Enhanced the logic to correctly identify new epochs when the previous epoch is null, particularly when dealing with the initial block in non-Byron eras. This includes handling scenarios where the previous cursor is a genesis entry, ensuring accurate epoch transitions.
The `findNetworkType` method is now executed automatically after bean initialization. This ensures the network type is set before any other initialization logic in the `init` method.
Updated `cf-rewards` to version 0.14.0 and added `vavr` version 0.10.5 to `libs.versions.toml`.
Refactored `getNetworkConfig` to support custom network configurations based on protocol magic and epoch. Integrated `EraService`, `GenesisConfig`, and `UtxoSnapshotService` to dynamically determine epoch-related parameters and initial reserves.
… network

Previously, if the previous era was null, the protocol parameters were not initialized correctly. Now, the code merges Shelley and Alonzo parameters when Alonzo era starts at epoch 0
Implemented a method in PoolStorage and PoolStorageImpl to retrieve retired pools for a given epoch. Updated PoolStatusRepository with a new query to support this functionality. Additionally, modified PoolStateService to handle testnet address conversion logic for non-mainnet networks.
Copy link

sonarcloud bot commented Nov 9, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@satran004 satran004 merged commit 0888374 into main Nov 11, 2024
2 of 3 checks passed
@satran004 satran004 deleted the fix/reward_preprod_network branch November 11, 2024 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants