Skip to content

Conversation

@nicholaspai
Copy link
Member

In the past, emitting a complex object in an event causes Etherscan difficulty in decoding the params. We should emit all neccessary params individually.


struct RelayData {
address sender;
address depositor;
Copy link
Member Author

Choose a reason for hiding this comment

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

Unrelated: naming this to depositor is more clear and better delineates between "sender" and "relayer"

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Member

@chrismaree chrismaree left a comment

Choose a reason for hiding this comment

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

does this change the gas cost of the emitting?

Copy link
Contributor

@mrice32 mrice32 left a comment

Choose a reason for hiding this comment

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

Looks good!

uint256 totalRelayAmount,
uint256 newFilledAmount,
uint256 indexed repaymentChain,
uint256 amountSentToRecipient,
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of reporting how much they sent to the recipient, do you think we should report how much was added to the filled amount? We have the newFilledAmount, but not the diff. Seems like it might be easier (from a bot perspective) to compute how much the relayer is owed from that amount rather than the amountSent. Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm I think you might be right. @chrismaree do you have instincts on this? The relayer would be able to compute (1 + relayerFeePct) * fillIncreaseAmount. Question though is whether they even would care about this new fill amount. Also, should we simply append the fill delta or replace the amountSentToRecipient?

Copy link
Contributor

Choose a reason for hiding this comment

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

The relayer would be able to compute (1 + relayerFeePct) * fillIncreaseAmount.

I may be wrong, but I think the formula for the repayment amount would be (1 - lpFeePct) * fillIncreaseAmount. Does that seem right to you?

Copy link
Member Author

Choose a reason for hiding this comment

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

thats correct

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess you could compute amountSentToRecipient by calculating (1 - relayerFeePct - lpFeePct) * fillIncreaseAmount

Copy link
Member Author

Choose a reason for hiding this comment

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

I replaced amountToSend with filllAmountPreFees and renamed the param to fillAmount

@nicholaspai
Copy link
Member Author

does this change the gas cost of the emitting?

Empirically it doesn't look like it changes anything @chrismaree

Copy link
Contributor

@mrice32 mrice32 left a comment

Choose a reason for hiding this comment

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

LGTM once we resolve this thread: #18 (comment).

@nicholaspai nicholaspai requested a review from mrice32 February 3, 2022 17:39
Copy link
Contributor

@mrice32 mrice32 left a comment

Choose a reason for hiding this comment

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

LGTM!

@nicholaspai nicholaspai merged commit a801d87 into master Feb 3, 2022
@nicholaspai nicholaspai deleted the npai/spoke-pool-events branch February 3, 2022 18:16
pxrl pushed a commit that referenced this pull request Feb 13, 2024
pxrl pushed a commit that referenced this pull request Feb 20, 2024
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