synapsecns / sanguine

Synapse Monorepo
MIT License
43 stars 31 forks source link

prove w/ tx id [SLT-181] #3169

Closed parodime closed 2 months ago

parodime commented 2 months ago

Description

Current implementation of prove doesn’t do anything with the provided bytes request, except for hashing it to derive transactionId. New functions should take transactionId directly, skipping this step on-chain:

Summary by CodeRabbit

coderabbitai[bot] commented 2 months ago

[!WARNING]

Rate limit exceeded

@parodime has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 47 seconds before requesting another review.

:hourglass: How to resolve this issue? After the wait time has elapsed, a review can be triggered using the `@coderabbitai review` command as a PR comment. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit.
:vertical_traffic_light: How do rate limits work? CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our [FAQ](https://coderabbit.ai/docs/faq) for further information.
:inbox_tray: Commits Files that changed from the base of the PR and between 594a48cf8df1cfd60d353071bd6b9f5a8fffc9bb and bcdb2585955f973de5d59da8d39a7b8ca0643fe6.

Walkthrough

The changes in this pull request involve modifications to the prove function within the FastBridgeV2 contract, specifically altering its parameter handling and processing logic. The external prove function now accepts a bytes32 transactionId instead of a bytes memory request, enhancing clarity in its responsibilities. Additionally, the test suite for FastBridgeV2 has been expanded to include various scenarios related to the new prove functionality, ensuring comprehensive coverage and validation of the contract's behavior.

Changes

File Change Summary
packages/contracts-rfq/contracts/FastBridgeV2.sol Updated prove function signatures to replace bytes memory request with bytes32 transactionId.
packages/contracts-rfq/test/FastBridgeV2.Src.t.sol Added new tests for the prove function, including overloads and various scenarios for transaction proving.

Possibly related PRs

Suggested labels

go, size/xs, needs-go-generate-services/rfq

Suggested reviewers

Poem

In the meadow where bunnies play,
A change in code brightens the day.
With transactionId now in sight,
The contract's logic feels just right.
Hops of joy, we dance and cheer,
For clearer paths, we hold so dear! 🐰✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

:heart: Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
:placard: Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit , please review it.` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (Invoked using PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. ### Other keywords and placeholders - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. - Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description. - Add `@coderabbitai` anywhere in the PR title to generate the title automatically. ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 38.45493%. Comparing base (2e808e6) to head (bcdb258). Report is 3 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3169 +/- ## =================================================== - Coverage 41.10994% 38.45493% -2.65502% =================================================== Files 459 424 -35 Lines 25641 24452 -1189 Branches 342 146 -196 =================================================== - Hits 10541 9403 -1138 + Misses 14357 14311 -46 + Partials 743 738 -5 ``` | [Flag](https://app.codecov.io/gh/synapsecns/sanguine/pull/3169/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=synapsecns) | Coverage Δ | | |---|---|---| | [packages](https://app.codecov.io/gh/synapsecns/sanguine/pull/3169/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=synapsecns) | `90.96267% <ø> (ø)` | | | [solidity](https://app.codecov.io/gh/synapsecns/sanguine/pull/3169/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=synapsecns) | `93.51852% <100.00000%> (-3.40126%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=synapsecns#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

cloudflare-workers-and-pages[bot] commented 2 months ago

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: bcdb258
Status: ✅  Deploy successful!
Preview URL: https://636fc7d8.sanguine-fe.pages.dev
Branch Preview URL: https://feat-fbv2-provewithtxid.sanguine-fe.pages.dev

View logs

github-actions[bot] commented 2 months ago

Changes to gas cost

Generated at commit: 7a239b53c0a70aa76fd944c2036a09e8c2e528ac, compared to commit: 2e808e6414be03d63c1d6785ef4ce9b1c64a4775

🧾 Summary (20% most significant diffs)

Contract Method Avg (+/-) %
FastBridgeV2 bridgeProofs -87 ✅ -12.61%

Full diff report 👇
| Contract | Deployment Cost (+/-) | Method | Min (+/-) | % | Avg (+/-) | % | Median (+/-) | % | Max (+/-) | % | # Calls (+/-) | |:-|-:|:-|-:|-:|-:|-:|-:|-:|-:|-:|-:| | **FastBridgeV2** | 2,265,452 (-5,384) | _DEFAULT_ADMIN_ROLE_
_GOVERNOR_ROLE_
_REFUNDER_ROLE_
_RELAYER_ROLE_
_bridge_
_bridgeProofs_
_bridgeRelays_
_canClaim_
_claim(bytes)_
_claim(bytes,address)_
_dispute_
_grantRole_
_hasRole_
_nonce_
_protocolFeeRate_
_protocolFees_
_refund_
_relay(bytes)_
_relay(bytes,address)_
_revokeRole_
_setChainGasAmount_
_setProtocolFeeRate_ | 329 (+22)
294 (+22)
307 (+22)
285 (+22)
63,738 (+22)
603 (-87)
506 (+22)
1,064 (+22)
46,482 (+22)
43,806 (-88)
31,654 (+22)
26,784 (+22)
718 (+22)
2,340 (-88)
385 (+22)
623 (0)
43,116 (+22)
28,271 (+22)
90,035 (+22)
26,760 (+22)
24,073 (+22)
24,003 (+22) | **+7.17%**
**+8.09%**
**+7.72%**
**+8.37%**
**+0.03%**
**-12.61%**
**+4.55%**
**+2.11%**
**+0.05%**
**-0.20%**
**+0.07%**
**+0.08%**
**+3.16%**
**-3.62%**
**+6.06%**
**0.00%**
**+0.05%**
**+0.08%**
**+0.02%**
**+0.08%**
**+0.09%**
**+0.09%** | 329 (+22)
294 (+22)
307 (+22)
285 (+22)
89,651 (+32)
603 (-87)
1,306 (+22)
1,064 (+22)
61,310 (+22)
61,457 (-88)
31,659 (+20)
107,464 (+890)
926 (+22)
2,340 (-88)
490 (+22)
1,822 (-16)
49,776 (+22)
80,131 (+22)
91,980 (+22)
33,386 (+20)
44,327 (+22)
46,554 (+142) | **+7.17%**
**+8.09%**
**+7.72%**
**+8.37%**
**+0.04%**
**-12.61%**
**+1.71%**
**+2.11%**
**+0.04%**
**-0.14%**
**+0.06%**
**+0.84%**
**+2.43%**
**-3.62%**
**+4.70%**
**-0.87%**
**+0.04%**
**+0.03%**
**+0.02%**
**+0.06%**
**+0.05%**
**+0.31%** | 329 (+22)
294 (+22)
307 (+22)
285 (+22)
102,240 (+22)
603 (-87)
506 (+22)
1,064 (+22)
61,319 (+22)
70,996 (-88)
31,654 (+10)
118,471 (+238)
718 (+22)
2,340 (-88)
385 (+22)
2,623 (0)
48,116 (+22)
86,655 (+22)
91,980 (+22)
33,384 (+20)
47,454 (+22)
47,399 (+22) | **+7.17%**
**+8.09%**
**+7.72%**
**+8.37%**
**+0.02%**
**-12.61%**
**+4.55%**
**+2.11%**
**+0.04%**
**-0.12%**
**+0.03%**
**+0.20%**
**+3.16%**
**-3.62%**
**+6.06%**
**0.00%**
**+0.05%**
**+0.03%**
**+0.02%**
**+0.06%**
**+0.05%**
**+0.05%** | 329 (+22)
294 (+22)
307 (+22)
285 (+22)
122,400 (+22)
603 (-87)
2,506 (+22)
1,064 (+22)
76,121 (+22)
77,124 (-88)
31,666 (+22)
118,483 (+22)
2,718 (+22)
2,340 (-88)
2,385 (+22)
2,623 (0)
53,451 (+22)
108,254 (+22)
93,926 (+22)
40,006 (+18)
47,454 (+22)
47,399 (+22) | **+7.17%**
**+8.09%**
**+7.72%**
**+8.37%**
**+0.02%**
**-12.61%**
**+0.89%**
**+2.11%**
**+0.03%**
**-0.11%**
**+0.07%**
**+0.02%**
**+0.82%**
**-3.62%**
**+0.93%**
**0.00%**
**+0.04%**
**+0.02%**
**+0.02%**
**+0.05%**
**+0.05%**
**+0.05%** | 1 (0)
141 (+6)
164 (+12)
234 (+24)
4,715 (+16)
23 (+12)
15 (0)
4 (0)
1,024 (0)
1,043 (0)
14 (+4)
503 (+54)
211 (0)
25 (0)
19 (0)
3,762 (+108)
1,042 (0)
9 (0)
2 (0)
8 (0)
13 (0)
48 (+6) | | **MockERC20.0.8.24** | 569,650 (0) | _mint_ | 51,333 (0) | **0.00%** | 57,586 (-111) | **-0.19%** | 51,345 (0) | **0.00%** | 68,445 (0) | **0.00%** | 221 (+36) |