Skip to content

Implement requestRelay in Axelar gateway #200

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

Amxx
Copy link
Collaborator

@Amxx Amxx commented Jul 25, 2025

No description provided.

@Amxx Amxx requested a review from frangio July 25, 2025 20:15
@Amxx Amxx marked this pull request as ready for review July 25, 2025 20:15
@Amxx Amxx requested review from cjcobb23 and a team as code owners July 25, 2025 20:15
) internal pure returns (bool success, uint256 value, uint256 gasLimit, address refundRecipient) {
success = bytes4(attribute) == IERC7786Attributes.requestRelay.selector && attribute.length >= 0x64;

assembly ("memory-safe") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this technically unsafe as we're potentially reading out of bounds? Although we are multiplying by 0 in that case... so I think this is probably ok.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, multiply by zero is here for security. Any "unsafe" access should be nullified. If the content being read is irrelevant, I don't see how that could be a problem.

Copy link
Contributor

Choose a reason for hiding this comment

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

It would definitely be a problem with traditional undefined behavior, but I don't think that's what happens with unsafe memory accesses in solc...

Copy link
Contributor

Choose a reason for hiding this comment

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

We should document somewhere that the gasLimit parameter is ignored, that instead msg.value determines the gas limit.

Does this behavior make sense?

bytes payload;
}

uint256 private _sendId;
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename to _nextSendId?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

its actually the _lastSendId (its incremented before use, otherwise the first time we use it we would get 0)

adapterPayload
);
string memory axelarDestination = getAxelarChain(InteroperableAddress.formatV1(chainType, chainReference, ""));
string memory axelarTarget = address(bytes20(remoteGateway)).toChecksumHexString(); // TODO non-evm chains?
Copy link
Contributor

Choose a reason for hiding this comment

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

What do we need to resolve this TODO?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did update this line, with a clarification as to what is requiered on the axelar side.


return sendId;
_axelarGasService.payNativeGasForContractCall{value: msg.value}(
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it okay to call this function after callContract has been invoked? I have a feeling that it needs to be called beforehand...

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

@Amxx Amxx Jul 29, 2025

Choose a reason for hiding this comment

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

@cjcobb23 what is the interface to pay gas AFTER a message is sent ?

Copy link
Contributor

Choose a reason for hiding this comment

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

As far as I know it's the addGas functions and those take tx hash and log index!

It really seems like there's no way to implement requestRelay for this adapter other than delaying callContract until requestRelay is called...

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.

2 participants