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

Update indexed fields in Portal events #6

Merged
merged 1 commit into from
Oct 23, 2024
Merged

Conversation

0xIryna
Copy link
Collaborator

@0xIryna 0xIryna commented Oct 23, 2024

Proposed changes

  • index sender, recipient and destinationChainId in MTokenSent event.
  • index sender, recipient and sourceChainId in MTokenReceive event
  • index listName, account and destinationChainId in RegistrarListStatusSent event
  • remove TODO comments that no longer apply

Motivation

While it's unclear how Portal events will be used off-chain, it's more likely to search and filter events by sender, recipient and chainId, rather than messageId, which is unique per message.

Copy link

LCOV of commit a7da286 during Forge Coverage #47

Summary coverage rate:
  lines......: 99.2% (128 of 129 lines)
  functions..: 94.9% (37 of 39 functions)
  branches...: 85.7% (18 of 21 branches)

Files changed coverage rate:
                             |Lines       |Functions  |Branches    
  Filename                   |Rate     Num|Rate    Num|Rate     Num
  =================================================================
  src/Portal.sol             | 100%     24|80.0%    10|80.0%      5

Copy link

Changes to gas cost

Generated at commit: 408678bb92f15333f8eba2ba5a918cdf6e93a100, compared to commit: 151a6649688b7342065f1156fe36fd380fb1d03d

🧾 Summary (20% most significant diffs)

Contract Method Avg (+/-) %
SpokePortal attestationReceived +290 ❌ +0.24%
HubPortal sendRegistrarListStatus +116 ❌ +0.17%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
SpokePortal 5,170,910 (-695) attestationReceived
transfer
55,382 (0)
136,929 (+104)
0.00%
+0.08%
120,818 (+290)
136,929 (+104)
+0.24%
+0.08%
117,041 (+121)
136,929 (+104)
+0.10%
+0.08%
142,899 (+125)
136,929 (+104)
+0.09%
+0.08%
520 (0)
1 (0)
HubPortal 5,625,918 (+240) attestationReceived
sendMTokenIndex
sendRegistrarListStatus
transfer
96,364 (+121)
72,090 (-110)
70,267 (+116)
136,874 (+104)
+0.13%
-0.15%
+0.17%
+0.08%
110,508 (+106)
72,090 (-110)
70,267 (+116)
136,874 (+104)
+0.10%
-0.15%
+0.17%
+0.08%
97,014 (+122)
72,090 (-110)
70,267 (+116)
136,874 (+104)
+0.13%
-0.15%
+0.17%
+0.08%
125,685 (+125)
72,090 (-110)
70,267 (+116)
136,874 (+104)
+0.10%
-0.15%
+0.17%
+0.08%
515 (0)
1 (0)
1 (0)
1 (0)

@0xIryna 0xIryna merged commit 54d83e5 into main Oct 23, 2024
2 checks passed
@0xIryna 0xIryna deleted the refactor/events-indexing branch October 23, 2024 19:49
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