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

Fix/staking #6

Merged
merged 18 commits into from
Sep 12, 2024
Merged

Fix/staking #6

merged 18 commits into from
Sep 12, 2024

Conversation

Divya-Solulab
Copy link
Collaborator

fix logic to consider the service active and eligible for rewards, even if it joins in between a liveness period

return synced_data, Event.NEXT_CHECKPOINT_NOT_REACHED_YET
if (
synced_data.most_voted_tx_hash is None
and synced_data.is_staking_kpi_met == False
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
and synced_data.is_staking_kpi_met == False
and synced_data.is_staking_kpi_met is False

Comment on lines -45 to +46
kpi_met_for_the_day: Optional[bool]
is_staking_kpi_met: Optional[bool]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that there are so many common attributes you can convert CallCheckpointPayload to:

@dataclass(frozen=True)
class CallCheckpointPayload(BaseTxPayload):
    """A transaction payload for the CallCheckpointRound."""

    service_staking_state: int
    min_num_of_safe_tx_required: Optional[int]

Comment on lines +225 to +229
if (
synced_data.most_voted_tx_hash is None
and synced_data.is_staking_kpi_met == True
):
return synced_data, Event.STAKING_KPI_MET
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (
synced_data.most_voted_tx_hash is None
and synced_data.is_staking_kpi_met == True
):
return synced_data, Event.STAKING_KPI_MET
if (
synced_data.most_voted_tx_hash is None
and synced_data.is_staking_kpi_met is True
):
return synced_data, Event.STAKING_KPI_MET

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In CallCheckpointRound, what if both is_staking_kpi_met and most_voted_tx_hash are None? Shouldn't we re-enter CallCheckpointRound instead?

@0xArdi 0xArdi mentioned this pull request Sep 12, 2024
@0xArdi 0xArdi merged commit f34402d into main Sep 12, 2024
6 of 8 checks passed
@0xArdi 0xArdi deleted the fix/staking branch September 12, 2024 09:51
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.

4 participants