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

refactor: Adding logic to check more L2 chains fo guard CM #122

Merged
merged 15 commits into from
May 13, 2024

Conversation

kupermind
Copy link
Collaborator

  • Revising Guard CM L2 calls verification;
  • Adding logic to check more L2 chains;
  • L2 verifications can now be added separately without redeployment of Guard CM.

@kupermind kupermind requested review from 77ph and mariapiamo March 4, 2024 18:46
/// @dev Processes bridged data: checks the header and verifies the payload.
/// @param data Full data bytes with the header.
/// @param chainId L2 chain Id.
function _processBridgeData(
Copy link
Collaborator

Choose a reason for hiding this comment

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

_processBridgeData -> processBridgeData ?

function _processBridgeData(
bytes memory data,
uint256 chainId
) internal
Copy link
Collaborator

@77ph 77ph Mar 4, 2024

Choose a reason for hiding this comment

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

to external?
details: https://eip2535diamonds.substack.com/p/the-difference-between-solidity-libraries internal lib vs external lib with delegatecall

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Great catch :)

77ph
77ph previously approved these changes Mar 6, 2024
mariapiamo
mariapiamo previously approved these changes May 13, 2024
/// @dev Processes bridged data: checks the header and verifies the payload.
/// @param data Full data bytes with the header.
/// @param bridgeMediatorL2 Address of a bridged mediator on L2.
/// @param chainId L2 chain Id.
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe we can add a note saying that, when Wormhole is used, the ChainID EVM L2 correspond to the wormhole one

address verifierL2;
// Bridge mediator (data receiving) contract on L2
address bridgeMediatorL2;
// Chain Id: this value cannot practically be bigger than `floor(MAX_UINT64 / 2) - 36` as per EIP 2294
Copy link
Collaborator

Choose a reason for hiding this comment

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

same comment above

@kupermind kupermind merged commit 1ed9195 into main May 13, 2024
2 checks passed
@kupermind kupermind deleted the guard_more_l2_chains branch May 13, 2024 13:26
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.

3 participants