Skip to content

Conversation

@juanmardefago
Copy link
Collaborator

No description provided.

provision.thawingUntil = event.params.thawingUntil
provision.save()

indexer.thawingUntil = event.params.thawingUntil
Copy link
Member

Choose a reason for hiding this comment

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

This is not necessarily true, that the latest thaw request has the latest thawingUntil, because we could change the thawingPeriod but I think we should not worry about it. Maybe just note it with a comment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, I didn't think about it, but that's correct, maybe simply doing a max out of the current value and the next?

Copy link
Contributor

@andrascodes andrascodes left a comment

Choose a reason for hiding this comment

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

Thanks! 🙏

@juanmardefago
Copy link
Collaborator Author

@tmigone changed the logic so that it's always the max value

@juanmardefago juanmardefago requested a review from tmigone May 21, 2025 14:13
provision.thawingUntil = event.params.thawingUntil > provision.thawingUntil ? event.params.thawingUntil : provision.thawingUntil
provision.save()

indexer.thawingUntil = event.params.thawingUntil > indexer.thawingUntil ? event.params.thawingUntil : indexer.thawingUntil
Copy link
Contributor

Choose a reason for hiding this comment

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

Sry I was just reviewing this more closely for the Engineering Plan: don't we have to set indexer.thawingUntil back to 0 in handleThawRequestFulfilled or handleTokensDeprovisioned?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, I think so. At least on fulfilled it makes sense.
Worst case scenario, the value is easy to identify as invalid though, since if thawingUntil is essentially in the past, it's essentially done thawing

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah actually you're right! shouldn't be a big deal! It's overwritten by a later timestamp anyway and if it's in the past it's withdrawable as you say. nvm then! thx!!!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm gonna merge it, but worst case scenario we can modify it later down the road if necessary

@juanmardefago juanmardefago merged commit ba8bb75 into juanmardefago/horizon-stage-1-signed May 21, 2025
2 checks passed
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