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 inconsistency between the current epoch in the tip and delegation status within the wallet API response #4205

Merged
merged 5 commits into from
Nov 6, 2023

Conversation

Unisay
Copy link
Contributor

@Unisay Unisay commented Nov 6, 2023

  • refactor: improve code readability around the wallet delegation info;
  • fix: don't rely on the epoch information obtained via a relative time (current UTC time - blockchain start time) as it could be inconsistent with the wallet state, always calculate current epoch from the latest node tip (which is consistent with the wallet state)

Issue Number

ADP-3216

@Unisay Unisay force-pushed the yura/ADP-3216/inconsistent-tip branch from 1880956 to e9a356e Compare November 6, 2023 10:49
@Unisay Unisay self-assigned this Nov 6, 2023
Copy link
Contributor

@HeinrichApfelmus HeinrichApfelmus left a comment

Choose a reason for hiding this comment

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

Excellent, thank you! 😊 Happy to see it merged.

ti = Slotting.expectAndThrowFailures $ timeInterpreter nl

getCurrentEpoch =
currentEpochFromWallClock >>= \case
Copy link
Contributor

Choose a reason for hiding this comment

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

Removing this is definitely more consistent. 👍

However, it may have an impact on Daedalus users: If the node has not fully synched yet, they will see an outdated delegation status. 🤔 But I think that this is ok — the network information endpoints tell user what tip the wallet sees, and it cannot reasonably look into the future. We may still want to record this as a "user-facing change", though.

@Unisay Unisay added this pull request to the merge queue Nov 6, 2023
Merged via the queue into master with commit cee2275 Nov 6, 2023
3 checks passed
@Unisay Unisay deleted the yura/ADP-3216/inconsistent-tip branch November 6, 2023 15:55
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