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

AUTO-10716: fix a funding bug in LinkAvailableBalanceMonitor #13364

Merged
merged 8 commits into from
Jun 4, 2024

Conversation

FelixFan1992
Copy link
Contributor

No description provided.

if (success) {
localBalance -= contractToFund.topUpAmount;
emit TopUpSucceeded(targetAddress);
emit TopUpSucceeded(targetAddress, contractToFund.topUpAmount); // which address should be emitted??
Copy link
Contributor Author

@FelixFan1992 FelixFan1992 May 29, 2024

Choose a reason for hiding this comment

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

@RyanRHall @wentzeld what do u think of this address? the proxy address or the aggregator (the actual address which gets the LINK)?
and what do you think if we add the top-up amount in the event?

Copy link
Contributor

Choose a reason for hiding this comment

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

I like both those ideas :)

@wentzeld
Copy link
Contributor

Some comments

@FelixFan1992 FelixFan1992 marked this pull request as ready for review May 31, 2024 15:40
@FelixFan1992 FelixFan1992 requested a review from a team as a code owner May 31, 2024 15:40
} else {
s_targets[targetAddress].lastTopUpTimestamp = contractToFund.lastTopUpTimestamp;
s_targets[targetAddress].lastTopUpTimestamp = contractToFund.lastTopUpTimestamp; // should we update this?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@RyanRHall what do you think of this?

Copy link
Contributor

Choose a reason for hiding this comment

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

this is super confusing and unnecessarily complicated lol. From what I can tell, the lastTopUpTimestamp is always updated on line 269, and then on line 283 and 287 we set the time stamp back to what it was (meaning net no change) - is that how you interpret this code too?

I think we should take a second and think about what makes most sense from a product perspective. The min wait period is supposed to act as a rate limiter. And I think the question we're asking here is "should the rate limit apply to failed transfers?". So imagine a transfer fails for some reason, do we want the system to retry immediately or only retry after some wait period? I would think the latter, but we might want to double check with finance team.

@FelixFan1992 FelixFan1992 requested a review from RyanRHall May 31, 2024 15:42
@cl-sonarqube-production
Copy link

Copy link
Contributor

@RyanRHall RyanRHall left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Comment on lines +890 to +893
.withArgs(aggregator2.address, twoLINK)
await expect(tx)
.to.emit(labm, 'TopUpSucceeded')
.withArgs(proxy3.address)
.withArgs(aggregator3.address, twoLINK)
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@FelixFan1992 FelixFan1992 added this pull request to the merge queue Jun 4, 2024
Merged via the queue into develop with commit fc007a9 Jun 4, 2024
112 checks passed
@FelixFan1992 FelixFan1992 deleted the AUTO-10716 branch June 4, 2024 18:01
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