-
Notifications
You must be signed in to change notification settings - Fork 0
make mintTransaction
called via CrossDomainMessenger
#80
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
base: op-es
Are you sure you want to change the base?
Conversation
Needs fix, will create a new pr later. |
reopen , I was hesitant for the Other candidate values may be |
/// @param _message Message to trigger the target address with. | ||
/// @param _minGasLimit Minimum gas limit that the message can be executed with. | ||
/// @param _value Value to send with the message. | ||
function wrapForRelayMessage( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another approach is to introduce a new method, sendQKCTransferMessage
, in L1CrossDomainMessenger.sol
, which would call portal.depositTransactionChecked
which can only be called by l1CrossDomainMessenger. And then we can just delete mintTransaction
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, now the call direction is L1CrossDomainMessenger->OptimismPortal2
, not the reverse. But I kept the naming mintTransaction
.
mintTransaction
call via CrossDomainMessenger
mintTransaction
called via CrossDomainMessenger
QKCConfigStorage storage $ = _getQKCConfigStorage(); | ||
if (msg.sender != $.minter) { | ||
/// @dev This function is only callable by L1CrossDomainMessenger. | ||
function mintTransaction( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears that mintTransaction
and depositTransaction
share most of the same code. We could implement a shared _depositTransaction
internal function containing the common logic, while allowing mintTransaction
and depositTransaction
to each handle their specific access control requirements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to keep depositTransaction
untouched, otherwise it'll be a pain to merge in future.
/// @param _minGasLimit Minimum gas limit that the message can be executed with. | ||
function sendMintMessage( | ||
address _target, | ||
bytes calldata _message, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the method is intended solely for minting QKC, we should omit this parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It tries to be flexible, e.g., it's possible to mint and swap in a single L2 transaction if we want it in future.
address _target, | ||
bytes calldata _message, | ||
uint256 _mintValue, | ||
uint32 _minGasLimit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're using RECEIVE_DEFAULT_GAS_LIMIT, is there still a need to include the _minGasLimit parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like the existing sendMessage
, it's designed to be flexible, so that user can choose a proper _minGasLimit
for the call.
I’m wondering if you’ve already tested whether the failed transaction can be replayed on the devnet? |
@iteyelmp will try to test it on the devnet to see if it works. |
Another option is to change L1StandardBridge and move all mint logic to that so that CrossDomainMessager and Portal can be unchanged? |
|
Summary: A devnet has been deployed based on this contract. These funds can currently be retrieved successfully by manually calling |
@qizhou noted that the previous CGT design also lacked tx-replay support. To minimize contract changes and keep upstream merges straightforward, we’ll defer merging this PR into the branch for now. Instead, @iteyelmp, we can surface a notice in the migration UI:
|
This PR makes the deposit tx corresponding to
mintTransaction
triggered viaL2CrossDomainMessenger.relayMessage
so that if the execution failed on L2, it can be retried later.