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

feat(protocol): add a view function isSignalReceived for Bridge relayer/UI #16591

Merged
merged 2 commits into from
Apr 2, 2024

Conversation

dantaik
Copy link
Contributor

@dantaik dantaik commented Apr 2, 2024

isSignalReceived has the same implementation as proveSignalReceived except it doesn't transact to cache data.

@dantaik dantaik marked this pull request as ready for review April 2, 2024 01:57
Copy link

openzeppelin-code bot commented Apr 2, 2024

feat(protocol): add a view function isSignalReceived for Bridge relayer/UI

Generated at commit: 5a31d9e25dbb0c3a8a7c6c06e92fdfda8e894b17

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
2
0
3
39
46
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

Copy link
Contributor

@Brechtpd Brechtpd left a comment

Choose a reason for hiding this comment

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

function isSignalReceived(
        uint64 _chainId,
        address _app,
        bytes32 _signal,
        bytes calldata _proof) 
  external 
  view
{
  bytes memory call_data = abi.encodePacked(SignalService.proveSignalReceived.selector, msg.data[4:]);
  (bool success, ) = address(this).staticcall(call_data);
  require(success);
}

Something like this should also work (though I have only tested with dummy functions) so the code doesn't have to be duplicated, though it would require the caller to disable any caching manually instead of the current way where it is simply ignored no matter the value.

@dantaik dantaik added this pull request to the merge queue Apr 2, 2024
Merged via the queue into main with commit 39d4be6 Apr 2, 2024
10 checks passed
@dantaik dantaik deleted the isSignalReceived branch April 2, 2024 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants